Annotated Code

The code has little documentation; consider this file as an example how restbuilder can work with autodoc.

sphinxcontrib.restbuilder

Sphinx extension to output reST files.

copyright:Copyright 2012-2013 by Freek Dijkstra.
license:BSD, see LICENSE.txt for details.
sphinxcontrib.restbuilder.setup(app)

Registration of restbuilder extension to Sphinx: the builder and configuration variabeles.

sphinxcontrib.builders.rst

ReST Sphinx builder.

copyright:Copyright 2012-2013 by Freek Dijkstra.
license:BSD, see LICENSE.txt for details.
sphinxcontrib.builders.rst.relative_uri(base, to)

Return a relative URL from base to to.

Backport of sphinx.util.osutil.relative_uri() in Sphinx 1.2b, since earlier versions of the function have a few errors.

class sphinxcontrib.builders.rst.RstBuilder(app)

Bases: sphinx.builders.Builder

ReStructuredText builder. Deals with the input files and output files, and calling the respective Reader, Translator and Writer classes.

name = u'rst'
format = u'rst'
file_suffix = u'.rst'
maxwidth = 78
stdindent = 4
init()

Load necessary templates and perform initialization.

get_outdated_docs()

Return an iterable of input files that are outdated.

get_target_uri(docname, typ=None)
get_relative_uri(from_, to, typ=None)

Return a relative URI between two source filenames.

prepare_writing(docnames)
write_doc(docname, doctree)
finish()

sphinxcontrib.writers.rst

Custom docutils writer for ReStructuredText.

copyright:Copyright 2012-2013 by Freek Dijkstra.
license:BSD, see LICENSE.txt for details.
class sphinxcontrib.writers.rst.RstWriter(builder)

Bases: docutils.writers.Writer

Writer which initialises a RstTranslator, and outputs it to a specific document.

supported = (u'rst',)
settings_spec = (u'No options defined.', u'', ())
settings_defaults = {}
output = None
translate()
class sphinxcontrib.writers.rst.RstTranslator(document, builder)

Bases: sphinx.writers.text.TextTranslator

Translator which takes the doctree data format and turns it into a stream reStructuredText.

sectionchars = u'*=-~"+`'
log_unknown(type, node)
wrap(text, width=None)
add_text(text)
new_state(indent=None)
end_state(wrap=True, end=[u''], first=None)
visit_document(node)
depart_document(node)
visit_highlightlang(node)
visit_section(node)
depart_section(node)
visit_topic(node)
depart_topic(node)
visit_sidebar(node)
depart_sidebar(node)
visit_rubric(node)
depart_rubric(node)
visit_compound(node)
depart_compound(node)
visit_glossary(node)
depart_glossary(node)
visit_title(node)
depart_title(node)
visit_subtitle(node)
depart_subtitle(node)
visit_attribution(node)
depart_attribution(node)
visit_desc(node)
depart_desc(node)
visit_desc_signature(node)
depart_desc_signature(node)
visit_desc_name(node)
depart_desc_name(node)
visit_desc_addname(node)
depart_desc_addname(node)
visit_desc_type(node)
depart_desc_type(node)
visit_desc_returns(node)
depart_desc_returns(node)
visit_desc_parameterlist(node)
depart_desc_parameterlist(node)
visit_desc_parameter(node)
visit_desc_optional(node)
depart_desc_optional(node)
visit_desc_annotation(node)
depart_desc_annotation(node)
visit_refcount(node)
depart_refcount(node)
visit_desc_content(node)
depart_desc_content(node)
visit_figure(node)
depart_figure(node)
visit_caption(node)
depart_caption(node)
visit_productionlist(node)
visit_seealso(node)
depart_seealso(node)
visit_footnote(node)
depart_footnote(node)
visit_citation(node)
depart_citation(node)
visit_label(node)
visit_option_list(node)
depart_option_list(node)
visit_option_list_item(node)
depart_option_list_item(node)
visit_option_group(node)
depart_option_group(node)
visit_option(node)
depart_option(node)
visit_option_string(node)
depart_option_string(node)
visit_option_argument(node)
depart_option_argument(node)
visit_description(node)
depart_description(node)
visit_tabular_col_spec(node)
visit_colspec(node)
visit_tgroup(node)
depart_tgroup(node)
visit_thead(node)
depart_thead(node)
visit_tbody(node)
depart_tbody(node)
visit_row(node)
depart_row(node)
visit_entry(node)
depart_entry(node)
visit_table(node)
depart_table(node)
visit_acks(node)
visit_image(node)
visit_transition(node)
visit_bullet_list(node)
depart_bullet_list(node)
visit_enumerated_list(node)
depart_enumerated_list(node)
visit_definition_list(node)
depart_definition_list(node)
visit_list_item(node)
depart_list_item(node)
visit_definition_list_item(node)
depart_definition_list_item(node)
visit_term(node)
depart_term(node)
visit_termsep(node)
visit_classifier(node)
depart_classifier(node)
visit_definition(node)
depart_definition(node)
visit_field_list(node)
depart_field_list(node)
visit_field(node)
depart_field(node)
visit_field_name(node)
depart_field_name(node)
visit_field_body(node)
depart_field_body(node)
visit_centered(node)
depart_centered(node)
visit_hlist(node)
depart_hlist(node)
visit_hlistcol(node)
depart_hlistcol(node)
visit_admonition(node)
depart_admonition(node)
visit_attention(node)
depart_attention(node)
visit_caution(node)
depart_caution(node)
visit_danger(node)
depart_danger(node)
visit_error(node)
depart_error(node)
visit_hint(node)
depart_hint(node)
visit_important(node)
depart_important(node)
visit_note(node)
depart_note(node)
visit_tip(node)
depart_tip(node)
visit_warning(node)
depart_warning(node)
visit_versionmodified(node)
depart_versionmodified(node)
visit_literal_block(node)
depart_literal_block(node)
visit_doctest_block(node)
depart_doctest_block(node)
visit_line_block(node)
depart_line_block(node)
visit_line(node)
depart_line(node)
visit_block_quote(node)
depart_block_quote(node)
visit_compact_paragraph(node)
depart_compact_paragraph(node)
visit_paragraph(node)
depart_paragraph(node)
visit_target(node)
depart_target(node)
visit_index(node)
visit_substitution_definition(node)
visit_pending_xref(node)
depart_pending_xref(node)
visit_reference(node)
depart_reference(node)
visit_download_reference(node)
depart_download_reference(node)
visit_emphasis(node)
depart_emphasis(node)
visit_literal_emphasis(node)
depart_literal_emphasis(node)
visit_strong(node)
depart_strong(node)
visit_abbreviation(node)
depart_abbreviation(node)
visit_title_reference(node)
depart_title_reference(node)
visit_literal(node)
depart_literal(node)
visit_subscript(node)
depart_subscript(node)
visit_superscript(node)
depart_superscript(node)
visit_footnote_reference(node)
visit_citation_reference(node)
visit_Text(node)
depart_Text(node)
visit_generated(node)
depart_generated(node)
visit_inline(node)
depart_inline(node)
visit_problematic(node)
depart_problematic(node)
visit_system_message(node)
visit_comment(node)
visit_meta(node)
visit_raw(node)
unknown_visit(node)

Table Of Contents

Previous topic

Version History