Debian Codegraph @

test/expensive_benchmarks/docutils_data/docs/dev/distributing.txt

raw
1 ===============================
2 Docutils_ Distributor's Guide
3 ===============================
4
5 :Author: Lea Wiemann
6 :Contact: [email protected]
7 :Revision: $Revision$
8 :Date: $Date$
9 :Copyright: This document has been placed in the public domain.
10
11 .. _Docutils: https://docutils.sourceforge.io/
12
13 .. contents::
14
15 This document describes how to create packages of Docutils (e.g. for
16 shipping with a Linux distribution). If you have any questions,
17 please direct them to the Docutils-develop_ mailing list.
18
19 First, please download the most current `release tarball`_ and unpack
20 it.
21
22 .. _Docutils-develop: ../user/mailing-lists.html#docutils-develop
23 .. _release tarball: https://docutils.sourceforge.io/#download
24
25
26 Dependencies
27 ============
28
29 Docutils has the following dependencies:
30
31 * Python 3.7 or later is required.
32 Use ">= Python 3.7" in the dependencies.
33
34 * Docutils may optionally make use of the PIL (`Python Imaging
35 Library`_ or Pillow_). If PIL is present, it is automatically
36 detected by Docutils.
37
38 * Docutils recommends the `Pygments`_ syntax hightlighter. If available, it
39 is used for highlighting the content of `code directives`_ and roles as
40 well as included source code files (with the "code" option to the include_
41 directive).
42
43 * Docutils can use the `recommonmark`_ parser to parse input in
44 the Markdown format (new in 0.17).
45
46 .. _Python Imaging Library:
47 https://en.wikipedia.org/wiki/Python_Imaging_Library
48 .. _Pillow: https://pypi.org/project/Pillow/
49 .. _Pygments: https://pygments.org/
50 .. _recommonmark: https://pypi.org/project/recommonmark/
51
52 .. _code directives: ../ref/rst/directives.html#code
53 .. _include: ../ref/rst/directives.html#include
54
55
56 Python Files
57 ============
58
59 The Docutils Python files must be installed into the
60 ``site-packages/`` directory of Python. Running ``python setup.py
61 install`` should do the trick, but if you want to place the files
62 yourself, you can just install the ``docutils/`` directory of the
63 Docutils tarball to ``/usr/lib/python/site-packages/docutils/``. In
64 this case you should also compile the Python files to ``.pyc`` and/or
65 ``.pyo`` files so that Docutils doesn't need to be recompiled every
66 time it's executed.
67
68
69 Executables
70 ===========
71
72 The executable front-end tools are located in the ``tools/`` directory
73 of the Docutils tarball.
74
75 The ``rst2*.py`` tools are intended for end-users. You should install them
76 to ``/usr/bin/``. You do not need to change the names (e.g. to
77 ``docutils-rst2html.py``) because the ``rst2`` prefix is unique.
78
79
80 Documentation
81 =============
82
83 The documentation should be generated using ``buildhtml.py``. To
84 generate HTML for all documentation files, go to the ``tools/``
85 directory and run::
86
87 # Place html4css1.css in base directory.
88 cp ../docutils/writers/html4css1/html4css1.css ..
89 ./buildhtml.py --stylesheet-path=../html4css1.css ..
90
91 Then install the following files to ``/usr/share/doc/docutils/`` (or
92 wherever you install documentation):
93
94 * All ``.html`` and ``.txt`` files in the base directory.
95
96 * The ``docs/`` directory.
97
98 Do not install the contents of the ``docs/`` directory directly to
99 ``/usr/share/doc/docutils/``; it's incomplete and would contain
100 invalid references!
101
102 * The ``licenses/`` directory.
103
104 * ``html4css1.css`` in the base directory.
105
106
107 Removing the ``.txt`` Files
108 ---------------------------
109
110 If you are tight with disk space, you can remove all ``.txt`` files in
111 the tree except for:
112
113 * those in the ``licenses/`` directory because they have not been
114 processed to HTML and
115
116 * ``user/rst/cheatsheet.txt`` and ``user/rst/demo.txt``, which should
117 be readable in source form.
118
119 Before you remove the ``.txt`` files you should rerun ``buildhtml.py``
120 with the ``--no-source-link`` switch to avoid broken references to the
121 source files.
122
123
124 Other Files
125 ===========
126
127 You may want to install the Emacs-Lisp files
128 ``tools/editors/emacs/*.el`` into the appropriate directory.
129
130
131 Configuration File
132 ==================
133
134 It is possible to have a system-wide configuration file at
135 ``/etc/docutils.conf``. However, this is usually not necessary. You
136 should *not* install ``tools/docutils.conf`` into ``/etc/``.
137
138
139 Tests
140 =====
141
142 While you probably do not need to ship the tests with your
143 distribution, you can test your package by installing it and then
144 running ``alltests.py`` from the ``tests/`` directory of the Docutils
145 tarball.
146
147 For more information on testing, view the `Docutils Testing`_ page.
148
149 .. _Docutils Testing: https://docutils.sourceforge.io/docs/dev/testing.html