On 2013-01-24, Alex Reinhart wrote:

> [-- Type: text/plain, Encoding:  --]

> Hello,

> I'm trying to create a custom Sphinx directive that can be 
> cross-referenced. For instance, I'd like to make an "exercise" directive 
> that gives an example problem for the reader to solve, and which can be 
> cross-referenced later ("see exercise 1.3").

> The ordinary label syntax (.. _label:) doesn't work on custom directives. I 
> could make a new domain and create an "exercise" object, but objects in 
> domains don't appear to be customizable. For instance, I couldn't make my 
> exercise directive display as an admonition or give it any custom features

The :name: option of a directive crates a label for cross referencing.
http://docutils.sourceforge.net/docs/ref/rst/directives.html#name

This should also be possible to use for custom directives.
See the Docutils source code for examples.
http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/parsers/rst/directives/

Günter


-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sphinx-users?hl=en.


Reply via email to