regression using mandoc instead of man/groff
[docutils.git] / docutils / README.txt
blob795536d33704b6bffff21fd94497326fabe48ea8
1 ==============================
2  README: Docutils 0.19.1b.dev
3 ==============================
5 :Author: David Goodger
6 :Contact: goodger@python.org
7 :Date: $Date$
8 :Web site: https://docutils.sourceforge.io/
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
20    https://www.python.org/.
21    See Dependencies_ below for details.
23 2. Install the latest stable release from PyPi with pip_::
25        python3 -m pip install docutils
27    For alternatives and details, see section `Installation`_ below.
29 3. Use the `front-end scripts`_ to convert reStructuredText documents.
30    Try for example::
32        rst2html.py FAQ.txt FAQ.html         (Unix)
33        docutils FAQ.txt FAQ.html  (Unix and Windows)
35    See Usage_ below for details.
38 Purpose
39 =======
41 The purpose of the Docutils project is to create a set of tools for
42 processing plaintext documentation into useful formats, such as HTML,
43 LaTeX, troff (man pages), OpenOffice, and native XML.  Support for the
44 following sources has been implemented:
46 * Standalone files.
48 * `PEPs (Python Enhancement Proposals)`_.
50 Support for the following sources is planned or provided by
51 `third party tools`_:
53 * Inline documentation from Python modules and packages, extracted
54   with namespace context.
56 * Email (RFC-822 headers, quoted excerpts, signatures, MIME parts).
58 * Wikis, with global reference lookups of "wiki links".
60 * Compound documents, such as multiple chapter files merged into a
61   book.
63 * And others as discovered.
65 .. _PEPs (Python Enhancement Proposals):
66    https://peps.python.org/pep-0012
67 .. _third party tools: docs/user/links.html#related-applications
70 Dependencies
71 ============
73 To run the code, Python_ must be installed.
74 (Python is pre-installed with most Linux distributions.)
76 * Docutils 0.19.1b.dev requires Python 3.7 or later.
77 * Docutils 0.16 to 0.18 require Python 2.7 or 3.5+.
78 * Docutils 0.14 dropped Python 2.4, 2.5, 3.1 and 3.2 support.
80 .. _Python: https://www.python.org/.
83 Optional Dependencies
84 ---------------------
86 Docutils uses the following packages for enhanced functionality, if they
87 are installed:
89 * Installation_ is usually done with pip_ or setuptools_.
91 * The `Python Imaging Library`_, or PIL, is used for some image
92   manipulation operations.
94 * The `Pygments`_ package provides syntax highlight of "code" directives
95   and roles.
97 * The `myst`_ or `recommonmark`_ parsers can be used to parse input in
98   Markdown format.
100 The `Docutils Link List <docs/user/links.html>`__ records projects that
101 users of Docutils and reStructuredText may find useful.
103 .. _pip: https://pypi.org/project/pip/
104 .. _setuptools: https://pypi.org/project/setuptools/
105 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
106 .. _Pygments: https://pypi.org/project/Pygments/
107 .. _myst: https://pypi.org/project/myst-docutils/
108 .. _recommonmark: https://github.com/rtfd/recommonmark
111 Development version
112 ===================
114 While we are trying to follow a "release early & often" policy,
115 features are added frequently.
116 Since the code in the `Docutils version repository`_ is usually in a
117 bug-free state, we recommend using a current snapshot or a working copy.
119 Snapshots:
120   To get a repository _`snapshot`, go to
121   https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/
122   and click the download snapshot button.
124 Repository check-out:
125   To keep up to date on the latest developments,
126   use a `working copy`__ of the `Docutils version repository`_.
128 Continue with the `Installation`_ instructions below.
130 .. _Docutils version repository: docs/dev/repository.html
131 .. _sandbox: https://docutils.sourceforge.io/sandbox/README.html
133 __ docs/dev/repository.html#checking-out-the-repository
136 Installation
137 ============
139 * The simplest way is to install the latest stable release from PyPi with
140   pip_::
142     python3 -m pip install docutils
144   To install a pre-relase, append the option ``--pre``.
146 * To install a `development version`_ from source with `setuptools`_:
148   * Go to the directory containing the file ``setup.py``.
150     A snapshot_ must be unpacked in a temporary directory
151     (**not** directly in Python's ``site-packages``) first.
153   * Run ``setup.py install``.
154     See also OS-specific installation instructions below.
156   Optional steps:
157   
158   * `Running the test suite`_
159   
160   * `Converting the documentation`_
162 * For installing "by hand" or in "development mode", see the
163   `editable installs`_ section in the `Docutils version repository`_
164   documentation.
166   .. _editable installs: docs/dev/repository.html#editable-installs
169 GNU/Linux, BSDs, Unix, Mac OS X, etc.
170 -------------------------------------
172 1. Open a shell.
174 2. Go to the directory containing ``setup.py``::
176        cd <archive_directory_path>
178 3. Install the package (you may need root permissions to complete this
179    step)::
181        su
182        (enter admin password)
183        python3 setup.py install
185    If the python executable isn't on your path, you'll have to specify
186    the complete path, such as ``/usr/local/bin/python``.
188    To install for a specific Python version, use this version in the
189    setup call, e.g. ::
191        python3.7 setup.py install
193    To install for different Python versions, repeat stepĀ 3 for every
194    required version. The last installed version will be used in the
195    `shebang line`_ of the `front-end scripts`_.
197    .. _shebang line: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
199 Windows
200 -------
202 Just double-click ``install.py``.  If this doesn't work, try the
203 following:
205 1. Open a DOS Box (Command Shell, MS-DOS Prompt, or whatever they're
206    calling it these days).
208 2. Go to the directory created by expanding the archive::
210        cd <archive_directory_path>
212 3. Install the package::
214        <path_to_python.exe>\python setup.py install
216    To install for a specific python version, specify the Python
217    executable for this version.
219    To install for different Python versions, repeat stepĀ 3 for every
220    required version.
223 Usage
224 =====
226 There are many front-end tools in the unpacked "tools" subdirectory.
227 Installation under Unix places copies in the PATH.
228 You may want to begin with the "rst2html.py" front-end tool.  Most
229 tools take up to two arguments, the source path and destination path,
230 with STDIN and STDOUT being the defaults.  Use the ``--help`` option to
231 the front-end tools for details on options and arguments.  See
232 `Docutils Front-End Tools`_ for full documentation.
234 The package modules are continually growing and evolving.  The
235 ``docutils.statemachine`` module is usable independently.  It contains
236 extensive inline documentation (in reStructuredText format of course).
238 Contributions are welcome!
240 .. _front-end scripts:
241 .. _Docutils Front-End Tools: docs/user/tools.html
243 Project Files & Directories
244 ===========================
246 * README.txt: You're reading it.
248 * COPYING.txt: Public Domain Dedication and copyright details for
249   non-public-domain files (most are PD).
251 * FAQ.txt: Frequently Asked Questions (with answers!).
253 * RELEASE-NOTES.txt: Summary of the major changes in recent releases.
255 * HISTORY.txt: A detailed change log, for the current and all previous
256   project releases.
258 * BUGS.txt: Known bugs, and how to report a bug.
260 * THANKS.txt: List of contributors.
262 * setup.py: Installation script.  See "Installation" below.
264 * install.py: Quick & dirty installation script.  Just run it.  For
265   any kind of customization or help though, setup.py must be used.
267 * docutils: The project source directory, installed as a Python
268   package.
270 * docs: The project documentation directory.  Read ``docs/index.txt``
271   for an overview.
273 * docs/user: The project user documentation directory.  Contains the
274   following documents, among others:
276   - docs/user/tools.txt: Docutils Front-End Tools
277   - docs/user/latex.txt: Docutils LaTeX Writer
278   - docs/user/rst/quickstart.txt: A ReStructuredText Primer
279   - docs/user/rst/quickref.html: Quick reStructuredText (HTML only)
281 * docs/ref: The project reference directory.
282   ``docs/ref/rst/restructuredtext.txt`` is the reStructuredText
283   reference.
285 * licenses: Directory containing copies of license files for
286   non-public-domain files.
288 * tools: Directory for Docutils front-end tools.  See
289   ``docs/user/tools.txt`` for documentation.
291 * test: Unit tests.  Not required to use the software, but very useful
292   if you're planning to modify it.  See `Running the Test Suite`_
293   below.
296 Converting the documentation
297 ============================
299 After unpacking and installing the Docutils package, the following
300 shell commands will generate HTML for all included documentation::
302     cd <archive_directory_path>/tools
303     ./buildhtml.py ../
305 On Windows systems, type::
307     cd <archive_directory_path>\tools
308     python buildhtml.py ..
310 The final directory name of the ``<archive_directory_path>`` is
311 "docutils" for snapshots.  For official releases, the directory may be
312 called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
313 Alternatively::
315     cd <archive_directory_path>
316     tools/buildhtml.py --config=tools/docutils.conf          (Unix)
317     python tools\buildhtml.py --config=tools\docutils.conf   (Windows)
319 Some files may generate system messages (warnings and errors).  The
320 ``docs/user/rst/demo.txt`` file (under the archive directory) contains
321 five intentional errors.  (They test the error reporting mechanism!)
324 Running the Test Suite
325 ======================
327 The test suite is documented in `Docutils Testing`_ (docs/dev/testing.txt).
329 To run the entire test suite, open a shell and use the following
330 commands::
332     cd <archive_directory_path>/test
333     ./alltests.py
335 Under Windows, type::
337     cd <archive_directory_path>\test
338     python 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 A copy of the test output is written to the file ``alltests.out``.
356 If any of the tests fail, please `open a bug report`_ or `send an email`_
357 (see `Bugs <BUGS.html>`_).
358 Please include all relevant output, information about your operating
359 system, Python version, and Docutils version.  To see the Docutils
360 version, look at the test output or use one of the `front-end scripts`_ 
361 with the ``--version`` option.
363 .. _Docutils Testing: https://docutils.sourceforge.io/docs/dev/testing.html
364 .. _open a bug report:
365    https://sourceforge.net/p/docutils/bugs/
366 .. _send an email: mailto:docutils-users@lists.sourceforge.net
367    ?subject=Test%20suite%20failure
368 .. _web interface: https://sourceforge.net/p/docutils/mailman/
371 Getting Help
372 ============
374 All documentation can be reached from the `Project Documentation
375 Overview`_. 
377 The SourceForge `project page`_ has links to the tracker, mailing
378 lists, and code repository.
380 If you have further questions or need assistance with Docutils or
381 reStructuredText, please post a message to the Docutils-users_ mailing
382 list.
384 .. _Project Documentation Overview: docs/index.html
385 .. _project page: https://sourceforge.net/p/docutils
386 .. _Docutils-users: docs/user/mailing-lists.html#docutils-users
390    Local Variables:
391    mode: indented-text
392    indent-tabs-mode: nil
393    sentence-end-double-space: t
394    fill-column: 70
395    End: