Hi, Yes, your understanding is correct. autodoc reads a python script and generates reST code containing "py:*" directives. After that, generated code are parsed by nested_parse() I hope source code of AutoDirective class will help you. https://github.com/sphinx-doc/sphinx/blob/7faeb793e2e16cde4e5759443fb7f84efddcd9ea/sphinx/ext/autodoc/directive.py#L109-L158
Thanks, Takeshi KOMIYA 2019年10月12日(土) 3:03 YKdvd <[email protected]>: > > We use Autodesk's Maya 3D software, which embeds Python as a scripting > language, and I have a sphinx setup to create some docs for that. But Maya > also has an older, TCL-based scripting language called MEL which is used for > a lot of our codebase, and it would be nice to somehow pull some > documentation out of that as well. I was looking at the autodoc and > sphinx-js extensions code, and was wondering if I could do a fairly quick and > dirty extension that might help out? > > I haven't dug into all the details, but is this a reasonable high-level idea > of what an extension might do? It would register a domain, say "mel:", and > my .rst source file would use a directive like ".. mel:automelfile:: > some_mel_filename". My extension would implement a subclass of > SphinxDirective for this, and its run() method would return "a list of > nodes". I'd be responsible for finding and parsing the MEL file, but if I > could extract various blocks of text in Google docstring format (we use the > Napoleon extension for our Python autodocs), there would be sphinx functions > to turn them into py:module or py:function nodes or whatnot for my run() > method to return, similar to what autodoc is presumably doing? > > I wouldn't do anything fancy for the parsing, probably just some regular > expression stuff to try and get a top-level comment and the ones associated > with global procedures, but am I on the right track as to the design of an > extension like this? > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/3dbf618a-2e36-460e-a724-24989b8f8687%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFmkQANV80uvr7ur1bbSCytqzmMsNGHWj4adWuT-WdigF5vJ0Q%40mail.gmail.com.
