[sphinx-users] Re: Using variables inside code block and httpdomain directives

2017-09-13 Thread Peter Burdine
A code block isn't parsed.  If you want Sphinx to process it, you need to 
use a parsed-literal.  This also comes with all the downsides of being 
parsed, escaping, markup, etc.

I don't know about the http directive.

Depending on how much you need to do, you may want to look at the jinja 
extension.  The contents of jinja blocks including subdirectives (like 
code-block) are parsed by jinja first, then Sphinx.

--Peter

On Wednesday, September 13, 2017 at 1:35:34 AM UTC-7, Adam Szmyd wrote:
>
> Is it possible to use some kind of variable mechanism in code blocks?
>
> I.e. i have such line in `conf.py`:
>
> my_config_value = 42
> rst_epilog = '.. |my_conf_val| replace:: %d' % my_config_value
>
>
> And when i use it in some regular text like so:
>
> My config value is |my_conf_val|!
>
>
>
> Sphinx nicely replace the var and output as follows:
>
> My config value is 42!
>>
>
> But when i try the same using code block:
>
> .. code-block:: javascript
>
>  // |my_conf_val|
>
>
> I get unreplaced *|my_conf_val|* string in the output.
>
> Is it possible to achieve something similar (variables) inside code block?
> Not sure if its related but it seems that other directives also does not 
> handle this properly, i.e. `http` directive from `sphinxcontrib.httpdomain` 
> package:
>
> .. http:get:: |my_conf_va||/users
>
>
> Is also not replacing.
>
>

-- 
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.


Re: [sphinx-users] Sylius using Sphinx

2017-09-13 Thread Takayuki Shimizukawa
Done, Thanks!
https://github.com/sphinx-doc/sphinx/commit/7bda952e4a


On Wed, Sep 13, 2017 at 6:20 AM  wrote:

> Hi there!
>
> I am the Documentation Lead Developer of Sylius (
> https://github.com/Sylius/Sylius). Our documentation is built in Sphinx
> with our custom colour theme. It can be found on www.docs.sylius.org .
> We would love to be mentioned in the list of projects using Sphinx for
> their docs :).
>
> Best regards,
>
> Maggie
>
>
> --
> 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.
>

-- 
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.


[sphinx-users] Using variables inside code block and httpdomain directives

2017-09-13 Thread Adam Szmyd
Is it possible to use some kind of variable mechanism in code blocks?

I.e. i have such line in `conf.py`:

my_config_value = 42
rst_epilog = '.. |my_conf_val| replace:: %d' % my_config_value


And when i use it in some regular text like so:

My config value is |my_conf_val|!



Sphinx nicely replace the var and output as follows:

My config value is 42!
>

But when i try the same using code block:

.. code-block:: javascript

 // |my_conf_val|


I get unreplaced *|my_conf_val|* string in the output.

Is it possible to achieve something similar (variables) inside code block?
Not sure if its related but it seems that other directives also does not 
handle this properly, i.e. `http` directive from `sphinxcontrib.httpdomain` 
package:

.. http:get:: |my_conf_va||/users


Is also not replacing.

-- 
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.