예제 #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
    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))