Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.145.82.96
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/docutils-doc/docs/user/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/doc/docutils-doc/docs/user/tools.html
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>Docutils Front-End Tools</title>
<meta name="author" content="David Goodger" />
<meta name="date" content="2013-07-03" />
<meta name="copyright" content="This document has been placed in the public domain." />
<link rel="stylesheet" href="../../css/html4css1.css" type="text/css" />
</head>
<body>
<div class="document" id="docutils-front-end-tools">
<h1 class="title">Docutils Front-End Tools</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>David Goodger</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference external" href="mailto:docutils-develop&#64;lists.sourceforge.net">docutils-develop&#64;lists.sourceforge.net</a></td></tr>
<tr><th class="docinfo-name">Revision:</th>
<td>7677</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2013-07-03</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>This document has been placed in the public domain.</td></tr>
</tbody>
</table>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id2">Introduction</a><ul>
<li><a class="reference internal" href="#getting-help" id="id3">Getting Help</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-tools" id="id4">The Tools</a><ul>
<li><a class="reference internal" href="#html-generating-tools" id="id5">HTML-Generating Tools</a><ul>
<li><a class="reference internal" href="#buildhtml-py" id="id6">buildhtml.py</a></li>
<li><a class="reference internal" href="#rst2html-py" id="id7">rst2html.py</a><ul>
<li><a class="reference internal" href="#stylesheets" id="id8">Stylesheets</a></li>
</ul>
</li>
<li><a class="reference internal" href="#rstpep2html-py" id="id9">rstpep2html.py</a></li>
<li><a class="reference internal" href="#rst2s5-py" id="id10">rst2s5.py</a><ul>
<li><a class="reference internal" href="#themes" id="id11">Themes</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#latex-generating-tools" id="id12">LaTeX-Generating Tools</a><ul>
<li><a class="reference internal" href="#rst2latex-py" id="id13">rst2latex.py</a></li>
</ul>
</li>
<li><a class="reference internal" href="#xml-generating-tools" id="id14">XML-Generating Tools</a><ul>
<li><a class="reference internal" href="#rst2xml-py" id="id15">rst2xml.py</a></li>
</ul>
</li>
<li><a class="reference internal" href="#odf-openoffice-generating-tools" id="id16">ODF/OpenOffice-Generating Tools</a><ul>
<li><a class="reference internal" href="#rst2odt-py" id="id17">rst2odt.py</a></li>
</ul>
</li>
<li><a class="reference internal" href="#restructuredtext-generating-tools" id="id18">reStructuredText-Generating Tools</a></li>
<li><a class="reference internal" href="#testing-debugging-tools" id="id19">Testing/Debugging Tools</a><ul>
<li><a class="reference internal" href="#rst2pseudoxml-py" id="id20">rst2pseudoxml.py</a></li>
<li><a class="reference internal" href="#quicktest-py" id="id21">quicktest.py</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#customization" id="id22">Customization</a><ul>
<li><a class="reference internal" href="#command-line-options" id="id23">Command-Line Options</a></li>
<li><a class="reference internal" href="#configuration-files" id="id24">Configuration Files</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="introduction">
<h1><a class="toc-backref" href="#id2">Introduction</a></h1>
<p>Once the Docutils package is unpacked, you will discover a &quot;<tt class="docutils literal">tools</tt>&quot;
directory containing several front ends for common Docutils
processing.  Rather than a single all-purpose program, Docutils has
many small front ends, each specialized for a specific &quot;Reader&quot; (which
knows how to interpret a file in context), a &quot;Parser&quot; (which
understands the syntax of the text), and a &quot;Writer&quot; (which knows how
to generate a specific data format).</p>
<p>Most front ends have common options and the same command-line usage
pattern:</p>
<pre class="literal-block">
toolname [options] [&lt;source&gt; [&lt;destination]]
</pre>
<p>(The exceptions are <a class="reference internal" href="#buildhtml-py">buildhtml.py</a> and <a class="reference internal" href="#rstpep2html-py">rstpep2html.py</a>.)  See
<a class="reference internal" href="#rst2html-py">rst2html.py</a> for concrete examples.  Each tool has a &quot;<tt class="docutils literal"><span class="pre">--help</span></tt>&quot;
option which lists the <a class="reference internal" href="#command-line-options">command-line options</a> and arguments it
supports.  Processing can also be customized with <a class="reference internal" href="#configuration-files">configuration
files</a>.</p>
<p>The two arguments, &quot;source&quot; and &quot;destination&quot;, are optional.  If only
one argument (source) is specified, the standard output (stdout) is
used for the destination.  If no arguments are specified, the standard
input (stdin) is used for the source as well.</p>
<p>In Debian these tools are installed in the normal system path, without the
<tt class="docutils literal">.py</tt> extension, according to Debian policy.
<a class="reference internal" href="#buildhtml-py">buildhtml.py</a> is installed as rst-buildhtml.</p>
<div class="section" id="getting-help">
<h2><a class="toc-backref" href="#id3">Getting Help</a></h2>
<p>First, try the &quot;<tt class="docutils literal"><span class="pre">--help</span></tt>&quot; option each front-end tool has.</p>
<p>Users who have questions or need assistance with Docutils or
reStructuredText should post a message to the <a class="reference external" href="mailing-lists.html#docutils-users">Docutils-users</a> mailing
list.</p>
</div>
</div>
<div class="section" id="the-tools">
<h1><a class="toc-backref" href="#id4">The Tools</a></h1>
<div class="section" id="html-generating-tools">
<h2><a class="toc-backref" href="#id5">HTML-Generating Tools</a></h2>
<div class="section" id="buildhtml-py">
<h3><a class="toc-backref" href="#id6">buildhtml.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Readers:</th><td class="field-body">Standalone, PEP</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writers:</th><td class="field-body">HTML, PEP/HTML</td>
</tr>
</tbody>
</table>
<p>In Debian this tool is installed under the name rst-buildhtml.</p>
<p>Use <tt class="docutils literal">buildhtml.py</tt> to generate .html from all the .txt files
(including PEPs) in each &lt;directory&gt; given, and their subdirectories
too.  (Use the <tt class="docutils literal"><span class="pre">--local</span></tt> option to skip subdirectories.)</p>
<p>Usage:</p>
<pre class="literal-block">
rst-buildhtml [options] [&lt;directory&gt; ...]
</pre>
<p>After unpacking the Docutils package, the following shell commands
will generate HTML for all included documentation:</p>
<pre class="literal-block">
cd docutils/tools
buildhtml.py ..
</pre>
<p>For official releases, the directory may be called &quot;docutils-X.Y&quot;,
where &quot;X.Y&quot; is the release version.  Alternatively:</p>
<pre class="literal-block">
cd docutils
tools/buildhtml.py --config=tools/docutils.conf
</pre>
<p>The current directory (and all subdirectories) is chosen by default if
no directory is named.  Some files may generate system messages
(docs/user/rst/demo.txt contains intentional errors); use the
<tt class="docutils literal"><span class="pre">--quiet</span></tt> option to suppress all warnings.  The <tt class="docutils literal"><span class="pre">--config</span></tt> option
ensures that the correct settings are in place (a <tt class="docutils literal">docutils.conf</tt>
<a class="reference internal" href="#configuration-file">configuration file</a> in the current directory is picked up
automatically).  Command-line options may be used to override config
file settings or replace them altogether.</p>
</div>
<div class="section" id="rst2html-py">
<h3><a class="toc-backref" href="#id7">rst2html.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">HTML</td>
</tr>
</tbody>
</table>
<p>In Debian this front end is installed as rst2html.</p>
<p>The <tt class="docutils literal">rst2html.py</tt> front end reads standalone reStructuredText source
files and produces HTML 4 (XHTML 1) output compatible with modern
browsers that support cascading stylesheets (CSS).  A stylesheet is
required for proper rendering; a simple but complete stylesheet is
installed and used by default (see <a class="reference internal" href="#stylesheets">Stylesheets</a> below).</p>
<p>For example, to process a reStructuredText file &quot;<tt class="docutils literal">test.txt</tt>&quot; into
HTML:</p>
<pre class="literal-block">
rst2html test.txt test.html
</pre>
<p>Now open the &quot;<tt class="docutils literal">test.html</tt>&quot; file in your favorite browser to see the
results.  To get a footer with a link to the source file, date &amp; time
of processing, and links to the Docutils project, add some options:</p>
<pre class="literal-block">
rst2html -stg test.txt test.html
</pre>
<div class="section" id="stylesheets">
<h4><a class="toc-backref" href="#id8">Stylesheets</a></h4>
<p><tt class="docutils literal">rst2html.py</tt> inserts into the generated HTML a cascading stylesheet
(or a link to a stylesheet, when passing the &quot;<tt class="docutils literal"><span class="pre">--link-stylesheet</span></tt>&quot;
option).  A stylesheet is required for proper rendering.  The default
stylesheet (<tt class="docutils literal">docutils/writers/html4css1/html4css1.css</tt>, located in
the installation directory) is provided for basic use.  To use a
different stylesheet, you must specify the stylesheet's location with
a &quot;<tt class="docutils literal"><span class="pre">--stylesheet</span></tt>&quot; (for a URL) or &quot;<tt class="docutils literal"><span class="pre">--stylesheet-path</span></tt>&quot; (for a
local file) command-line option, or with <a class="reference internal" href="#configuration-file">configuration file</a>
settings (e.g. <tt class="docutils literal">./docutils.conf</tt> or <tt class="docutils literal"><span class="pre">~/.docutils</span></tt>).  To experiment
with styles, please see the <a class="reference external" href="../howto/html-stylesheets.html">guide to writing HTML (CSS) stylesheets
for Docutils</a>.</p>
</div>
</div>
<div class="section" id="rstpep2html-py">
<h3><a class="toc-backref" href="#id9">rstpep2html.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">PEP</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">PEP/HTML</td>
</tr>
</tbody>
</table>
<p>In Debian this front end is installed as rstpep2html.</p>
<p><tt class="docutils literal">rstpep2html.py</tt> reads a new-style PEP (marked up with
reStructuredText) and produces HTML.  It requires a template file and
a stylesheet.  By default, it makes use of a &quot;<tt class="docutils literal"><span class="pre">pep-html-template</span></tt>&quot;
file and the &quot;<tt class="docutils literal">pep.css</tt>&quot; stylesheet (both in the
<tt class="docutils literal">docutils/writers/pep_html/</tt> directory), but these can be overridden
by command-line options or configuration files.</p>
<p>For example, to process a PEP into HTML:</p>
<pre class="literal-block">
cd &lt;path-to-docutils&gt;/docs/peps
rstpep2html pep-0287.txt pep-0287.html
</pre>
</div>
<div class="section" id="rst2s5-py">
<h3><a class="toc-backref" href="#id10">rst2s5.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">S5/HTML</td>
</tr>
</tbody>
</table>
<p>In Debian this is installed as rst2s5.</p>
<p>The <tt class="docutils literal">rst2s5.py</tt> front end reads standalone reStructuredText source
files and produces (X)HTML output compatible with <a class="reference external" href="http://meyerweb.com/eric/tools/s5/">S5</a>, the &quot;Simple
Standards-based Slide Show System&quot; by Eric Meyer.  A theme is required
for proper rendering; several are distributed with Docutils and others
are available; see <a class="reference internal" href="#themes">Themes</a> below.</p>
<p>For example, to process a reStructuredText file &quot;<tt class="docutils literal">slides.txt</tt>&quot; into
S5/HTML:</p>
<pre class="literal-block">
rst2s5 slides.txt slides.html
</pre>
<p>Now open the &quot;<tt class="docutils literal">slides.html</tt>&quot; file in your favorite browser, switch
to full-screen mode, and enjoy the results.</p>
<div class="section" id="themes">
<h4><a class="toc-backref" href="#id11">Themes</a></h4>
<p>Each S5 theme consists of a directory containing several files:
stylesheets, JavaScript, and graphics.  These are copied into a
<tt class="docutils literal"><span class="pre">ui/&lt;theme&gt;</span></tt> directory beside the generated HTML.  A theme is chosen
using the &quot;<tt class="docutils literal"><span class="pre">--theme</span></tt>&quot; option (for themes that come with Docutils) or
the &quot;<tt class="docutils literal"><span class="pre">--theme-url</span></tt>&quot; option (for themes anywhere).  For example, the
&quot;medium-black&quot; theme can be specified as follows:</p>
<pre class="literal-block">
rst2s5 --theme medium-black slides.txt slides.html
</pre>
<p>The theme will be copied to the <tt class="docutils literal"><span class="pre">ui/medium-black</span></tt> directory.</p>
<p>Several themes are included with Docutils:</p>
<dl class="docutils">
<dt><tt class="docutils literal">default</tt></dt>
<dd><p class="first">This is a simplified version of S5's default theme.</p>
<table class="last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">black serif text on a white background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 13 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">light blue, bold sans-serif text on a dark blue
background; titles are limited to one line</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">small, gray, bold sans-serif text on a dark blue
background</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">small-white</span></tt></dt>
<dd><p class="first">(Small text on a white background.)</p>
<table class="last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">black serif text on a white background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 15 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">black, bold sans-serif text on a white background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">small, dark gray, bold sans-serif text on a white
background</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">small-black</span></tt></dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">white serif text on a black background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 15 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">white, bold sans-serif text on a black background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">small, light gray, bold sans-serif text on a black
background</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">medium-white</span></tt></dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">black serif text on a white background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 9 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">black, bold sans-serif text on a white background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">small, dark gray, bold sans-serif text on a white
background</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">medium-black</span></tt></dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">white serif text on a black background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 9 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">white, bold sans-serif text on a black background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">small, light gray, bold sans-serif text on a black
background</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">big-white</span></tt></dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">black, bold sans-serif text on a white background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 5 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">black, bold sans-serif text on a white background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">not displayed</td>
</tr>
</tbody>
</table>
</dd>
<dt><tt class="docutils literal"><span class="pre">big-black</span></tt></dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Main content:</th><td class="field-body">white, bold sans-serif text on a black background</td>
</tr>
<tr class="field"><th class="field-name">Text capacity:</th><td class="field-body">about 5 lines</td>
</tr>
<tr class="field"><th class="field-name">Headers:</th><td class="field-body">white, bold sans-serif text on a black background;
titles wrap</td>
</tr>
<tr class="field"><th class="field-name">Footers:</th><td class="field-body">not displayed</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p>If a theme directory contains a file named <tt class="docutils literal">__base__</tt>, the name of
the theme's base theme will be read from it.  Files are accumulated
from the named theme, any base themes, and the &quot;default&quot; theme (which
is the implicit base of all themes).</p>
<p>For details, please see <a class="reference external" href="slide-shows.html">Easy Slide Shows With reStructuredText &amp;
S5</a>.</p>
</div>
</div>
</div>
<div class="section" id="latex-generating-tools">
<h2><a class="toc-backref" href="#id12">LaTeX-Generating Tools</a></h2>
<div class="section" id="rst2latex-py">
<h3><a class="toc-backref" href="#id13">rst2latex.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">LaTeX2e</td>
</tr>
</tbody>
</table>
<p>In Debian this is installed as rst2latex.</p>
<p>The <tt class="docutils literal">rst2latex.py</tt> front end reads standalone reStructuredText
source files and produces LaTeX2e output. For example, to process a
reStructuredText file &quot;<tt class="docutils literal">test.txt</tt>&quot; into LaTeX:</p>
<pre class="literal-block">
rst2latex test.txt test.tex
</pre>
<p>The output file &quot;<tt class="docutils literal">test.tex</tt>&quot; should then be processed with <tt class="docutils literal">latex</tt>
or <tt class="docutils literal">pdflatex</tt> to get a document in DVI, PostScript or PDF format for
printing or on-screen viewing.</p>
<p>For details see <a class="reference external" href="latex.html">Generating LaTeX with Docutils</a>.</p>
</div>
</div>
<div class="section" id="xml-generating-tools">
<h2><a class="toc-backref" href="#id14">XML-Generating Tools</a></h2>
<div class="section" id="rst2xml-py">
<h3><a class="toc-backref" href="#id15">rst2xml.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">XML (Docutils native)</td>
</tr>
</tbody>
</table>
<p>In Debian this is installed as rst2xml.</p>
<p>The <tt class="docutils literal">rst2xml.py</tt> front end produces Docutils-native XML output.
This can be transformed with standard XML tools such as XSLT
processors into arbitrary final forms. An example is the <a class="reference external" href="../../../sandbox/xml2rst">xml2rst</a> processor
in the Docutils sandbox.</p>
</div>
</div>
<div class="section" id="odf-openoffice-generating-tools">
<h2><a class="toc-backref" href="#id16">ODF/OpenOffice-Generating Tools</a></h2>
<div class="section" id="rst2odt-py">
<h3><a class="toc-backref" href="#id17">rst2odt.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">ODF/.odt</td>
</tr>
</tbody>
</table>
<p>In Debian this front end is installed as rst2odt.</p>
<p>The <tt class="docutils literal">rst2odt.py</tt> front end reads standalone reStructuredText
source files and produces ODF/.odt files that can be read, edited,
printed, etc with OpenOffice <tt class="docutils literal">oowriter</tt>
(<a class="reference external" href="http://www.openoffice.org/">http://www.openoffice.org/</a>).  A stylesheet file is required.  A
stylesheet file is an OpenOffice .odt file containing definitions
of the styles required for <tt class="docutils literal">rst2odt.py</tt>.  You can learn more
about how to use <tt class="docutils literal">rst2odt.py</tt>, the styles used <tt class="docutils literal">rst2odt.py</tt>,
etc from <a class="reference external" href="odt.html">Odt Writer for Docutils</a>.</p>
</div>
</div>
<div class="section" id="restructuredtext-generating-tools">
<h2><a class="toc-backref" href="#id18">reStructuredText-Generating Tools</a></h2>
<p>Currently, there is no reStructuredText writer in Docutils and therefore
an <tt class="docutils literal">rst2rst.py</tt> tool is still missing.</p>
<p>To generate reStructuredText documents with Docutils, you can use
the XML (Docutils native) writer and the <a class="reference external" href="../../../sandbox/xml2rst">xml2rst</a> processor.</p>
</div>
<div class="section" id="testing-debugging-tools">
<h2><a class="toc-backref" href="#id19">Testing/Debugging Tools</a></h2>
<div class="section" id="rst2pseudoxml-py">
<h3><a class="toc-backref" href="#id20">rst2pseudoxml.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">Standalone</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">Pseudo-XML</td>
</tr>
</tbody>
</table>
<p>In Debian this is installed as rst2pseudoxml.</p>
<p><tt class="docutils literal">rst2pseudoxml.py</tt> is used for debugging the Docutils &quot;Reader to
Transform to Writer&quot; pipeline.  It produces a compact pretty-printed
&quot;pseudo-XML&quot;, where nesting is indicated by indentation (no end-tags).
External attributes for all elements are output, and internal
attributes for any leftover &quot;pending&quot; elements are also given.</p>
</div>
<div class="section" id="quicktest-py">
<h3><a class="toc-backref" href="#id21">quicktest.py</a></h3>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Reader:</th><td class="field-body">N/A</td>
</tr>
<tr class="field"><th class="field-name">Parser:</th><td class="field-body">reStructuredText</td>
</tr>
<tr class="field"><th class="field-name">Writer:</th><td class="field-body">N/A</td>
</tr>
</tbody>
</table>
<p>This tool is not currently installed by the Debian package;
<tt class="docutils literal"><span class="pre">apt-get</span> source <span class="pre">python-docutils</span></tt> if you need it.</p>
<p>The <tt class="docutils literal">quicktest.py</tt> tool is used for testing the reStructuredText
parser.  It does not use a Docutils Reader or Writer or the standard
Docutils command-line options.  Rather, it does its own I/O and calls
the parser directly.  No transforms are applied to the parsed
document.  Various forms output are possible:</p>
<ul class="simple">
<li>Pretty-printed pseudo-XML (default)</li>
<li>Test data (Python list of input and pseudo-XML output strings;
useful for creating new test cases)</li>
<li>Pretty-printed native XML</li>
<li>Raw native XML (with or without a stylesheet reference)</li>
</ul>
</div>
</div>
</div>
<div class="section" id="customization">
<h1><a class="toc-backref" href="#id22">Customization</a></h1>
<div class="section" id="command-line-options">
<h2><a class="toc-backref" href="#id23">Command-Line Options</a></h2>
<p>Each front-end tool supports command-line options for one-off
customization.  For persistent customization, use <a class="reference internal" href="#configuration-files">configuration
files</a>.  Command-line options take priority over configuration file
settings.</p>
<p>Use the &quot;--help&quot; option on each of the front ends to list the
command-line options it supports.  Command-line options and their
corresponding configuration file entry names are listed in the
<a class="reference external" href="config.html">Docutils Configuration Files</a> document.</p>
</div>
<div class="section" id="configuration-files">
<span id="configuration-file"></span><h2><a class="toc-backref" href="#id24">Configuration Files</a></h2>
<p>Configuration files are used for persistent customization; they can be
set once and take effect every time you use a front-end tool.</p>
<p>For details, see <a class="reference external" href="config.html">Docutils Configuration Files</a>.</p>
<!-- Local Variables:
mode: indented-text
indent-tabs-mode: nil
sentence-end-double-space: t
fill-column: 70
End: -->
</div>
</div>
</div>
</body>
</html>

Anon7 - 2022
AnonSec Team