On 2012-08-23, m...@mikesolomon.org wrote:
> Hey all,

> I know that parsed-literal is a literal block that supports inline
> markups, but is there a literal block that supports inline directives?

All reST directives are block-level elements, but only inline-markup is
parsed in a parsed-literal block
http://docutils.sourceforge.net/docs/ref/rst/directives.html#parsed-literal-block

There is no literal block variant that supports nested directives.

> Specifically, I need to do something like:

> .. parsed-literal::
>   .. raw:: html
>      :file: test.html

Even if the raw directive were parsed, the content would be included
"as-is", without any processing by Docutils and only if the output format
is HTML. This will not work for the display of HTML source code.

> The goal is for the contents of test.html are displayed in literal
> typeset. Of course, I could copy and paste the contents of test.html
> in a literal block, but test.html will change a lot and multiple people
> will be working on it, so it'd be better to use the contents of the
> file itself.

With Docutils >= 0.9, you can achieve this (without parsing of
rst-inline-markup in the HTML file) with the "include" directive::

  .. include:: test.html
     :code: HTML

http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment

To pass the content of the included file to a "parsed literal" block, a new
option for the "include" directive would be required. Then you could write

  .. include:: test.html
     :parsed-literal: HTML

If you think this would help you (and others), you may file an enhancement
request at the Docutils tracker
http://sourceforge.net/tracker/?group_id=38414

As a workaround, you may consider inserting the html file into the
parsed-literal block with a helper script before the sphinx run.

Günter

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

Reply via email to