Advice on design for a sphinx extension

39 views
Skip to first unread message

Matthew Brett

unread,
Mar 24, 2014, 6:08:36 PM3/24/14
to sphin...@googlegroups.com
Hi,

I'm hoping for some advice from y'all on the Sphinx-onic way of writing my Sphinx extension.

I'm writing an extension to build html pages from IPython notebooks:


I've got a role like this:

    Here is :brole:`my notebook <the_notebook.ipynb>`

At the moment I'm doing something which feels terrible which is to build the html pages inside the role code, and pump that html into the html build directory.   It kind of works, but it means I have a problem implementing another role::

    Here's a link to :nblink:`that same notebook <the_notebook.ipynb>`.

This means I need to be able to collect all the notebooks I will build, with any options I passed with customized versions of ``brole``, and then go back and check my links later, which is not easy to do with my current crude setup.  More motivation here if that's not clear:


So - I'd like to as - what is the right way of doing this?  Can I / should I store parameters for each ``brole`` in the role code, and then hook into other sphinx events to go back and write the html / fix the links?

Thanks very much for any advice,

Cheers,

Matthew

Roland Puntaier

unread,
Mar 26, 2014, 2:02:18 PM3/26/14
to sphin...@googlegroups.com
I think tikz collects all the directives. Look there.
https://github.com/thewtex/sphinx-contrib/blob/master/tikz/sphinxcontrib/tikz.py

Regards, Roland
> --
> You received this message because you are subscribed to the Google
> Groups "sphinx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sphinx-dev+...@googlegroups.com
> <mailto:sphinx-dev+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages