diff options
Diffstat (limited to 'docs/sphinx/gnuradio_sphinx.py')
-rw-r--r-- | docs/sphinx/gnuradio_sphinx.py | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/docs/sphinx/gnuradio_sphinx.py b/docs/sphinx/gnuradio_sphinx.py index 6f35a6fce..e8ca867f8 100644 --- a/docs/sphinx/gnuradio_sphinx.py +++ b/docs/sphinx/gnuradio_sphinx.py @@ -15,6 +15,7 @@ def setup(sp): sp.connect('autodoc-process-signature', fix_signature) sp.connect('autodoc-process-docstring', remove_lines) # Add node to autodocument signal-processing blocks. + sp.add_autodocumenter(OldBlockDocumenter) sp.add_autodocumenter(BlockDocumenter) sp.add_autodocumenter(PyBlockDocumenter) @@ -105,9 +106,10 @@ common_block_members =[ 'thisown', 'to_basic_block', 'unique_id', + 'make', ] -class BlockDocumenter(FunctionDocumenter): +class OldBlockDocumenter(FunctionDocumenter): """ Specialized Documenter subclass for gnuradio blocks. @@ -115,13 +117,13 @@ class BlockDocumenter(FunctionDocumenter): with the wrapped sptr (e.g. gr.gr_head_sptr) to keep the documentation tidier. """ - objtype = 'block' + objtype = 'oldblock' directivetype = 'function' # Don't want to use this for generic functions for give low priority. priority = -10 def __init__(self, *args, **kwargs): - super(BlockDocumenter, self).__init__(*args, **kwargs) + super(OldBlockDocumenter, self).__init__(*args, **kwargs) # Get class name bits = self.name.split('.') if len(bits) != 3 or bits[0] != 'gnuradio': @@ -129,6 +131,36 @@ class BlockDocumenter(FunctionDocumenter): sptr_name = 'gnuradio.{0}.{0}_{1}_sptr'.format(bits[1], bits[2]) # Create a Class Documenter to create documentation for the classes members. self.classdoccer = ClassDocumenter(self.directive, sptr_name, indent=self.content_indent) + self.classdoccer.doc_as_attr = False + self.classdoccer.real_modname = self.classdoccer.get_real_modname() + self.classdoccer.options.members = ALL + self.classdoccer.options.exclude_members = common_block_members + self.classdoccer.parse_name() + self.classdoccer.import_object() + + def document_members(self, *args, **kwargs): + return self.classdoccer.document_members(*args, **kwargs) + +class BlockDocumenter(FunctionDocumenter): + """ + Specialized Documenter subclass for new style gnuradio blocks. + + It merges together the documentation for the generator function (e.g. wavelet.squash_ff) + with the wrapped sptr (e.g. wavelet.squash_ff_sptr) to keep the documentation + tidier. + """ + objtype = 'block' + directivetype = 'function' + # Don't want to use this for generic functions for give low priority. + priority = -10 + + def __init__(self, *args, **kwargs): + super(BlockDocumenter, self).__init__(*args, **kwargs) + # Get class name + sptr_name = self.name + '_sptr' + # Create a Class Documenter to create documentation for the classes members. + self.classdoccer = ClassDocumenter(self.directive, sptr_name, indent=self.content_indent) + self.classdoccer.doc_as_attr = False self.classdoccer.real_modname = self.classdoccer.get_real_modname() self.classdoccer.options.members = ALL self.classdoccer.options.exclude_members = common_block_members |