Changeset 942 for specdomain/src/specdomain/sphinxcontrib/specdomain.py
- Timestamp:
- Jun 18, 2012 6:19:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/src/specdomain/sphinxcontrib/specdomain.py
r941 r942 4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 5 6 SPEC domain. 7 8 :copyright: Copyright 2012 by Pete Jemian 9 :license: BSD, see LICENSE for details. 6 :synopsis: SPEC domain for Sphinx 7 8 Automatically insert ReST-formatted extended comments 9 from SPEC files for macro definitions and variable declarations into 10 the Sphinx doctree, thus avoiding duplication between docstrings and documentation 11 for those who like elaborate docstrings. 12 13 :copyright: Copyright 2012 by BCDA, Advanced Photon Source, Argonne National Laboratory 14 :license: ANL Open Source License, see LICENSE for details. 10 15 """ 11 16 … … 25 30 from sphinx.domains import Domain, ObjType, Index #@UnusedImport 26 31 from sphinx.util.compat import Directive #@UnusedImport 27 from sphinx.util.nodes import make_refnode 32 from sphinx.util.nodes import make_refnode, nested_parse_with_titles 28 33 from sphinx.util.docfields import Field, TypedField 29 34 from sphinx.util.docstrings import prepare_docstring #@UnusedImport 35 36 from docutils.statemachine import ViewList, string2lines 37 import sphinx.util.nodes 38 30 39 31 40 match_all = r'.*' … … 199 208 ''' 200 209 extended_comments_list = self.parse_macro_file(sig) 210 view = ViewList([u'TODO: recognize the ReST formatting in the following extended comment and it needs to be cleaned up']) 211 node = nodes.paragraph() 212 node.document = self.state.document 213 self.state.nested_parse(view, 0, signode) 214 # TODO: recognize the ReST formatting in the following extended comment and it needs to be cleaned up 201 215 for extended_comment in extended_comments_list: 202 linenumber = -1 # FIXME:203 #for line in prepare_docstring(extended_comment, ignore=1):204 # self.result.append(self.indent + line, sig, linenumber) # FIXME:216 for line in string2lines(extended_comment): 217 view = ViewList([line]) 218 nested_parse_with_titles(self.state, view, signode) 205 219 return sig 206 220 … … 227 241 #e = node.end() 228 242 #t = buf[s:e] 229 results.append(node.groups() ) # TODO: can we get line number also?243 results.append(node.groups()[0]) # TODO: can we get line number also? 230 244 return results 231 245
Note: See TracChangeset
for help on using the changeset viewer.