示例#1
0
文件: core.py 项目: ElfeXu/weakpoint
    def _load_config(self):
        self.config = deepcopy(self.default_config)

        f = File(normpath(self.src.path, 'config.yaml'))
        if f.exists:
            self.config.update(Config(f.content))
        else:
            print "missing config.yaml, abort"
            sys.exit(1)
示例#2
0
文件: core.py 项目: ElfeXu/weakpoint
    def _parse(self):

        path = File(normpath(self.src.path, 'slides.md'))
        if not path.exists:
            print "slides.md is required, abort"
            sys.exit(1)
        if self.config['markup'] == 'markdown':
            return markdown_parser.Parser().parse(path.content)
        elif self.config['markup'] == 'misaka':
            return misaka_parser.Parser().parse(path.content)
        else:
            print 'no such markup: {0}'.format(config['markup'])
            sys.exit(1)