CodeVocabSphinxDocutils

From VoCamp Wiki
Jump to: navigation, search

Docutils / Sphinx[edit]

Actually Sphinx generates the HTML, docutils is a support library http://sphinx.pocoo.org/ext/appapi.html#sphinx.application.Sphinx.add_role

Modules:[edit]

Each module gets its own page.


Functions:[edit]

They are wrapped in a dl tag, class name "function", sometimes it is "method" ... don't know where the difference comes from

"class name" is inside element with class "descclassname"

"function name" is inside <tt> element with class "descname"

Example:

<dl class="function">
<dt id="os.write">
<tt class="descclassname">os.</tt><tt class="descname">write</tt><big>(</big><em>fd</em>, <em>str</em><big>)</big><a class="headerlink" href="#os.write" title="Permalink to this definition">¶</a></dt>

Function parameters:[edit]

Function parameters are not encoded semantically in any way. no classes are assigned, "em" element is used to name parameters, then textual square brackets are used to denote optional paramters

constants/variables:[edit]

They are wrapped in a dl tag, class name "data"

"class name" is inside <tt> element with class "descclassname"

"function name" is insite <tt> element with class "descname"

Example:

<dl class="data">
<dt id="os.O_RDONLY">
<tt class="descclassname">os.</tt><tt class="descname">O_RDONLY</tt><a class="headerlink" href="#os.O_RDONLY" title="Permalink to this definition">¶</a></dt>

Examples[edit]

Examples are put inside double div, first one having class "highlight-rest", second one "highlight"

<div class="highlight-rest"><div class="highlight"><pre>class math(docutils.nodes.Element)