inline code highlighting?

248 views
Skip to first unread message

Tim Arnold

unread,
Oct 27, 2011, 2:59:23 PM10/27/11
to sphin...@googlegroups.com
Hi, I'm learning sphinx now--great stuff!

I'm using the code-block highlighting a lot--flipping between 'html', 'latex', and 'python' languages.  For example,

.. code-block:: latex


Is there any directive for highlighting inline code? For now I'm just using markup like 
``\section{my section title}`` when writing a bit of code for LaTeX users for example.

I'm guessing it's not possible, given my search results so far.

thanks for any advice,
--Tim

Guenter Milde

unread,
Oct 28, 2011, 5:23:26 PM10/28/11
to sphin...@googlegroups.com
On 2011-10-27, Tim Arnold wrote:

> [-- Type: text/plain, Encoding: --]

> Hi, I'm learning sphinx now--great stuff!

> I'm using the code-block highlighting a lot--flipping between 'html',
> 'latex', and 'python' languages. For example,

> .. code-block:: latex


> Is there any directive for highlighting *inline *code? For now I'm just

> using markup like
> ``\section{my section title}`` when writing a bit of code for LaTeX users
> for example.

> I'm guessing it's not possible, given my search results so far.

There is now a :code:`role` in the reStructuredText reference
implementation Docutils (http://docutils/sf.net):

Changes Since 0.8.1
===================

* General:

- reStructuredText "code" role and directive with syntax highlighting
by Pygments_.
- "code" option of the "include" directive.

As Sphinx builds on the Docutils, upgrading Docutils to the development
version might help:

However, handling of syntax highlight in Sphinx and Docutils differs, so
your mileage might vary. Read the Docutils documentation (the one that
comes with the SVN repo or daily snapshot) in any case.

engelbert gruber

unread,
Oct 30, 2011, 6:04:23 AM10/30/11
to sphin...@googlegroups.com
and if reuired 0.8.2 is possible too

> --
> You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
> To post to this group, send email to sphin...@googlegroups.com.
> To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
>
>

--
http://darefoot.blogspot.com

Reply all
Reply to author
Forward
0 new messages