Inserting raw HTML

6,533 views
Skip to first unread message

Markus Gritsch

unread,
Jun 6, 2008, 8:34:08 AM6/6/08
to sphin...@googlegroups.com
Hi,

is it possible to have some text which is taken as is from the source
.rst file and inserted into the output .html file? For example I
would like to use something like
<big>text</big>
and
<span style="text-decoration: underline;">text</span>
in my documentation.

Kind regards,
Markus

Martin Geisler

unread,
Jun 6, 2008, 8:42:12 AM6/6/08
to sphin...@googlegroups.com
"Markus Gritsch" <m.gr...@gmail.com> writes:

Hi Markus

Sphinx builds on Docutils, so just use the normal "raw" directive:

http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data-pass-through

Something like this for your first example:

.. raw:: html

<big>text</big>

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.

Markus Gritsch

unread,
Jun 6, 2008, 8:47:33 AM6/6/08
to sphin...@googlegroups.com
Thank you,

It also works for my second example :) Seems to be an undocumented
feature, or maybe I didn't look close enough into the docs.

Kind regards,
Markus


2008/6/6 Martin Geisler <m...@daimi.au.dk>:

Sebastian Wiesner

unread,
Jun 6, 2008, 9:06:08 AM6/6/08
to sphin...@googlegroups.com
[ "Markus Gritsch" <m.gr...@gmail.com> ]

> It also works for my second example :) Seems to be an undocumented
> feature, or maybe I didn't look close enough into the docs.

When editing ReST, it's always recommendable to keep the docutils
documentation at hands, especially the following pages:

http://docutils.sourceforge.net/docs/user/rst/quickref.html
http://docutils.sourceforge.net/docs/ref/rst/roles.html
http://docutils.sourceforge.net/docs/ref/rst/directives.html

They give a quick overview about ReST itself as well as the available
directives and roles. The last link mentions the raw directive under "Raw
Data Pass-Through".

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)


signature.asc

Markus Gritsch

unread,
Jun 6, 2008, 3:00:19 PM6/6/08
to sphin...@googlegroups.com
Ah, I see. Thank you for the links.

2008/6/6 Sebastian Wiesner <basti....@gmx.net>:

Reply all
Reply to author
Forward
0 new messages