Just FYI: here is simple extension which I made for our project https://github.com/spotbugs/spotbugs/pull/451/commits/9a1eef0b602505360092cd1c66bac9c639447444#diff-a35e1d77ae8fdc583b6f417ea7b708ca
On Tuesday, October 10, 2017 at 12:22:15 AM UTC+8, Kengo TODA wrote: > > Thanks for your post, > > OK then I will try to make extension by own. I wish my solution becomes > portable enough to propose PR :) > > > On Thursday, October 5, 2017 at 12:59:16 AM UTC+8, Komiya Takeshi wrote: >> >> Hi Kengo, >> >> AFAIK, there are no way to do that. You need to search 3rd party >> extension or make new one to do that. >> >> parsed-literal is very powerful. It can generate literal-block >> including decorated text (em, strong and so on), hyperlinks, images, >> and so on. so it is hard to highlight its result. >> Of course, we are always welcome for your pull requests :-) >> >> Thanks, >> Takeshi KOMIYA >> >> 2017-10-03 17:59 GMT+09:00 Kengo TODA <[email protected]>: >> > Hello sphinx-users, >> > >> > >> > Thanks for your support to make documentation easy. >> > Could you tell me how I can use substitution in code-block with code >> > highlight? >> > >> > >> > # background >> > I'm making a web page which includes sample build script: >> > http://spotbugs.readthedocs.io/en/latest/migration.html >> > >> > This page includes version of the latest release of our product, >> > and I need to update .rst file manually to realize keeping the latest >> > version in this page. >> > Let me ask how I can eliminate manual tasks like this. >> > >> > I've found that I can use substitution and sphinx.ext.extlinks help me. >> > It works if version exists in text or hyperlink. But in case of >> code-block, >> > I cannot use substitution. >> > >> > # incomplete solution >> > I found the solution using parsed-literal block, but it doesn't support >> code >> > highlight >> > so look & feel are really bad. >> > - https://stackoverflow.com/a/12644533/814928 >> > >> > # known workaround >> > Maybe it is possible to: >> > 1. write code snippet into template file with |release| and/or >> |version|, >> > 2. generate replaced text from these template, >> > 3. write replaced text into temporal file, and >> > 4. use literalinclude directive (which supports code highlight) to >> include >> > replaced text >> > >> > I wish we have better solution which can simplify document generation. >> > >> > >> > Thanks in advance, >> > Kengo TODA >> > >> > -- >> > 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 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
