Minor cleanup: consistent return value, comments, docstring update.
[docutils.git] / docutils / README.txt
blob184934e802863137bfd6206544f84e647c22324f
1 ============================
2  README: Docutils 0.16b.dev
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.
19 1. Docutils requires Python, 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      https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/
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.
40    Try for example::
42        rst2html.py FAQ.txt FAQ.html         (Unix)
43        python tools/rst2html.py FAQ.txt FAQ.html  (Windows)
45    See Usage_ below for details.
48 Purpose
49 =======
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
54 implemented:
56 * Standalone files.
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
70   book.
72 * And others as discovered.
74 .. _PEPs (Python Enhancement Proposals):
75    http://www.python.org/peps/pep-0012.html
78 Releases & Snapshots
79 ====================
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
84 a current snapshot.
86 To get a snapshot, go to the code page and click the download snapshot
87 button:
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
102 Requirements
103 ============
105 To run the code, Python_ must be installed.
106 Docutils is compatible with Python versions 2.7, and
107 3.5 to 3.7 (cf. `Python 3 compatibility`_).
109 Docutils uses the following packages for enhanced functionality,
110 if they are installed:
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 Up to version 0.15, the Docutils codebase was translated "on-demand" using
127 the 2to3 tool. Starting with Docutils 0.16, the code base supports both
128 Python 2.7 and 3.5+ natively.
131 Project Files & Directories
132 ===========================
134 * README.txt: You're reading it.
136 * COPYING.txt: Public Domain Dedication and copyright details for
137   non-public-domain files (most are PD).
139 * FAQ.txt: Frequently Asked Questions (with answers!).
141 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
143 * HISTORY.txt: A detailed change log, for the current and all previous
144   project releases.
146 * BUGS.txt: Known bugs, and how to report a bug.
148 * THANKS.txt: List of contributors.
150 * setup.py: Installation script.  See "Installation" below.
152 * install.py: Quick & dirty installation script.  Just run it.  For
153   any kind of customization or help though, setup.py must be used.
155 * docutils: The project source directory, installed as a Python
156   package.
158 * docs: The project documentation directory.  Read ``docs/index.txt``
159   for an overview.
161 * docs/user: The project user documentation directory.  Contains the
162   following documents, among others:
164   - docs/user/tools.txt: Docutils Front-End Tools
165   - docs/user/latex.txt: Docutils LaTeX Writer
166   - docs/user/rst/quickstart.txt: A ReStructuredText Primer
167   - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
169 * docs/ref: The project reference directory.
170   ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
171   reference.
173 * licenses: Directory containing copies of license files for
174   non-public-domain files.
176 * tools: Directory for Docutils front-end tools.  See
177   ``docs/user/tools.txt`` for documentation.
179 * test: Unit tests.  Not required to use the software, but very useful
180   if you're planning to modify it.  See `Running the Test Suite`_
181   below.
184 Installation
185 ============
187 The first step is to expand the ``.tgz`` archive in a temporary
188 directory (**not** directly in Python's ``site-packages``).  It
189 contains a distutils setup file "setup.py".  OS-specific installation
190 instructions follow.
193 GNU/Linux, BSDs, Unix, Mac OS X, etc.
194 -------------------------------------
196 1. Open a shell.
198 2. Go to the directory created by expanding the archive::
200        cd <archive_directory_path>
202 3. Install the package (you may need root permissions to complete this
203    step)::
205        su
206        (enter admin password)
207        python setup.py install
209    If the python executable isn't on your path, you'll have to specify
210    the complete path, such as ``/usr/local/bin/python``.
212    To install for a specific Python version, use this version in the
213    setup call, e.g. ::
215        python3.7 setup.py install
217    To install for different Python versions, repeat step 3 for every
218    required version. The last installed version will be used in the
219    `shebang line`_ of the ``rst2*.py`` wrapper scripts.
221    .. _shebang line: http://en.wikipedia.org/wiki/Shebang_%28Unix%29
223 Windows
224 -------
226 Just double-click ``install.py``.  If this doesn't work, try the
227 following:
229 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
230    calling it these days).
232 2. Go to the directory created by expanding the archive::
234        cd <archive_directory_path>
236 3. Install the package::
238        <path_to_python.exe>\python setup.py install
240    To install for a specific python version, specify the Python
241    executable for this version.
243    To install for different Python versions, repeat step 3 for every
244    required version.
246 Optional steps:
248 * `running the test suite`_
250 * `converting the documentation`_
253 Usage
254 =====
256 There are many front-end tools in the unpacked "tools" subdirectory.
257 Installation under Unix places copies in the PATH.
258 You may want to begin with the "rst2html.py" front-end tool.  Most
259 tools take up to two arguments, the source path and destination path,
260 with STDIN and STDOUT being the defaults.  Use the "--help" option to
261 the front-end tools for details on options and arguments.  See
262 Docutils Front-End Tools (``docs/user/tools.txt``) for full documentation.
264 The package modules are continually growing and evolving.  The
265 ``docutils.statemachine`` module is usable independently.  It contains
266 extensive inline documentation (in reStructuredText format of course).
268 Contributions are welcome!
271 Converting the documentation
272 ============================
274 After unpacking and installing the Docutils package, the following
275 shell commands will generate HTML for all included documentation::
277     cd <archive_directory_path>/tools
278     ./buildhtml.py ../
280 On Windows systems, type::
282     cd <archive_directory_path>\tools
283     python buildhtml.py ..
285 The final directory name of the ``<archive_directory_path>`` is
286 "docutils" for snapshots.  For official releases, the directory may be
287 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
288 Alternatively::
290     cd <archive_directory_path>
291     tools/buildhtml.py --config=tools/docutils.conf          (Unix)
292     python tools\buildhtml.py --config=tools\docutils.conf   (Windows)
294 Some files may generate system messages (warnings and errors).  The
295 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
296 five intentional errors.  (They test the error reporting mechanism!)
299 Running the Test Suite
300 ======================
302 The test suite is documented in `Docutils Testing`_ (docs/dev/testing.txt).
304 To run the entire test suite, open a shell and use the following
305 commands::
307     cd <archive_directory_path>/test
308     ./alltests.py
310 Under Windows, type::
312     cd <archive_directory_path>\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`_ or `send an email`_
330 (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
345 .. _Docutils Testing: http://docutils.sourceforge.net/docs/dev/testing.html
346 .. _open a bug report:
347    http://sourceforge.net/p/docutils/bugs/
348 .. _send an email: mailto:docutils-users@lists.sourceforge.net
349    ?subject=Test%20suite%20failure
350 .. _web interface: https://sourceforge.net/p/docutils/mailman/
353 Getting Help
354 ============
356 If you have questions or need assistance with Docutils or
357 reStructuredText, please post a message to the Docutils-users_ mailing
358 list.
360 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
364    Local Variables:
365    mode: indented-text
366    indent-tabs-mode: nil
367    sentence-end-double-space: t
368    fill-column: 70
369    End: