Fix [ 3481980 ] Use os.getcwdu() in make_paths_absolute().
[docutils.git] / README.txt
blob175026f43f0b261b5d6443cce415a947a6e7233b
1 ======================
2  README: Docutils 0.9
3 ======================
5 :Author: David Goodger
6 :Contact: goodger@python.org
7 :Date: $Date$
8 :Web site: http://docutils.sourceforge.net/
9 :Copyright: This document has been placed in the public domain.
11 .. contents::
14 Quick-Start
15 ===========
17 This is for those who want to get up & running quickly.  Read on for
18 complete details.
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 and
25    version 3.1. (Support for Python 3 is new and might still have some
26    issues.)
28 2. Use the latest Docutils code.  Get the code from Subversion or from
29    the snapshot:
31        http://docutils.sf.net/docutils-snapshot.tgz
33    See `Releases & Snapshots`_ below for details.
35 3. Unpack the tarball in a temporary directory (**not** directly in
36    Python's ``site-packages``) and run ``setup.py install`` or
37    ``install.py`` with admin rights.  On Windows systems it may be
38    sufficient to double-click ``install.py``.  On Unix or Mac OS X,
39    type::
41         su
42         (enter admin password)
43         ./setup.py install
45    Docutils will only work with Python 3, if installed with a Python
46    version >= 3. If your default Python version is 2.x, also call
47    ``python3 setup.py install`` from the temporary directory.
48    See Installation_ below for details.
50 4. Use a front-end tool from the "tools" subdirectory of the same
51    directory as in step 3.  For example::
53        cd tools
54        ./rst2html.py ../FAQ.txt ../FAQ.html        (Unix)
55        python rst2html.py ..\FAQ.txt ..\FAQ.html   (Windows)
57    See Usage_ below for details.
60 Purpose
61 =======
63 The purpose of the Docutils project is to create a set of tools for
64 processing plaintext documentation into useful formats, such as HTML,
65 XML, and LaTeX.  Support for the following sources has been
66 implemented:
68 * Standalone files.
70 * `PEPs (Python Enhancement Proposals)`_.
72 Support for the following sources is planned:
74 * Inline documentation from Python modules and packages, extracted
75   with namespace context.
77 * Email (RFC-822 headers, quoted excerpts, signatures, MIME parts).
79 * Wikis, with global reference lookups of "wiki links".
81 * Compound documents, such as multiple chapter files merged into a
82   book.
84 * And others as discovered.
86 .. _PEPs (Python Enhancement Proposals):
87    http://www.python.org/peps/pep-0012.html
90 Releases & Snapshots
91 ====================
93 While we are trying to follow a "release early & often" policy,
94 features are added very frequently.  Since the code in the Subversion
95 repository is usually in a bug-free state, we recommend that you use
96 the current snapshot (which is usually updated within an hour of
97 changes being committed to the repository):
99 * Snapshot of Docutils code, documentation, front-end tools, and
100   tests: http://docutils.sf.net/docutils-snapshot.tgz
102 * Snapshot of the Sandbox (experimental, contributed code):
103   http://docutils.sf.net/docutils-sandbox-snapshot.tgz
105 To keep up to date on the latest developments, download fresh copies
106 of the snapshots regularly.  New functionality is being added weekly,
107 sometimes daily.  (There's also the `Subversion repository`_.)
109 .. _Subversion repository: docs/dev/repository.html
112 Requirements
113 ============
115 To run the code, Python 2.3 or later must already be installed.
116 Python is available from
117 http://www.python.org/.
119 The `Python Imaging Library`, or PIL, is used for some image
120 manipulation operations if it is installed.
122 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
123 .. _Optik: http://optik.sourceforge.net/
126 Project Files & Directories
127 ===========================
129 * README.txt: You're reading it.
131 * COPYING.txt: Public Domain Dedication and copyright details for
132   non-public-domain files (most are PD).
134 * FAQ.txt: Frequently Asked Questions (with answers!).
136 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
138 * HISTORY.txt: A detailed change log, for the current and all previous
139   project releases.
141 * BUGS.txt: Known bugs, and how to report a bug.
143 * THANKS.txt: List of contributors.
145 * setup.py: Installation script.  See "Installation" below.
147 * install.py: Quick & dirty installation script.  Just run it.  For
148   any kind of customization or help though, setup.py must be used.
150 * docutils: The project source directory, installed as a Python
151   package.
153 * extras: Directory for third-party modules that Docutils depends on
154   (roman.py).  These are only installed if
155   they're not already present.
157 * docs: The project documentation directory.  Read ``docs/index.txt``
158   for an overview.
160 * docs/user: The project user documentation directory.  Contains the
161   following documents, among others:
163   - docs/user/tools.txt: Docutils Front-End Tools
164   - docs/user/latex.txt: Docutils LaTeX Writer
165   - docs/user/rst/quickstart.txt: A ReStructuredText Primer
166   - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
168 * docs/ref: The project reference directory.
169   ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
170   reference.
172 * licenses: Directory containing copies of license files for
173   non-public-domain files.
175 * tools: Directory for Docutils front-end tools.  See
176   ``docs/user/tools.txt`` for documentation.
178 * test: Unit tests.  Not required to use the software, but very useful
179   if you're planning to modify it.  See `Running the Test Suite`_
180   below.
183 Installation
184 ============
186 The first step is to expand the ``.tgz`` archive in a temporary
187 directory (**not** directly in Python's ``site-packages``).  It
188 contains a distutils setup file "setup.py".  OS-specific installation
189 instructions follow.
192 GNU/Linux, BSDs, Unix, Mac OS X, etc.
193 -------------------------------------
195 1. Open a shell.
197 2. Go to the directory created by expanding the archive::
199        cd <archive_directory_path>
201 3. Install the package::
203        python setup.py install
205    If the python executable isn't on your path, you'll have to specify
206    the complete path, such as /usr/local/bin/python.  You may need
207    root permissions to complete this step.
209    To install for a specific python version, use this version in the
210    setup call, e.g. ::
212        python3.1 setup.py install
215 Windows
216 -------
218 Just double-click ``install.py``.  If this doesn't work, try the
219 following:
221 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
222    calling it these days).
224 2. Go to the directory created by expanding the archive::
226        cd <archive_directory_path>
228 3. Install the package::
230        <path_to_python.exe>\python setup.py install
232    To install for a specific python version, specify the Python
233    executable for this version.
236 Python 3 peculiarities
237 ----------------------
239 If called from Python 3, setup.py, in addition to copying the sources
240 to the right place, will also convert them using 2to3 to Python 3
241 compatible code.
243 * If you want to test or develop Docutils, also run ``python3 setup.py
244   build``. This will generate Python 3 compatible sources, tests and
245   developer tools in the build directory.  Do changes on the Python 2
246   versions of the sources and re-run the build command. This works
247   incrementally, so if you change one file it will only reconvert that
248   file the next time you run setup.py build.
251 Usage
252 =====
254 After unpacking and installing the Docutils package, the following
255 shell commands will generate HTML for all included documentation::
257     cd <archive_directory_path>/tools
258     ./buildhtml.py ../
260 On Windows systems, type::
262     cd <archive_directory_path>\tools
263     python buildhtml.py ..
265 The final directory name of the ``<archive_directory_path>`` is
266 "docutils" for snapshots.  For official releases, the directory may be
267 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
268 Alternatively::
270     cd <archive_directory_path>
271     tools/buildhtml.py --config=tools/docutils.conf          (Unix)
272     python tools\buildhtml.py --config=tools\docutils.conf   (Windows)
274 With Python 3, call::
276     build/<Python-3-subdir>/tools/buildhtml.py --config=tools/docutils.conf
278 Some files may generate system messages (warnings and errors).  The
279 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
280 five 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
303     ./alltests.py
305 Under Windows, type::
307     cd <archive_directory_path>\test
308     python alltests.py
310 For testing with Python 3 use the converted test suite::
312     cd <archive_directory_path>/build/<Python-3-subdir>/test
313     python alltests.py
316 You should see a long line of periods, one for each test, and then a
317 summary like this::
319     Ran 1111 tests in 24.653s
321     OK
322     Elapsed time: 26.189 seconds
324 The number of tests will grow over time, and the times reported will
325 depend on the computer running the tests.  The difference between the
326 two times represents the time required to set up the tests (import
327 modules, create data structures, etc.).
329 If any of the tests fail, please `open a bug report`_, `send email`_,
330 or post a message via the `web interface`_ (see `Bugs <BUGS.html>`_).
331 Please include all relevant output, information about your operating
332 system, Python version, and Docutils version.  To see the Docutils
333 version, use one of the ``rst2*`` front ends or ``tools/quicktest.py``
334 with the ``--version`` option, e.g.::
336     cd ../tools
337     ./quicktest.py --version
339 Windows users type these commands::
341     cd ..\tools
342     python quicktest.py --version
344 Python 3 users must use ``build/<Python-3-subdir>/tools/quicktest.py``.
347 .. _open a bug report:
348    http://sourceforge.net/tracker/?group_id=38414&atid=422030
349 .. _send email: mailto:docutils-users@lists.sourceforge.net
350    ?subject=Test%20suite%20failure
351 .. _web interface: http://post.gmane.org/post.php
352    ?group=gmane.text.docutils.user&subject=Test+suite+failure
355 Getting Help
356 ============
358 If you have questions or need assistance with Docutils or
359 reStructuredText, please post a message to the Docutils-users_ mailing
360 list.
362 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
366    Local Variables:
367    mode: indented-text
368    indent-tabs-mode: nil
369    sentence-end-double-space: t
370    fill-column: 70
371    End: