On Thu, Jun 21, 2012 at 1:06 PM, Pete <prjem...@gmail.com> wrote:

> Wow!  No takers to this question?  A bit ironic since Sphinx is a tool
> intended to help make documentation simpler.
>
> Still, it seems that to implement an autodoc capabilityfor SPEC macro
> source code files, I can add a similar directive (spec:macrofile) to the
> custom domain, construct a parser for the SPEC macro language, and then
> build the ReST page(s) in the directive's handler, a
> sphinx.directives.ObjectDescription object, from analysis of the parser's
> findings.  The code in the autodoc support is the best example of the
> algorithm simply because it is the only example to date.
>
> Any advice?
>
>
> On Friday, June 15, 2012 6:02:56 PM UTC-5, Pete wrote:
>>
>> I'm writing a custom domain (specdomain) to support the SPEC macro
>> language used to operate X-ray diffractometers.  Already, there are working
>> directives and roles for the language primitives.  How do I create the
>> support code for autodoc to extract docstrings and "#:" documentation tags
>> from the SPEC source source (text) files?  Is there an example to follow?
>>
>
I've often wondered about this, and while I don't really know the best way
to proceed, if you look at the autodoc source:
https://bitbucket.org/birkenfeld/sphinx/src/6e960412308f/sphinx/ext/autodoc.py

It looks like the way to do this would be to create objects that subclass
Documenter (or at least adhere to the same interface), and then register
them using the add_autodocumenter() function.  You might also need to
specify the path to your SPEC code somewhere, probably the conf.py file, so
that your autodocumenter can find the files it's documenting.

Of course I could be totally wrong...so if anyone out there knows better,
please correct me.

Good luck with this, and please report back and let us know how it goes!

Kevin Horn

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to