Hi, The language reference uses "::" many places where it seems it should be using ".. code-block:: llvm". The result is that Sphinx does not colorize these samples. Should I fix this? Or is it purposeful? Also, anybody but me that has noticed that Sphinx does not always colorize things even if you put the proper ".. code-block:: llvm" in front? If it is a known issue, I won't file a bug with the Sphinx people. -- Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131125/b00cc16d/attachment.html>
On Sun, Nov 24, 2013 at 10:19 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:> Hi, > > The language reference uses "::" many places where it seems it should be > using ".. code-block:: llvm". The result is that Sphinx does not colorize > these samples. > > Should I fix this? Or is it purposeful? >Could you give an example of what you are seeing? I don't really see any examples of the issue you are mentioning. FWIW, things that are syntax examples are "::" since they often contain meta-syntax e.g. `<result> fsub [fast-math flags]* <ty> <op1>, <op2>`.> > Also, anybody but me that has noticed that Sphinx does not always colorize > things even if you put the proper ".. code-block:: llvm" in front? If it > is a known issue, I won't file a bug with the Sphinx people. >The Pygments lexer is sort of "brittle" and will fail to syntax highlight things if they stray too far from the lexical syntax it expects (due to being out of date or misspecified in the Pygments highlighter). You should check that the upstream has the same issue < https://bitbucket.org/birkenfeld/pygments-main/src/9246d7a47a42e7920c0ecee4d4946b982e9e2430/pygments/lexers/asm.py?at=default#cl-193>. We may just need to update to the latest sphinx. -- Sean Silva> > > -- Mikael > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131125/b5e65ae6/attachment.html>
Okay, given that the Pygments lexer is sensitive about its input, I can understand that you do "::" instead of ".. code-block:: llvm". The colorizers I normally use do things through simple regular expressions for which reason they are quite robust and should be able to handle the syntax examples as well. I just wanted the syntax examples to be colorized as well, but given the above, that doens't make sense. Please just ignore my patch. -- Mikael 2013/11/25 Sean Silva <chisophugis at gmail.com>> > > > On Sun, Nov 24, 2013 at 10:19 PM, Mikael Lyngvig <mikael at lyngvig.org>wrote: > >> Hi, >> >> The language reference uses "::" many places where it seems it should be >> using ".. code-block:: llvm". The result is that Sphinx does not colorize >> these samples. >> >> Should I fix this? Or is it purposeful? >> > > Could you give an example of what you are seeing? I don't really see any > examples of the issue you are mentioning. FWIW, things that are syntax > examples are "::" since they often contain meta-syntax e.g. `<result> > fsub [fast-math flags]* <ty> <op1>, <op2>`. > > > >> >> Also, anybody but me that has noticed that Sphinx does not always >> colorize things even if you put the proper ".. code-block:: llvm" in front? >> If it is a known issue, I won't file a bug with the Sphinx people. >> > > The Pygments lexer is sort of "brittle" and will fail to syntax highlight > things if they stray too far from the lexical syntax it expects (due to > being out of date or misspecified in the Pygments highlighter). You should > check that the upstream has the same issue < > https://bitbucket.org/birkenfeld/pygments-main/src/9246d7a47a42e7920c0ecee4d4946b982e9e2430/pygments/lexers/asm.py?at=default#cl-193>. > We may just need to update to the latest sphinx. > > -- Sean Silva > > >> >> >> -- Mikael >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131126/b315783d/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Language Reference bug?
- [LLVMdev] [RFC] Removal of 'deplibs'?
- [LLVMdev] [RFC] Overhauling Attributes
- R Code and the Pygments Python SyntaxHighlighter
- [LLVMdev] [RFC] Moving to Sphinx for LLVM and friends documentation (with partial implementation (in both 10pt and 12pt font)).