ItuToHtml

Converts an Initial Translation Unit (ITU) i.e. a file, to HTML.

class cpip.ItuToHtml.ItuToHtml(theItu, theHtmlDir, keepGoing=False, macroRefMap=None, cppCondMap=None, ituToTuLineSet=None)

Converts an ITU to HTML and write it to the output directory.

__init__(theItu, theHtmlDir, keepGoing=False, macroRefMap=None, cppCondMap=None, ituToTuLineSet=None)

Takes an input source file and an output directory.

Parameters:
  • theItu (str) – The original source file path (or file like object for the input).
  • theHtmlDir (str) – The output directory for the HTML or a file-like object for the output.
  • keepGoing (bool) – If True keep going as far as possible.
  • macroRefMap (dict({str : [list([tuple([<class 'str'>, <class 'int'>, str])]), list([tuple([<class 'str'>, int, str])]), list([tuple([str, int, str])])]})) – Map of {identifier : href_text, ...) to link to macro definitions.
  • cppCondMap (cpip.core.CppCond.CppCondGraphVisitorConditionalLines) – Conditional compilation map.
  • ituToTuLineSet (NoneType, set([int])) – Set of integer line numbers which are lines that can be linked to the translation unit representation.
Returns:

NoneType

__weakref__

list of weak references to the object (if defined)

_convert()

Convert ITU to HTML.

Returns:NoneType
Raises:ExceptionItuToHTML on failure.
_handleToken(theS, t, tt)

Handle a token.

Parameters:
Returns:

NoneType

_incAndWriteLine(theS)

Write a line.

Parameters:theS (cpip.util.XmlWrite.XhtmlStream) – The HTML stream.
Returns:NoneType
_initReader()

Create and return a reader, initialise internals.

Returns:cpip.core.ItuToTokens.ItuToTokens – The file tokeniser.
_writeTextWithNewlines(theS, theText, spanClass)

Splits text by newlines and writes it out.

Parameters:
Returns:

NoneType