コード例 #1
0
 def cleanup(self, document, files, postProcess=None):
     res = XHTMLRenderer.cleanup(self,
                                 document,
                                 files,
                                 postProcess=postProcess)
     self.database = dict()
     self.doEpubFiles(document)
     return res
コード例 #2
0
    def runRenderer(tmpdir, doc):
        # Create document file

        # Run plastex on the document
        os.chdir(str(tmpdir))
        Renderer().render(doc)
        assert tmpdir.join('index.html').isfile()

        # Get output file
        return Soup(tmpdir.join('index.html').read())
コード例 #3
0
ファイル: plastexwin.py プロジェクト: go38/exeLearning
import sys, os
from plasTeX import TeX, TeXDocument
from plasTeX.Config import config as texConfig
from plasTeX.Renderers.XHTML import Renderer

FILE = sys.argv[1]
tempdir = sys.argv[2]
texConfig['files']['split-level'] = -10
texConfig['files']['filename'] = u'index$num(0).html'
texConfig['general']['theme'] = 'minimal'
cwd = os.getcwd()
os.chdir(tempdir)
document = TeXDocument(config=texConfig)
tex = TeX.TeX(document, file=FILE)
Renderer().render(tex.parse())
os.chdir(cwd)
コード例 #4
0
def main(fname):
    document = plasTeX.TeXDocument()
    tex = TeX(document, myfile=fname)
    tex.parse()
    Renderer().render(document)
コード例 #5
0
 def cleanup(self, document, files, postProcess=None):
     res = XHTMLRenderer.cleanup(self, document, files, postProcess=postProcess)
     self.database = dict()
     self.doEpubFiles(document)
     return res