Changeset 965
- Timestamp:
- Jun 23, 2012 1:56:38 AM (10 years ago)
- Location:
- specdomain/src/specdomain/sphinxcontrib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/src/specdomain/sphinxcontrib/specdomain.py
r964 r965 42 42 #from sphinx.util.pycompat import base_exception, class_types 43 43 from specmacrofileparser import SpecMacrofileParser 44 from docutils.statemachine import ViewList 44 45 45 46 … … 117 118 member_order = 50 118 119 priority = 0 120 #: true if the generated content may contain titles 121 titles_allowed = True 119 122 120 123 option_spec = { … … 133 136 Generate reST for the object given by *self.name*, and possibly for 134 137 its members. 135 136 If *more_content* is given, include that content. If *real_modname* is137 given, use that module name to find attribute docs. If *check_module* is138 True, only generate if the object is defined in the module name it is139 imported from. If *all_members* is True, document all members.140 138 """ 141 139 # now, parse the SPEC macro file … … 143 141 spec = SpecMacrofileParser(macrofile) 144 142 extended_comment = spec.ReST() 145 146 # FIXME:147 # Assume all extended comments contain ReST formatted comments,148 # *including initial section titles or transitions*.149 '''150 cdef-examples.mac:7: SEVERE: Unexpected section title.151 152 Examples of SPEC cdef macros153 ==============================154 test-battery.mac:4: SEVERE: Unexpected section title or transition.155 156 ###############################################################################157 test-battery.mac:6: WARNING: Block quote ends without a blank line; unexpected unindent.158 test-battery.mac:6: SEVERE: Unexpected section title or transition.159 160 ###############################################################################161 test-battery.mac:19: SEVERE: Unexpected section title.162 163 common/shutter164 ==============165 '''166 167 143 rest = prepare_docstring(extended_comment) 168 144 … … 171 147 #self.add_directive_header(sig) 172 148 173 # TODO: Another step should (like for Python) attach source code and provide 174 # links from each to highlighted source code blocks. 149 # TODO: provide links from each to highlighted source code blocks (like Python documenters). 175 150 # This works for now. 176 151 self.add_line(u'', '<autodoc>') … … 178 153 self.add_line(line, macrofile) 179 154 # TODO: Add each .mac file name to the Index 180 155 181 156 self.add_line(u'', '<autodoc>') 182 157 for linenumber, line in enumerate(rest): 183 158 self.add_line(line, macrofile, linenumber) 159 184 160 #self.add_content(rest) 185 161 #self.document_members(all_members) … … 194 170 195 171 :returns: True if if parsing was successful 196 197 .. Note:: The template method from autodoc sets *self.modname*, *self.objpath*, *self.fullname*,198 *self.args* and *self.retann*. This is not done here yet.199 172 """ 200 173 ret = self.name 201 self.fullname = os.path.abspath(ret) # TODO: Consider using this 202 self.fullname = ret # TODO: provisional 174 self.fullname = os.path.abspath(ret) 175 self.objpath, self.modname = os.path.split(self.fullname) 176 self.args = None 177 self.retann = None 203 178 if self.args or self.retann: 204 179 self.directive.warn('signature arguments or return annotation ' -
specdomain/src/specdomain/sphinxcontrib/specmacrofileparser.py
r963 r965 104 104 ''' 105 105 106 # consider using: docutils.statemachine here 106 107 states = ( # assume SPEC def macros cannot be nested 107 108 'global', # the level that provides the SPEC command prompt
Note: See TracChangeset
for help on using the changeset viewer.