more compact comments for __version_info__
[docutils.git] / docutils / README.txt
blobe31d586a814ad8a7f4b51b24e0b46aae73272e8f
1 ============================
2  README: Docutils 0.15b.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 (version 2.6 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.
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.6, 2.7, and
107 versions 3.3 to 3.5 (cf. `Python 3 compatibility`_).
109 Docutils uses the following packages for enhanced functionality, if they are
110 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 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
158   project releases.
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
170   package.
172 * docs: The project documentation directory.  Read ``docs/index.txt``
173   for an overview.
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
185   reference.
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`_
195   below.
197 Generated directories when installing under Python 3:
199 * build: Converted sources.
201 * test3: Converted tests.
204 Installation
205 ============
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
210 instructions follow.
213 GNU/Linux, BSDs, Unix, Mac OS X, etc.
214 -------------------------------------
216 1. Open a shell.
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
223    step)::
225        su
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
233    setup call, e.g. ::
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
243 Windows
244 -------
246 Just double-click ``install.py``.  If this doesn't work, try the
247 following:
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
264    required version.
266 Optional steps:
268 * `running the test suite`_
270 * `converting the documentation`_
273 Usage
274 =====
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
298     ./buildhtml.py ../
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.
308 Alternatively::
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
325 commands::
327     cd <archive_directory_path>/test
328     ./alltests.py
330 Under Windows, type::
332     cd <archive_directory_path>\test
333     python alltests.py
335 For testing with Python 3 use the converted test suite::
337     cd <archive_directory_path>/test3
338     python3 alltests.py
341 You should see a long line of periods, one for each test, and then a
342 summary like this::
344     Ran 1111 tests in 24.653s
346     OK
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.::
361     cd ../tools
362     ./quicktest.py --version
364 Windows users type these commands::
366     cd ..\tools
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
375 .. _web interface: https://sourceforge.net/p/docutils/mailman/
378 Getting Help
379 ============
381 If you have questions or need assistance with Docutils or
382 reStructuredText, please post a message to the Docutils-users_ mailing
383 list.
385 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
389    Local Variables:
390    mode: indented-text
391    indent-tabs-mode: nil
392    sentence-end-double-space: t
393    fill-column: 70
394    End: