/ HappyDoc3-r3_1 / happydoclib / docset / base.py / MultiFileDocSet
Base class for documentation sets which write to multiple files.
This class further extends the DocSet class by adding several
convenience methods for handling files, as well as a few basic
handlers.
Methods
|
|
|
processDirectory
|
processDirectory ( self, packageTreeNode )
Handler for application/x-directory nodes.
Creates the output directory and writes the table of contents
file.
|
|
writeText
|
writeText (
self,
output,
text,
textFormat,
)
Format and write the text to the output .
Arguments:
-
output
- Stream to which
text should be written.
-
text
- String to be written.
-
textFormat
- String identifying the format of
text so
the formatter can use a docstring converter to convert the
body of text to the appropriate output format.
-
quote=1
- Boolean option to control whether the text
should be quoted to escape special characters.
|
|
writeFileHeader
|
writeFileHeader (
self,
output,
packageTreeNode,
title='',
subtitle='',
)
Given an open output stream, write a header using the title and subtitle.
Subclasses must implement this method.
Exceptions
|
|
NotImplementedError( 'writeFileHeader' )
|
|
|
_computeRelativeHREF
|
_computeRelativeHREF (
self,
source,
destination,
)
Compute the HREF to point from the output file of source to destination.
|
|
closeOutput
|
closeOutput ( self, output )
Close the output stream.
Writes a footer to the output stream and then closes it.
|
|
writeFileFooter
|
writeFileFooter ( self, output )
Given an open output stream, write a footer using the title and subtitle.
Subclasses must implement this method.
Exceptions
|
|
NotImplementedError( 'writeFileFooter' )
|
|
|
writeTOCFile
|
writeTOCFile ( self, packageTreeNode )
Write the table of contents for a directory.
Subclasses must implement this method.
The packageTreeNode is a directory, and the table of contents
for that directory should be written as appropriate.
|
|
_initializeWriters
|
_initializeWriters ( self )
Hook to allow subclasses to register writers without having to
override __init__ with all of its arguments.
|
|
noopHandler
|
noopHandler ( self, packageTreeNode )
Handler that does nothing.
|
|
getOutputFilenameForPackageTreeNode
|
getOutputFilenameForPackageTreeNode (
self,
packageTreeNode,
includePath=1,
)
Returns a filename where documentation for packageTreeNode should be written.
The filename will be in the output directory, possibly in a
subdirectory based on the path from the input root to the
input file.
For example:
input_directory : /foo/input
containing : /foo/input/bar.py
output_directory : /foo/output
results in : /foo/output/input/bar.py
|
|
rmkdir
|
rmkdir ( self, path )
Create a directory and all of its children.
|
|
processPlainTextFile
|
processPlainTextFile ( self, packageTreeNode )
Handler for text/x-structured and text/plain nodes.
Converts the input file to the output file format and
generates the output. The output directory is assumed to
already exist.
|
|
formatText
|
formatText (
self,
text,
textFormat,
)
Returns text formatted appropriately for output by this docset.
Arguments:
-
text
- String to be formatted.
-
textFormat
- String identifying the format of
text so
the formatter can use a docstring converter to convert the
body of text to the appropriate output format.
-
quote=1
- Boolean option to control whether the text
should be quoted to escape special characters.
|
|
processPythonFile
|
processPythonFile ( self, packageTreeNode )
Handler for text/x-python nodes.
Exceptions
|
|
NotImplementedError( 'processPythonFile' )
|
|
|
_unquoteString
|
_unquoteString ( self, str )
Remove surrounding quotes from a string.
|
|
openOutput
|
openOutput (
self,
name,
packageTreeNode,
title='',
subtitle='',
)
Open the output stream from the name.
Opens the output stream and writes a header using title and
subtitle. Returns the stream.
|
|
copyInputFileToOutput
|
copyInputFileToOutput ( self, packageTreeNode )
Copy the input file to the appropriate place in the output.
|
|
|