On 23/01/2019 10.27, Maxime Adam wrote:
> With that's said I'm willing to do this following directive
> 
> class MarkAsDeprecated(Directive):
> 
>     def run(self):
> 
>         txt = "Blablabla moved to :doc:{0}".format(self.arguments[0])
>         paragraph_node = nodes.paragraph(text=txt)
> 
>         return [paragraph_node]
> 
> But :doc: is not render. I think I should insert a pending_xref (not 
> sure it's the correct one but it's seems to be) node but I really
> don't know how to do it.

In such cases, I find it is often helpful to look at how the role in
question is implemented.

However, there is another option which you may find easier, especially
as you need to generate several nodes for your directive's body: use
self.state.nested_parse to convert your reST source to nodes.

-- 
Matthew

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to