Logo Search packages:      
Sourcecode: uicilibris version File versions  Download package

def uicilibris::w2book::wiki2book::convert2book (   self,
  lines,
  report = False 
)
convert to LaTeX book
@param lines a list of lines
@param report if True, messages are emitted to sys.stderr;
if it is callable, it is invoked with the same messages

Definition at line 199 of file w2book.py.

                                              :
        """
        convert to LaTeX book
        @param lines a list of lines
        @param report if True, messages are emitted to sys.stderr;
        if it is callable, it is invoked with the same messages
        """
        self.state = w2bstate()
        result = [''] #start with one empty line as line 0
        codebuffer = []

        nowikimode = False
        codemode = False

        for line in lines:
            (line, nowikimode) = wikiParser.get_nowikimode(line, nowikimode)
            if nowikimode:
                result.append(line)
            else:
                (line, _codemode) = wikiParser.get_codemode(line, codemode)
                if _codemode and not codemode: #code mode was turned on
                    codebuffer = []
                elif not _codemode and codemode: #code mode was turned off
                    expand_code_segment(result, codebuffer, self.state)
                codemode = _codemode

                if codemode:
                    codebuffer.append(line)
                else:
                    self.state.current_line = len(result)
                    result.append(transform(line, self.state, report))

        result.append(transform("", self.state, report))   # close open environments

        #insert defverbs somewhere at the beginning
        expand_code_defverbs(result, self.state)
        return result


Generated by  Doxygen 1.6.0   Back to index