chiark / gitweb /
m.dox: not just pages can have sections.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 1 Jan 2018 20:22:48 +0000 (21:22 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 1 Jan 2018 20:37:15 +0000 (21:37 +0100)
pelican-plugins/m/dox.py
pelican-plugins/m/test/dox/page.html
pelican-plugins/m/test/dox/page.rst

index f3c35d9e083e95708c092c3844065b0ca871eb17..aad2de1cabb1274f4a5a799e9f5681e7e54b0ebb 100644 (file)
@@ -58,10 +58,6 @@ def init(pelicanobj):
                     link = path + child.find('filename').text + '.html'
                     symbol_mapping[child.find('name').text] = (child.find('title').text, link)
 
-                    # Page sections
-                    for section in child.findall('docanchor'):
-                        symbol_mapping[section.text] = (section.attrib.get('title', ''), link + '#' + section.text)
-
                 # Linking to files
                 if child.attrib['kind'] == 'file':
                     link = path + child.find('filename').text + ".html"
@@ -98,6 +94,10 @@ def init(pelicanobj):
                             for value in member.findall('enumvalue'):
                                 symbol_mapping[enumeration + '::' + value.text] = (None, link + '#' + value.attrib['anchor'])
 
+                # Sections
+                for section in child.findall('docanchor'):
+                    symbol_mapping[section.text] = (section.attrib.get('title', ''), link + '#' + section.text)
+
 def dox(name, rawtext, text, lineno, inliner: Inliner, options={}, content=[]):
     title, target = parse_link(text)
 
index fc0d953a67c1723fe1ef0235497a304b410542af..87415d1c2159197b016ef9d5668c3d33ed5aa972 100644 (file)
@@ -30,6 +30,7 @@
 <li><a href="http://doc.magnum.graphics/corrade/testsuite.html">Custom link title</a></li>
 <li><a href="http://doc.magnum.graphics/corrade/corrade-cmake.html">Page link with custom title</a></li>
 <li><a href="http://doc.magnum.graphics/corrade/">Link to index page</a></li>
+<li><a href="http://doc.magnum.graphics/corrade/classCorrade_1_1TestSuite_1_1Tester.html#TestSuite-Tester-command-line">Link to class documentation section</a></li>
 </ul>
 <p>These should produce warnings:</p>
 <ul>
index 47102b94d100b911433afc57393d34d26157c79f..6f3cfe1d6b07d917a6a827b03d53b1c750518ac2 100644 (file)
@@ -7,6 +7,7 @@ m.dox
 -   :dox:`Custom link title <testsuite>`
 -   :dox:`Page link with custom title <corrade-cmake>`
 -   :dox:`Link to index page <corrade>`
+-   :dox:`Link to class documentation section <TestSuite-Tester-command-line>`
 
 These should produce warnings: