コード例 #1
0
ファイル: test_exos.py プロジェクト: fredokun/tango
    def test_exos_liste(self):
        # 1) parsing
        
        parser = Parser()
        # BREAKPOINT >>> # import pdb; pdb.set_trace()  # <<< BREAKPOINT #
        doc = parser.parse_from_file("../examples/exosliste.tango.tex")

        # 2) processing
        processor = DocumentProcessor(doc)
        core.register_core_processors(processor)
        py_ctx = codeactive.PythonContext(dict())
        codeactive.register_processors(processor, py_ctx)

        try:
            processor.process()
        except codeactive.CheckPythonFailure:
            print("CheckPython failed, aborpting ...")
            return

        #print("After process = \n" + str(doc))

        # 3) generating
        latex_config = LatexConfiguration()
        latex_config.document_class = "article"
        generator = LatexDocumentGenerator(doc, latex_config)
        generator.generate()
コード例 #2
0
ファイル: test_latex.py プロジェクト: Mag-Stellon/tango
    def test_basic_example(self):
        # 1) parsing
        
        parser = Parser()

        # BREAKPOINT >>> # import pdb; pdb.set_trace()  # <<< BREAKPOINT #
        doc = parser.parse_from_file("../examples/basic.tango.tex")

        # 2) processing
        processor = DocumentProcessor(doc)
        core.register_core_processors(processor)
        processor.process()

        # 3) generating
        latex_config = LatexConfiguration()
        latex_config.document_class = "article"

        generator = LatexDocumentGenerator(doc, latex_config)
        generator.generate()

        print("Output =\n" + str(generator.output))