On 2013-06-27, Aivar Annamaa wrote:

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

> Hi!

> I need to write following scheme many times in my text (variable parts are 
> shown with underline):

> .. _exercise-*union_of_two_lists*:

> .. include:: exercises/*union_of_two_lists*.py
>     :start-after: """
>     :end-before: """ 

> I'd like to replace this with

> .. exercise:: *union_of_two_lists*

> What's the best/simplest approach for achieving this?

Subclassing `parsers.rst.directives.Include`

> Can I just replace my directive with shown two directives during read phase?
> Are "include"-s included during read phase or later?

The "include" directive is resolved as parse time, to-be-included files are
included in the input stream for further processing.

> Can you recommend an example extension, which does something similar?

http://docutils.sourceforge.net/docs/howto/rst-directives.html

Günter

-- 
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 http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to