Calling the publish_* convenience functions (or instantiating a
Publisher object) with component names will result in default
behavior. For custom behavior (setting component options), create
custom component objects first, and pass them to
publish_*/Publisher. See The Docutils Publisher.
| Class | |
A facade encapsulating the high-level logic of a Docutils system. |
| Function | publish |
Set up & run a Publisher for command-line-based file I/O (input and output file paths taken automatically from the command line). Return the encoded string output also. |
| Function | publish |
Set up & run a Publisher for command-line-based file I/O (input and output file paths taken automatically from the command line). Return the encoded string output also. |
| Function | publish |
Set up & run a Publisher for programmatic use with string I/O. Return the document tree. |
| Function | publish |
Set up & run a Publisher for programmatic use with file-like I/O. Return the encoded string output also. |
| Function | publish |
Set up & run a Publisher to render from an existing document tree data structure, for programmatic use with string I/O. Return the encoded string output. |
| Function | publish |
Set up & run a Publisher, and return a dictionary of document parts. Dictionary keys are the names of parts, and values are Unicode strings; encoding is up to the client. For programmatic use with string I/O. |
| Function | publish |
Set up & run a Publisher for custom programmatic use. Return the encoded string output and the Publisher object. |
| Function | publish |
Set up & run a Publisher for programmatic use with string I/O. Return the encoded string or Unicode string output. |
| Variable | default |
Undocumented |
| Variable | default |
Undocumented |
Set up & run a Publisher for command-line-based file I/O (input and
output file paths taken automatically from the command line). Return the
encoded string output also.
Parameters: see publish_programmatically for the remainder.
argv: Command-line argument list to use instead of sys.argv[1:].usage: Usage string, output if there's a problem parsing the command line.description: Program description, output for the "--help" option (along with command-line option descriptions).
Set up & run a Publisher for command-line-based file I/O (input and
output file paths taken automatically from the command line). Return the
encoded string output also.
This is just like publish_cmdline, except that it uses io.BinaryFileOutput instead of io.FileOutput.
Parameters: see publish_programmatically for the remainder.
argv: Command-line argument list to use instead of sys.argv[1:].usage: Usage string, output if there's a problem parsing the command line.description: Program description, output for the "--help" option (along with command-line option descriptions).
Set up & run a Publisher for programmatic use with string I/O.
Return the document tree.
For encoded string input, be sure to set the 'input_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string input. Here's one way:
publish_doctree(..., settings_overrides={'input_encoding': 'unicode'})
Parameters: see publish_programmatically.
Set up & run a Publisher for programmatic use with file-like I/O.
Return the encoded string output also.
Parameters: see publish_programmatically.
Set up & run a Publisher to render from an existing document
tree data structure, for programmatic use with string I/O. Return
the encoded string output.
Note that document.settings is overridden; if you want to use the settings
of the original document, pass settings=document.settings.
Also, new document.transformer and document.reporter objects are generated.
For encoded string output, be sure to set the 'output_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string output. Here's one way:
publish_from_doctree(
..., settings_overrides={'output_encoding': 'unicode'})
Parameters: document is a docutils.nodes.document object, an existing
document tree.
Other parameters: see publish_programmatically.
Set up & run a Publisher, and return a dictionary of document parts.
Dictionary keys are the names of parts, and values are Unicode strings;
encoding is up to the client. For programmatic use with string I/O.
For encoded string input, be sure to set the 'input_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string input. Here's how:
publish_parts(..., settings_overrides={'input_encoding': 'unicode'})
Parameters: see publish_programmatically.
Set up & run a Publisher for custom programmatic use. Return the
encoded string output and the Publisher object.
Applications should not need to call this function directly. If it does seem to be necessary to call this function directly, please write to the Docutils-develop mailing list <http://docutils.sf.net/docs/user/mailing-lists.html#docutils-develop>.
Parameters:
source_classrequired: The class for dynamically created source objects. Typicallyio.FileInputorio.StringInput.source: Type depends onsource_class:- If
source_classisio.FileInput: Either a file-like object (must have 'read' and 'close' methods), or None (source_pathis opened). If neithersourcenorsource_pathare supplied,sys.stdinis used. - If
source_classisio.StringInputrequired: The input string, either an encoded 8-bit string (set the 'input_encoding' setting to the correct encoding) or a Unicode string (set the 'input_encoding' setting to 'unicode').
- If
source_path: Type depends onsource_class:io.FileInput: Path to the input file, opened if nosourcesupplied.io.StringInput: Optional. Path to the file or object that producedsource. Only used for diagnostic output.
destination_classrequired: The class for dynamically created destination objects. Typicallyio.FileOutputorio.StringOutput.destination: Type depends ondestination_class:io.FileOutput: Either a file-like object (must have 'write' and 'close' methods), or None (destination_pathis opened). If neitherdestinationnordestination_pathare supplied,sys.stdoutis used.io.StringOutput: Not used; pass None.
destination_path: Type depends ondestination_class:io.FileOutput: Path to the output file. Opened if nodestinationsupplied.io.StringOutput: Path to the file or object which will receive the output; optional. Used for determining relative paths (stylesheets, source links, etc.).
reader: Adocutils.readers.Readerobject.reader_name: Name or alias of the Reader class to be instantiated if noreadersupplied.parser: Adocutils.parsers.Parserobject.parser_name: Name or alias of the Parser class to be instantiated if noparsersupplied.writer: Adocutils.writers.Writerobject.writer_name: Name or alias of the Writer class to be instantiated if nowritersupplied.settings: A runtime settings (docutils.frontend.Values) object, for dotted-attribute access to runtime settings. It's the end result of theSettingsSpec, config file, and option processing. Ifsettingsis passed, it's assumed to be complete and no further setting/config/option processing is done.settings_spec: Adocutils.SettingsSpecsubclass or object. Provides extra application-specific settings definitions independently of components. In other words, the application becomes a component, and its settings data is processed along with that of the other components. Used only if nosettingsspecified.settings_overrides: A dictionary containing application-specific settings defaults that override the defaults of other components. Used only if nosettingsspecified.config_section: A string, the name of the configuration file section for this application. Overrides the config_section attribute defined bysettings_spec. Used only if nosettingsspecified.enable_exit_status: Boolean; enable exit status at end of processing?
Set up & run a Publisher for programmatic use with string I/O. Return
the encoded string or Unicode string output.
For encoded string output, be sure to set the 'output_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string output. Here's one way:
publish_string(..., settings_overrides={'output_encoding': 'unicode'})
Similarly for Unicode string input (source):
publish_string(..., settings_overrides={'input_encoding': 'unicode'})
Parameters: see publish_programmatically.