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`` with admin rights. 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 very frequently. Since the code in the Subversion
83 repository is usually in a bug-free state, we recommend that you use
84 the current snapshot (which is usually updated within an hour of
85 changes being committed to the repository):
87 * Snapshot of Docutils code, documentation, front-end tools, and
89 http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar
91 * Snapshot of the Sandbox (experimental, contributed code):
92 http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/sandbox/?view=tar
94 To keep up to date on the latest developments, download fresh copies of
95 the snapshots regularly or use a working copy of the
96 `Subversion repository`_.
98 .. _Subversion repository: docs/dev/repository.html
104 To run the code, Python_ must be installed.
105 Docutils is compatible with Python versions from 2.4 up to 2.7 and
106 versions 3.1 to 3.5 (cf. `Python 3 compatibility`_).
108 Docutils uses the following packages for enhanced functionality, if they are
111 * The `Python Imaging Library`_, or PIL, is used for some image
112 manipulation operations.
114 * The `Pygments`_ syntax highlighter is used for content of `code`
115 directives and roles.
117 .. _Python: http://www.python.org/.
118 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
119 .. _Pygments: http://pygments.org/
122 Python 3 compatibility
123 ----------------------
125 The Docutils codebase is written for Python 2 and uses "on-demand"
126 translation for `porting to Python 3`_.
128 * The `setup.py` script generates Python 3 compatible sources in
129 ``build/`` and tests in ``tests3/`` sub-directories during
130 installation_ with Python 3.
132 * The scripts in the ``tools/`` sub-directory work with all supported
133 Python versions without conversion.
135 * To convert the sources without installing (e.g. for testing), run
136 ``python3 setup.py build``.
138 * When editing the source, do changes on the Python 2 versions of the
139 files and re-run the build command.
141 .. _porting to Python 3: http://docs.python.org/py3k/howto/pyporting.html
144 Project Files & Directories
145 ===========================
147 * README.txt: You're reading it.
149 * COPYING.txt: Public Domain Dedication and copyright details for
150 non-public-domain files (most are PD).
152 * FAQ.txt: Frequently Asked Questions (with answers!).
154 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
156 * HISTORY.txt: A detailed change log, for the current and all previous
159 * BUGS.txt: Known bugs, and how to report a bug.
161 * THANKS.txt: List of contributors.
163 * setup.py: Installation script. See "Installation" below.
165 * install.py: Quick & dirty installation script. Just run it. For
166 any kind of customization or help though, setup.py must be used.
168 * docutils: The project source directory, installed as a Python
171 * docs: The project documentation directory. Read ``docs/index.txt``
174 * docs/user: The project user documentation directory. Contains the
175 following documents, among others:
177 - docs/user/tools.txt: Docutils Front-End Tools
178 - docs/user/latex.txt: Docutils LaTeX Writer
179 - docs/user/rst/quickstart.txt: A ReStructuredText Primer
180 - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
182 * docs/ref: The project reference directory.
183 ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
186 * licenses: Directory containing copies of license files for
187 non-public-domain files.
189 * tools: Directory for Docutils front-end tools. See
190 ``docs/user/tools.txt`` for documentation.
192 * test: Unit tests. Not required to use the software, but very useful
193 if you're planning to modify it. See `Running the Test Suite`_
196 Generated directories when installing under Python 3:
198 * build: Converted sources.
200 * test3: Converted tests.
206 The first step is to expand the ``.tgz`` archive in a temporary
207 directory (**not** directly in Python's ``site-packages``). It
208 contains a distutils setup file "setup.py". OS-specific installation
212 GNU/Linux, BSDs, Unix, Mac OS X, etc.
213 -------------------------------------
217 2. Go to the directory created by expanding the archive::
219 cd <archive_directory_path>
221 3. Install the package (you may need root permissions to complete this
225 (enter admin password)
226 python setup.py install
228 If the python executable isn't on your path, you'll have to specify
229 the complete path, such as ``/usr/local/bin/python``.
231 To install for a specific Python version, use this version in the
234 python3.1 setup.py install
236 To install for different Python versions, repeat step 3 for every
237 required version. The last installed version will be used in the
238 `shebang line`_ of the ``rst2*.py`` wrapper scripts.
240 .. _shebang line: http://en.wikipedia.org/wiki/Shebang_%28Unix%29
245 Just double-click ``install.py``. If this doesn't work, try the
248 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
249 calling it these days).
251 2. Go to the directory created by expanding the archive::
253 cd <archive_directory_path>
255 3. Install the package::
257 <path_to_python.exe>\python setup.py install
259 To install for a specific python version, specify the Python
260 executable for this version.
262 To install for different Python versions, repeat step 3 for every
267 * `running the test suite`_
269 * `converting the documentation`_
275 There are many front-end tools in the unpacked "tools" subdirectory.
276 Installation under Unix places copies in the PATH.
277 You may want to begin with the "rst2html.py" front-end tool. Most
278 tools take up to two arguments, the source path and destination path,
279 with STDIN and STDOUT being the defaults. Use the "--help" option to
280 the front-end tools for details on options and arguments. See
281 Docutils Front-End Tools (``docs/user/tools.txt``) for full documentation.
283 The package modules are continually growing and evolving. The
284 ``docutils.statemachine`` module is usable independently. It contains
285 extensive inline documentation (in reStructuredText format of course).
287 Contributions are welcome!
290 Converting the documentation
291 ============================
293 After unpacking and installing the Docutils package, the following
294 shell commands will generate HTML for all included documentation::
296 cd <archive_directory_path>/tools
299 On Windows systems, type::
301 cd <archive_directory_path>\tools
302 python buildhtml.py ..
304 The final directory name of the ``<archive_directory_path>`` is
305 "docutils" for snapshots. For official releases, the directory may be
306 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
309 cd <archive_directory_path>
310 tools/buildhtml.py --config=tools/docutils.conf (Unix)
311 python tools\buildhtml.py --config=tools\docutils.conf (Windows)
313 Some files may generate system messages (warnings and errors). The
314 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
315 five intentional errors. (They test the error reporting mechanism!)
318 Running the Test Suite
319 ======================
321 The test suite is documented in `Docutils Testing`_ (docs/dev/testing.txt).
323 To run the entire test suite, open a shell and use the following
326 cd <archive_directory_path>/test
329 Under Windows, type::
331 cd <archive_directory_path>\test
334 For testing with Python 3 use the converted test suite::
336 cd <archive_directory_path>/test3
340 You should see a long line of periods, one for each test, and then a
343 Ran 1111 tests in 24.653s
346 Elapsed time: 26.189 seconds
348 The number of tests will grow over time, and the times reported will
349 depend on the computer running the tests. The difference between the
350 two times represents the time required to set up the tests (import
351 modules, create data structures, etc.).
353 If any of the tests fail, please `open a bug report`_, `send email`_,
354 or post a message via the `web interface`_ (see `Bugs <BUGS.html>`_).
355 Please include all relevant output, information about your operating
356 system, Python version, and Docutils version. To see the Docutils
357 version, use one of the ``rst2*`` front ends or ``tools/quicktest.py``
358 with the ``--version`` option, e.g.::
361 ./quicktest.py --version
363 Windows users type these commands::
366 python quicktest.py --version
369 .. _Docutils Testing: http://docutils.sourceforge.net/docs/dev/testing.html
370 .. _open a bug report:
371 http://sourceforge.net/p/docutils/bugs/
372 .. _send email: mailto:docutils-users@lists.sourceforge.net
373 ?subject=Test%20suite%20failure
374 .. _web interface: http://post.gmane.org/post.php
375 ?group=gmane.text.docutils.user&subject=Test+suite+failure
381 If you have questions or need assistance with Docutils or
382 reStructuredText, please post a message to the Docutils-users_ mailing
385 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
391 indent-tabs-mode: nil
392 sentence-end-double-space: t