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. Read on for
20 1. Get and install the latest release of Python, available from
22 http://www.python.org/
24 Docutils is compatible with Python versions from 2.3 up to 2.6.
26 2. Use the latest Docutils code. Get the code from Subversion or from
29 http://docutils.sf.net/docutils-snapshot.tgz
31 See `Releases & Snapshots`_ below for details.
33 3. Unpack the tarball in a temporary directory (**not** directly in
34 Python's ``site-packages``) and run ``install.py`` with admin
35 rights. On Windows systems it may be sufficient to double-click
36 ``install.py``. On Unix or Mac OS X, type::
39 (enter admin password)
42 See Installation_ below for details.
44 4. Use a front-end tool from the "tools" subdirectory of the same
45 directory as in step 3. For example::
48 ./rst2html.py ../FAQ.txt ../FAQ.html (Unix)
49 python rst2html.py ..\FAQ.txt ..\FAQ.html (Windows)
51 See Usage_ below for details.
57 The purpose of the Docutils project is to create a set of tools for
58 processing plaintext documentation into useful formats, such as HTML,
59 XML, and LaTeX. Support for the following sources has been
64 * `PEPs (Python Enhancement Proposals)`_.
66 Support for the following sources is planned:
68 * Inline documentation from Python modules and packages, extracted
69 with namespace context.
71 * Email (RFC-822 headers, quoted excerpts, signatures, MIME parts).
73 * Wikis, with global reference lookups of "wiki links".
75 * Compound documents, such as multiple chapter files merged into a
78 * And others as discovered.
80 .. _PEPs (Python Enhancement Proposals):
81 http://www.python.org/peps/pep-0012.html
87 While we are trying to follow a "release early & often" policy,
88 features are added very frequently. Since the code in the Subversion
89 repository is usually in a bug-free state, we recommend that you use
90 the current snapshot (which is usually updated within an hour of
91 changes being committed to the repository):
93 * Snapshot of Docutils code, documentation, front-end tools, and
94 tests: http://docutils.sf.net/docutils-snapshot.tgz
96 * Snapshot of the Sandbox (experimental, contributed code):
97 http://docutils.sf.net/docutils-sandbox-snapshot.tgz
99 To keep up to date on the latest developments, download fresh copies
100 of the snapshots regularly. New functionality is being added weekly,
101 sometimes daily. (There's also the `Subversion repository`_.)
103 .. _Subversion repository: docs/dev/repository.html
109 To run the code, Python 2.3 or later must already be installed.
110 Python is available from
111 http://www.python.org/.
113 The `Python Imaging Library`, or PIL, is used for some image
114 manipulation operations if it is installed.
116 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
117 .. _Optik: http://optik.sourceforge.net/
120 Project Files & Directories
121 ===========================
123 * README.txt: You're reading it.
125 * COPYING.txt: Public Domain Dedication and copyright details for
126 non-public-domain files (most are PD).
128 * FAQ.txt: Frequently Asked Questions (with answers!).
130 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
132 * HISTORY.txt: A detailed change log, for the current and all previous
135 * BUGS.txt: Known bugs, and how to report a bug.
137 * THANKS.txt: List of contributors.
139 * setup.py: Installation script. See "Installation" below.
141 * install.py: Quick & dirty installation script. Just run it. For
142 any kind of customization or help though, setup.py must be used.
144 * docutils: The project source directory, installed as a Python
147 * extras: Directory for third-party modules that Docutils depends on
148 (roman.py). These are only installed if
149 they're not already present.
151 * docs: The project documentation directory. Read ``docs/index.txt``
154 * docs/user: The project user documentation directory. Contains the
155 following documents, among others:
157 - docs/user/tools.txt: Docutils Front-End Tools
158 - docs/user/latex.txt: Docutils LaTeX Writer
159 - docs/user/rst/quickstart.txt: A ReStructuredText Primer
160 - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
162 * docs/ref: The project reference directory.
163 ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
166 * licenses: Directory containing copies of license files for
167 non-public-domain files.
169 * tools: Directory for Docutils front-end tools. See
170 ``docs/user/tools.txt`` for documentation.
172 * test: Unit tests. Not required to use the software, but very useful
173 if you're planning to modify it. See `Running the Test Suite`_
180 The first step is to expand the ``.tgz`` archive in a temporary
181 directory (**not** directly in Python's ``site-packages``). It
182 contains a distutils setup file "setup.py". OS-specific installation
186 GNU/Linux, BSDs, Unix, Mac OS X, etc.
187 -------------------------------------
191 2. Go to the directory created by expanding the archive::
193 cd <archive_directory_path>
195 3. Install the package::
197 python setup.py install
199 If the python executable isn't on your path, you'll have to specify
200 the complete path, such as /usr/local/bin/python. You may need
201 root permissions to complete this step.
203 You can also just run install.py; it does the same thing.
209 Just double-click ``install.py``. If this doesn't work, try the
212 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
213 calling it these days).
215 2. Go to the directory created by expanding the archive::
217 cd <archive_directory_path>
219 3. Install the package::
221 <path_to_python.exe>\python setup.py install
227 .. From: Georg Brandl <g.brandl <at> gmx.net>
228 Subject: Ported docutils to Python 3
229 Newsgroups: gmane.text.docutils.devel
232 I've just committed a somewhat larger patch that ports docutils to Python 3.
233 If you want to use docutils under Python 3, here is how to do it:
235 * Get a build of the Python 3.1 branch (3.0 release won't work, but you don't
236 want to use it anyway).
238 * Run python3 setup.py build -- this, in addition to copying the sources to
239 build/lib, will also convert them using 2to3 to Python 3-compatible code.
240 This takes quite some time the first time, but it works incrementally, so
241 if you change one file it will only reconvert that file the next time you
244 * Run python3 tests/alltests3.py -- this will copy and convert the test suite
245 to build/lib/test and run it. This is incremental like the setup.py build.
247 Note that you can still run the test suite with Python 2 with the normal
248 python tests/alltests.py.
250 .. So if you make a change, it would be nice if you, in addition to
251 testing with Python 2, also tested with Python 3. If you run into
252 problems with the test suite under 3, feel free to mail me.
258 After unpacking and installing the Docutils package, the following
259 shell commands will generate HTML for all included documentation::
261 cd <archive_directory_path>/tools
264 On Windows systems, type::
266 cd <archive_directory_path>\tools
267 python buildhtml.py ..
269 The final directory name of the ``<archive_directory_path>`` is
270 "docutils" for snapshots. For official releases, the directory may be
271 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
274 cd <archive_directory_path>
275 tools/buildhtml.py --config=tools/docutils.conf (Unix)
276 python tools\buildhtml.py --config=tools\docutils.conf (Windows)
278 Some files may generate system messages (warnings and errors). The
279 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
280 5 intentional errors. (They test the error reporting mechanism!)
282 There are many front-end tools in the unpacked "tools" subdirectory.
283 You may want to begin with the "rst2html.py" front-end tool. Most
284 tools take up to two arguments, the source path and destination path,
285 with STDIN and STDOUT being the defaults. Use the "--help" option to
286 the front-end tools for details on options and arguments. See
287 Docutils Front-End Tools (``docs/user/tools.txt``) for full documentation.
289 The package modules are continually growing and evolving. The
290 ``docutils.statemachine`` module is usable independently. It contains
291 extensive inline documentation (in reStructuredText format of course).
293 Contributions are welcome!
296 Running the Test Suite
297 ======================
299 To run the entire test suite, after installation_ open a shell and use
300 the following commands::
302 cd <archive_directory_path>/test
305 Under Windows, type::
307 cd <archive_directory_path>\test
310 You should see a long line of periods, one for each test, and then a
313 Ran 518 tests in 24.653s
316 Elapsed time: 26.189 seconds
318 The number of tests will grow over time, and the times reported will
319 depend on the computer running the tests. The difference between the
320 two times represents the time required to set up the tests (import
321 modules, create data structures, etc.).
323 If any of the tests fail, please `open a bug report`_, `send email`_,
324 or post a message via the `web interface`_. Please include all
325 relevant output, information about your operating system, Python
326 version, and Docutils version. To see the Docutils version, use these
327 commands in the shell::
330 ./quicktest.py --version
332 Windows users type these commands::
335 python quicktest.py --version
337 .. _open a bug report:
338 http://sourceforge.net/tracker/?group_id=38414&atid=422030
339 .. _send email: mailto:docutils-users@lists.sourceforge.net
340 ?subject=Test%20suite%20failure
341 .. _web interface: http://post.gmane.org/post.php
342 ?group=gmane.text.docutils.user&subject=Test+suite+failure
348 If you have questions or need assistance with Docutils or
349 reStructuredText, please post a message to the Docutils-users_ mailing
352 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
358 indent-tabs-mode: nil
359 sentence-end-double-space: t