- Timestamp:
- Jul 13, 2012 6:22:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
specdomain/trunk/src/specdomain/sphinxcontrib/specdomain.py
r1007 r1012 239 239 self.indexnode['entries'].append(('single', indextext, targetname, '')) 240 240 self.indexnode['entries'].append(('single', sig, targetname, '')) 241 # TODO: what if there is more than one file, same name, different path? 242 filename = os.path.split(signode.document.current_source)[1] 243 if filename.endswith('.mac'): 244 # TODO: change the match pattern with an option 245 indextext = '%s; %s' % (filename, sig) 246 self.indexnode['entries'].append(('single', indextext, targetname, '')) 247 248 macro_types = { 249 'def': 'SPEC macro definition; %s', 250 'rdef': 'SPEC run-time macro definition; %s', 251 'cdef': 'SPEC chained macro definition; %s', 252 } 241 253 242 254 def _get_index_text(self, name): 243 macro_types = { 244 'def': 'SPEC macro definition; %s', 245 'rdef': 'SPEC run-time macro definition; %s', 246 'cdef': 'SPEC chained macro definition; %s', 247 } 248 if self.objtype in macro_types: 249 return _(macro_types[self.objtype]) % name 255 if self.objtype in self.macro_types: 256 return _(self.macro_types[self.objtype]) % name 250 257 else: 251 258 return '' … … 298 305 299 306 def add_target_and_index(self, name, sig, signode): 300 targetname = '%s-%s' % (self.objtype, name) 307 #text = u'! ' + sig # TODO: How to use emphasized index entry in this context? 308 text = name.split()[0] # when sig = "tth #: scattering angle" 309 targetname = '%s-%s' % (self.objtype, text) 301 310 signode['ids'].append(targetname) 302 311 # TODO: role does not point back to it yet 303 312 # http://sphinx.pocoo.org/markup/misc.html#directive-index 304 text = u'! ' + sig # TODO: How to use emphasized index entry in this context?305 text = sig # FIXME: temporary override306 313 self.indexnode['entries'].append(('single', text, targetname, '')) 307 314 text = u'SPEC %s variable; %s' % (self.objtype, sig)
Note: See TracChangeset
for help on using the changeset viewer.