1 =========================
2 README: Docutils 0.13.1
3 =========================
6 :Contact: goodger@python.org
8 :Web site: http://docutils.sourceforge.net/
9 :Copyright: This document has been placed in the public domain.
17 This is for those who want to get up & running quickly.
19 1. Docutils requires Python (version 2.4 or later), available from
21 http://www.python.org/
23 See Requirements_ below for details.
25 2. Use the latest Docutils code. Get the code from the `Subversion
26 repository`_ or from the snapshot:
28 http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar
30 See `Releases & Snapshots`_ below for details.
32 3. Unpack the tarball in a temporary directory (**not** directly in
33 Python's ``site-packages``), go to the directory created by expanding
34 the archive, and run ``setup.py install``. On
35 Windows systems it may be sufficient to double-click ``install.py``.
37 See Installation_ below for details.
39 4. Use the front-end scripts to convert reStructuredText documents.
42 rst2html.py FAQ.txt FAQ.html (Unix)
43 python tools/rst2html.py FAQ.txt FAQ.html (Windows)
45 See Usage_ below for details.
51 The purpose of the Docutils project is to create a set of tools for
52 processing plaintext documentation into useful formats, such as HTML,
53 XML, and LaTeX. Support for the following sources has been
58 * `PEPs (Python Enhancement Proposals)`_.
60 Support for the following sources is planned:
62 * Inline documentation from Python modules and packages, extracted
63 with namespace context.
65 * Email (RFC-822 headers, quoted excerpts, signatures, MIME parts).
67 * Wikis, with global reference lookups of "wiki links".
69 * Compound documents, such as multiple chapter files merged into a
72 * And others as discovered.
74 .. _PEPs (Python Enhancement Proposals):
75 http://www.python.org/peps/pep-0012.html
81 While we are trying to follow a "release early & often" policy,
82 features are added frequently. Since the code in the Subversion
83 repository is usually in a bug-free state, we recommend that you use
86 To get a snapshot, go to the code page and click the download snapshot
89 * Docutils code, documentation, front-end tools, and tests:
90 https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/
92 * Sandbox (experimental, contributed code):
93 https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/sandbox/
95 To keep up to date on the latest developments, download fresh copies of
96 the snapshots regularly or use a working copy of the
97 `Subversion repository`_.
99 .. _Subversion repository: docs/dev/repository.html
105 To run the code, Python_ must be installed.
106 Docutils is compatible with Python versions from 2.4 up to 2.7 and
107 versions 3.1 to 3.5 (cf. `Python 3 compatibility`_).
109 Docutils uses the following packages for enhanced functionality, if they are
112 * The `Python Imaging Library`_, or PIL, is used for some image
113 manipulation operations.
115 * The `Pygments`_ syntax highlighter is used for content of `code`
116 directives and roles.
118 .. _Python: http://www.python.org/.
119 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
120 .. _Pygments: http://pygments.org/
123 Python 3 compatibility
124 ----------------------
126 The Docutils codebase is written for Python 2 and uses "on-demand"
127 translation for `porting to Python 3`_.
129 * The `setup.py` script generates Python 3 compatible sources in
130 ``build/`` and tests in ``tests3/`` sub-directories during
131 installation_ with Python 3.
133 * The scripts in the ``tools/`` sub-directory work with all supported
134 Python versions without conversion.
136 * To convert the sources without installing (e.g. for testing), run
137 ``python3 setup.py build``.
139 * When editing the source, do changes on the Python 2 versions of the
140 files and re-run the build command.
142 .. _porting to Python 3: http://docs.python.org/py3k/howto/pyporting.html
145 Project Files & Directories
146 ===========================
148 * README.txt: You're reading it.
150 * COPYING.txt: Public Domain Dedication and copyright details for
151 non-public-domain files (most are PD).
153 * FAQ.txt: Frequently Asked Questions (with answers!).
155 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
157 * HISTORY.txt: A detailed change log, for the current and all previous
160 * BUGS.txt: Known bugs, and how to report a bug.
162 * THANKS.txt: List of contributors.
164 * setup.py: Installation script. See "Installation" below.
166 * install.py: Quick & dirty installation script. Just run it. For
167 any kind of customization or help though, setup.py must be used.
169 * docutils: The project source directory, installed as a Python
172 * docs: The project documentation directory. Read ``docs/index.txt``
175 * docs/user: The project user documentation directory. Contains the
176 following documents, among others:
178 - docs/user/tools.txt: Docutils Front-End Tools
179 - docs/user/latex.txt: Docutils LaTeX Writer
180 - docs/user/rst/quickstart.txt: A ReStructuredText Primer
181 - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
183 * docs/ref: The project reference directory.
184 ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
187 * licenses: Directory containing copies of license files for
188 non-public-domain files.
190 * tools: Directory for Docutils front-end tools. See
191 ``docs/user/tools.txt`` for documentation.
193 * test: Unit tests. Not required to use the software, but very useful
194 if you're planning to modify it. See `Running the Test Suite`_
197 Generated directories when installing under Python 3:
199 * build: Converted sources.
201 * test3: Converted tests.
207 The first step is to expand the ``.tgz`` archive in a temporary
208 directory (**not** directly in Python's ``site-packages``). It
209 contains a distutils setup file "setup.py". OS-specific installation
213 GNU/Linux, BSDs, Unix, Mac OS X, etc.
214 -------------------------------------
218 2. Go to the directory created by expanding the archive::
220 cd <archive_directory_path>
222 3. Install the package (you may need root permissions to complete this
226 (enter admin password)
227 python setup.py install
229 If the python executable isn't on your path, you'll have to specify
230 the complete path, such as ``/usr/local/bin/python``.
232 To install for a specific Python version, use this version in the
235 python3.1 setup.py install
237 To install for different Python versions, repeat step 3 for every
238 required version. The last installed version will be used in the
239 `shebang line`_ of the ``rst2*.py`` wrapper scripts.
241 .. _shebang line: http://en.wikipedia.org/wiki/Shebang_%28Unix%29
246 Just double-click ``install.py``. If this doesn't work, try the
249 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
250 calling it these days).
252 2. Go to the directory created by expanding the archive::
254 cd <archive_directory_path>
256 3. Install the package::
258 <path_to_python.exe>\python setup.py install
260 To install for a specific python version, specify the Python
261 executable for this version.
263 To install for different Python versions, repeat step 3 for every
268 * `running the test suite`_
270 * `converting the documentation`_
276 There are many front-end tools in the unpacked "tools" subdirectory.
277 Installation under Unix places copies in the PATH.
278 You may want to begin with the "rst2html.py" front-end tool. Most
279 tools take up to two arguments, the source path and destination path,
280 with STDIN and STDOUT being the defaults. Use the "--help" option to
281 the front-end tools for details on options and arguments. See
282 Docutils Front-End Tools (``docs/user/tools.txt``) for full documentation.
284 The package modules are continually growing and evolving. The
285 ``docutils.statemachine`` module is usable independently. It contains
286 extensive inline documentation (in reStructuredText format of course).
288 Contributions are welcome!
291 Converting the documentation
292 ============================
294 After unpacking and installing the Docutils package, the following
295 shell commands will generate HTML for all included documentation::
297 cd <archive_directory_path>/tools
300 On Windows systems, type::
302 cd <archive_directory_path>\tools
303 python buildhtml.py ..
305 The final directory name of the ``<archive_directory_path>`` is
306 "docutils" for snapshots. For official releases, the directory may be
307 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
310 cd <archive_directory_path>
311 tools/buildhtml.py --config=tools/docutils.conf (Unix)
312 python tools\buildhtml.py --config=tools\docutils.conf (Windows)
314 Some files may generate system messages (warnings and errors). The
315 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
316 five intentional errors. (They test the error reporting mechanism!)
319 Running the Test Suite
320 ======================
322 The test suite is documented in `Docutils Testing`_ (docs/dev/testing.txt).
324 To run the entire test suite, open a shell and use the following
327 cd <archive_directory_path>/test
330 Under Windows, type::
332 cd <archive_directory_path>\test
335 For testing with Python 3 use the converted test suite::
337 cd <archive_directory_path>/test3
341 You should see a long line of periods, one for each test, and then a
344 Ran 1111 tests in 24.653s
347 Elapsed time: 26.189 seconds
349 The number of tests will grow over time, and the times reported will
350 depend on the computer running the tests. The difference between the
351 two times represents the time required to set up the tests (import
352 modules, create data structures, etc.).
354 If any of the tests fail, please `open a bug report`_ or `send an email`_
355 (see `Bugs <BUGS.html>`_).
356 Please include all relevant output, information about your operating
357 system, Python version, and Docutils version. To see the Docutils
358 version, use one of the ``rst2*`` front ends or ``tools/quicktest.py``
359 with the ``--version`` option, e.g.::
362 ./quicktest.py --version
364 Windows users type these commands::
367 python quicktest.py --version
370 .. _Docutils Testing: http://docutils.sourceforge.net/docs/dev/testing.html
371 .. _open a bug report:
372 http://sourceforge.net/p/docutils/bugs/
373 .. _send an email: mailto:docutils-users@lists.sourceforge.net
374 ?subject=Test%20suite%20failure
380 If you have questions or need assistance with Docutils or
381 reStructuredText, please post a message to the Docutils-users_ mailing
384 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
390 indent-tabs-mode: nil
391 sentence-end-double-space: t