Changeset 964


Ignore:
Timestamp:
Jun 22, 2012 6:36:09 PM (11 years ago)
Author:
jemian
Message:

refs #8, clean up the imports, provide .mac source link from autodocumenter

Location:
specdomain/src/specdomain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • specdomain/src/specdomain/sphinxcontrib/specdomain.py

    r963 r964  
    2020import re
    2121import string                                           #@UnusedImport
    22 import sys
     22import sys                                              #@UnusedImport
    2323
    2424from docutils import nodes                              #@UnusedImport
     
    3535from sphinx.util.docstrings import prepare_docstring    #@UnusedImport
    3636
    37 from docutils.statemachine import ViewList, string2lines
    38 import sphinx.util.nodes
     37#from docutils.statemachine import ViewList, string2lines
     38#import sphinx.util.nodes
    3939from sphinx.ext.autodoc import Documenter, bool_option
    40 from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \
    41      safe_getattr, safe_repr
    42 from sphinx.util.pycompat import base_exception, class_types
     40#from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \
     41#     safe_getattr, safe_repr
     42#from sphinx.util.pycompat import base_exception, class_types
    4343from specmacrofileparser import SpecMacrofileParser
    4444
    4545
     46# TODO: merge these with specmacrofileparser.py
    4647match_all                   = r'.*'
    4748non_greedy_filler           = match_all + r'?'
     
    166167        rest = prepare_docstring(extended_comment)
    167168
    168         # TODO: Another step should (like for Python) attach source code and provide
    169         #       links from each to highlighted source code blocks.
    170 
    171169        #self.add_line(u'', '<autodoc>')
    172170        #sig = self.format_signature()
    173171        #self.add_directive_header(sig)
     172       
     173        # TODO: Another step should (like for Python) attach source code and provide
     174        #       links from each to highlighted source code blocks.
     175        # This works for now.
     176        self.add_line(u'', '<autodoc>')
     177        line = 'source code:  :download:`%s <%s>`' % (macrofile, macrofile)
     178        self.add_line(line, macrofile)
     179        # TODO: Add each .mac file name to the Index
     180       
    174181        self.add_line(u'', '<autodoc>')
    175182        for linenumber, line in enumerate(rest):
  • specdomain/src/specdomain/test/cdef-examples.mac.rst

    r963 r964  
    55====================================================
    66
    7 source code:  :download:`cdef-examples.mac <cdef-examples.mac>`
    8 
    97.. autospecmacro:: cdef-examples.mac
  • specdomain/src/specdomain/test/shutter.mac.rst

    r963 r964  
    55====================================================
    66
    7 source code:  :download:`shutter.mac <shutter.mac>`
    8 
    97.. caution:: This file is as-received. 
    108        No attempt to prepare it for ReST comments has been made.
  • specdomain/src/specdomain/test/test-battery.mac.rst

    r963 r964  
    55====================================================
    66
    7 source code:  :download:`test-battery.mac <test-battery.mac>`
    8 
    97.. autospecmacro:: test-battery.mac
Note: See TracChangeset for help on using the changeset viewer.