If you make your highlight-language python3, then Sphinx won't perform syntax checks before highlighting.
On Mon, Sep 17, 2012 at 10:01 AM, vitalije <vitali...@gmail.com> wrote: > I think I found what is the cause of this problem. Sphinx is checking code > snippet and if it finds syntax errors it refuses to highlight code. A Code > snippets that I was trying to highlight have some elements that are not > syntactically correct. Those are some directives that > Leo<http://sourceforge.net/projects/leo/files/Leo/>editor understands (that > is the editor I use). I don't know if it is > possible to tell sphinx not to check syntax of code snippets or not, but I > have found a solution. > > I made script that pre-process my rst files and replaces those code > snippets with the raw:html directive along with the output of pygments > highlight. I am primarily interested in producing html, so I don't mind > loosing readability of rst files. > > If anyone is interested to see my script, please let me know, I would be > glad to share it. Maybe it is too much tied to the tools I use and because > of that less interesting. > > I use Leo editor <http://sourceforge.net/projects/leo/files/Leo/> for > editing code and writing documentation. When I want to include some part of > source code in document I put 'LEOUNL' tag followed by path to the part I > want to insert (path includes language for highlighting, path to Leo > document and path inside Leo document to the code part). The script opens > Leo <http://sourceforge.net/projects/leo/files/Leo/> document and > replaces all tags with the proper parts of source code highlighted with > pygments and write rst files and finally executes make html. I have made my > own template to produce not whole html file but just part of body. The rest > of html is served from the fossil <http://www.fossil-scm.org> repository > that keeps also source code. > I find combination of those tools very powerful. If anyone wants to see > final documentation I made here are links: > kviziracija<http://manastirgradac.edu.rs/cgi-bin/bugs.cgi> > and igmator <http://manastirgradac.edu.rs/cgi-bin/igmator.cgi> > > Vitalije > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/sphinx-dev/-/FNq3ko-SwHYJ. > To post to this group, send email to sphinx-dev@googlegroups.com. > To unsubscribe from this group, send email to > sphinx-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sphinx-dev?hl=en. > -- Bryan A. Jones, Ph.D. Associate Professor Department of Electrical and Computer Engineering 231 Simrall / PO Box 9571 Mississippi State University Mississippi state, MS 39762 http://www.ece.msstate.edu/~bjones bjones AT ece DOT msstate DOT edu voice 662-325-3149 fax 662-325-2298 Our Master, Jesus Christ, is on his way. He'll show up right on time, his arrival guaranteed by the Blessed and Undisputed Ruler, High King, High God. - 1 Tim. 6:14b-15 (The Message) -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.