Changeset 988
- Timestamp:
- Jul 2, 2012 12:10:31 PM (11 years ago)
- Location:
- specdomain/trunk/src/specdomain
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/trunk/src/specdomain/sphinxcontrib/specdomain.py
r987 r988 134 134 self.add_line(u'', '<autodoc>') 135 135 self.add_line(u'.. index:: SPEC macro file; %s' % macrofile, '<autodoc>') 136 self.add_line(u'.. index:: !%s' % os.path.split(macrofile)[1], '<autodoc>') 136 137 self.add_line(u'', '<autodoc>') 137 138 line = 'source code: :download:`%s <%s>`' % (macrofile, macrofile) … … 204 205 205 206 def handle_signature(self, sig, signode): 207 '''return the name of this object from its signature''' 206 208 # Must be able to match these (without preceding def or rdef) 207 209 # def macro_name … … 240 242 # TODO: array variables are not handled at all 241 243 # TODO: variables cited by *role* should link back to their *directive* declarations 242 # probably need to override handle_signature(), add_target_and_index(), and _get_index_text() 244 # probably need to override handle_signature() and add_target_and_index() 245 246 def handle_signature(self, sig, signode): 247 '''return the name of this object from its signature''' 248 # TODO: Should it match a regular expression? 249 # TODO: What if global or local? 250 return sig 251 252 def add_target_and_index(self, name, sig, signode): 253 targetname = '%s-%s' % (self.objtype, name) 254 signode['ids'].append(targetname) 255 # TODO: index entry here is at line before directive, now must get it right 256 # TODO: role does not point back to it yet 257 # http://sphinx.pocoo.org/markup/misc.html#directive-index 258 text = u'! ' + sig # TODO: How to use emphasized index entry in this context? 259 text = sig # FIXME: temporary override 260 self.indexnode['entries'].append(('single', text, targetname, '')) 261 text = u'SPEC %s variable; %s' % (self.objtype, sig) 262 self.indexnode['entries'].append(('single', text, targetname, '')) 243 263 244 264 class SpecXRefRole(XRefRole): -
specdomain/trunk/src/specdomain/test/index.rst
r963 r988 14 14 test_doc 15 15 16 Example Python Source code documentation 17 ============================================= 18 19 .. toctree:: 20 :maxdepth: 2 21 22 python-example-source 23 16 24 Indices and tables 17 25 ================== -
specdomain/trunk/src/specdomain/test/test_doc.rst
r983 r988 144 144 145 145 *.mac 146 python-example-source
Note: See TracChangeset
for help on using the changeset viewer.