CodeVocabSphinxDocutils
From VoCamp Wiki
Contents |
[edit] Docutils / Sphinx
Actually Sphinx generates the HTML, docutils is a support library http://sphinx.pocoo.org/ext/appapi.html#sphinx.application.Sphinx.add_role
[edit] Modules:
Each module gets its own page.
[edit] Functions:
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>
[edit] Function parameters:
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
[edit] constants/variables:
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>
[edit] Examples
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)