Sphinx substitutions next to angle brackets

I am trying to use substitutions in a parsed literal block in my Sphinx documentation as follows:

<dependency> ... <version>|release|</version> </dependency> 

What happens like this:

 <dependency> ... <version>|release|</version> </dependency> 

Where I want this:

 <dependency> ... <version>1.7.3</version> </dependency> 

If I add spaces to the substitution in the source, I get the following:

 <dependency> ... <version> 1.7.3 </version> </dependency> 

So, I know that release is defined as I expect. How can I get rid of spaces?

+1
source share
1 answer

It works:

 .. parsed-literal:: <version>\ |release|\ </version> .. |release| replace:: 1.7.3 

Link: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism

+2
source

Source: https://habr.com/ru/post/979378/


All Articles