You can create serial numbers using
env.new_serialno('your_string_here')
It should create a unique incrementing number for each string you give it.
So if your wanted to create a special admonition, it would be:
env.new_serialnl('special_admonition')
This would go in your directive's run method.
You may be able to monkey patch some of the admonitions adding this, or
your could extend them and create your own directive.
On Monday, June 12, 2017 at 3:04:26 PM UTC-7, Augusto Teixeira wrote:
>
> Hey,
>
> I was wandering if it is possible to automatically number admonitions (or
> to create a special admonition which is numbered). Something that works
> well both when building for Latex and for HTML.
>
> Is this provided already or should I create an extension? In case it is
> not very complicated I would be glad to implement it, but would appreciate
> any hints on how to go about it.
>
> In fact I have asked this before in a question in Stack Overflow
> <https://stackoverflow.com/questions/40512444/how-to-number-admonitions-in-sphinx>,
>
> but it received no input...
>
> Best,
> Augusto
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.