source: rtems-docs/README.txt @ d412c5b

5
Last change on this file since d412c5b was 5d72d63, checked in by Joel Sherrill <joel@…>, on 11/07/19 at 00:26:53

README.txt: Add info on CentOS 7 Software Collections for Python 3

  • Property mode set to 100644
File size: 17.4 KB
Line 
1RTEMS Project Documentation
2===========================
3
4The documents are written in ReST and built using Sphinx. The build system will
5check the version of Sphinx and ensure you have a suitable version
6available. If your host does not provide a packaged version use PIP to fetch a
7recent version. The Sphinx website provides details on doing this.
8
9ReST is the Re-Structured-Text format. It is a simple markup language that allows
10us to create quality documentaion. It is flexible and powerful however does not
11attempt to train it to create a specific format. You need to test any new way
12of presenting something on all output formats. What may look great in one
13format may not translate with the same clarity to another output format.
14
15The RTEMS Documentation output formats are:
16
17 HTML        - Multi-page HTML with files in a single directory per manual.
18 PDF         - Single PDF per manual.
19 Single HTML - Single HTML, one file per manual.
20
21The PDF format is created using Latex and that uses texlive packages. This
22exposes us to the complex world of Latex however the quality of the documents
23created is worth it.
24
25Images can be created from source using PlantUML and Ditaa.
26
27A Sphinx checksheet is:
28
29 http://docs.sphinxdocs.com/en/latest/cheatsheet.html#rst-cheat-sheet
30
31Production Quality Hosts
32------------------------
33
34We allow the building of PDF documentation on hosts that do not have a fully
35suitable texlive environment and this results in quality that is not at the
36production level.
37
38The hosts which produce production quality are:
39
40 FreeBSD
41 CentOS 6 and 7 (if using texlive, not RPMs of texlive)
42
43NOTE: RedHat Enterprise Linux (RHEL) and Fedora should be the same as CentOS.
44
45Images
46------
47
48All images should be placed int he 'images' directory and referenced from the
49ReST with a relative path. This lets us shared and control images.
50
51We prefer being able to build images from source. This is not always possible
52so SVG format is preferred with generated PNG images to make sure the quality
53is consistent when building PDF output.
54
55Building images requires the source with an apporoiate file extension
56is placed in the images directory. The built output image is written
57back to the images directory. All images may be built or rebuilt when
58building images is enabled via the waf configure command line. Please
59only add and commit those images that have changed.
60
61We support building images in:
62
631. PlantUML (.puml), enable with `--plantuml`
64
652. Ditaa (.ditaa), enable with `--ditaa`
66
67We support the PlantUML image language. The PlantUML home page is:
68
69 http://plantuml.com/
70
71The page as a link to an 'online demo server' you can use to create images
72rathre than installing PlantUML. Save you source then View and save the PNG
73format image. The PlantUML language reference guide is:
74
75 http://plantuml.com/PlantUML_Language_Reference_Guide.pdf
76
77And the web site has online documentation. The image source extension is
78'.puml'.
79
80We also support Ditaa image language. The Ditaa home page is:
81
82 http://ditaa.sourceforge.net/
83
84The home page contain the language options. The PlantUML online demo server
85supports Ditaa so use that resource as an online tool. The Ditaa image source
86extension is '.ditaa'.
87
88You do not need PlantUML or Ditaa install to build our documentation. The
89online resources can be used. Save the source and the generated PNG file in the
90same directory under 'images'.
91
92Host Setup
93----------
94
95HTML builds directly with Sphinx, PDF requires a full Latex (texlive) install,
96and building a Single HTML page requires the 'inliner' tool. The
97sphinxcontrib-bibtex extension is mandatory. PlantUML requres the Node.js
98package called 'node-plantuml' which installs the 'puml' command and Ditaa needs
99the 'ditaa' command and package. Ditaa images are built using the 'puml'
100command.
101
102Please add your host as you set it up.
103
104Sphinx Per User Install
105~~~~~~~~~~~~~~~~~~~~~~~
106
107You can use this method to install a personal version of Sphinx if your host
108does not provide a suitable package:
109
110  $ pip install -U --user sphinx
111  $ pip install --user sphinxcontrib-bibtex
112
113On some hosts, this may complain that a newer version of pip is available.
114If so, then upgrade pip into your personal area.
115
116 $ pip install --upgrade --user pip
117
118The personal area for these tools is ${HOME}/.local/bin. It should
119be PREPENDED to your path. On a 32-bit install of CentOS, RHEL, or
120Fedora, these were the PATH modifications to use the local install of
121Texlive and sphinx:
122
123  export PATH=/usr/local/texlive/2016/bin/i386-linux/:${PATH}
124  export PATH=${HOME}/.local/bin:${PATH}
125
126If on a 64-bit install of CentOS, RHEL, or Fedora, these will
127be the PATH modifications to use the local install of Texlive
128and sphinx:
129
130  export PATH=/usr/local/texlive/2016/bin/x86_64-linux/:${PATH}
131  export PATH=${HOME}/.local/bin:${PATH}
132
133Windows
134~~~~~~~
135
136To build the documentation on Windows you need to install an offical Python
137build from https://www.python.org/. We suggest you install a recent 2.7 series
13864bit build. The versions 2.7.9 and after include pip.
139
140Note: you cannot use the MSYS2 versions of Python because the pip libraries
141that contain C or C++ code are built with MSVC libraries and cannot integrate
142with the MSYS2 built python.
143
144The following assumes Python is installed to its default path of C:\Python27.
145
146Open an MSYS2 terminal window and add the needed paths to Python and its
147scripts:
148
149 $ export PATH=/c/Python27/Scripts:/c/Python27:$PATH
150
151Install Sphinx and any needed extensions:
152
153 $ pip install sphinx
154 $ pip install sphinxcontrib-bibtex
155
156FreeBSD
157~~~~~~~
158
159PDF Quality: production
160
161Sphinx:
162
163  # pkg install py27-sphinx
164
165PDF:
166
167  # pkg install texlive-full
168
169Single HTML:
170
171  # pkg install npm
172  # npm install -g inliner
173
174Plant UML:
175
176Install NPM as shown in Single HTML then:
177
178  # npm install -g node-plantuml
179
180Ditaa:
181
182  # pkg install ditaa
183
184CentOS 7
185~~~~~~~~
186
187PDF Quality: production
188
189Python 3:
190
191By default, CentOS 7 has Python 2.x. Luckily they now have Software
192Collections which lets you install and use a "collection" of newer
193software. As root,
194
195  # yum install centos-release-scl
196  # yum install rh-python36
197
198Then you can create your own virtual Python environment
199for use with the Sphinx toolchain.
200
201  $ cd ~
202  $ python -m venv rtemsdocs
203
204When you want to use the Sphinx toolchain.
205
206  $ scl enable rh-python36 bash
207  $ source ~/rtemsdocs/bin/activate
208
209Sphinx:
210
211  $ pip install -U sphinx
212
213PDF:
214
215  WARNING: Do NOT use the RPMs for texlive. They are incomplete and, in
216           the best case, result in ugly PDFs.
217
218  As root, install texlive per the instructions at
219  http://tug.org/texlive/acquire-netinstall.html
220
221  # wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
222  # tar xf install-tl-unx.tar.gz
223  # cd install-tl-20161106
224    NOTE: The date in the name of the directory will change.
225  # ./install-tl
226    - Use the command line system. Select "O" for options if you want to
227      change from A4 to US letter paper size by default.
228    - Select "I" to install
229    - The tools will be installed into a directory like the following:
230      /usr/local/texlive/2016/bin/i386-linux/
231
232     NOTE: The year (2016) and host OS (i386-linux) will change to
233           reflect 32 or 64 bit and OS name.
234
235  You will also likely need to install the aspell RPM.
236
237Single HTML:
238
239NOTE: npm appears to be part of the EPEL repository for RHEL and CentOS.
240You may have to add that repository to your configuration.
241
242  # yum install npm
243  # npm install -g inliner
244
245Plant UML:
246
247Install NPM as shown in Single HTML then:
248
249  # npm install -g node-plantuml
250
251Spell check:
252
253  # yum install aspell
254
255PATH:
256
257  Ensure the appropriate directories are PREPENDED to your PATH before
258  building the documentation. Examples are shown below:
259
260  export PATH=/usr/local/texlive/2016/bin/i386-linux/:${PATH}
261  export PATH=${HOME}/.local/bin:${PATH}
262
263Arch Linux
264~~~~~~~~~~
265
266Sphinx:
267
268  # pacman -S python-sphinx
269
270PDF:
271
272  # pacman -S texlive-bin texlive-core texlive-latexextra texlive-fontsextra
273
274openSUSE
275~~~~~~~~
276
277Packages:
278
279  # zypper in python-pip 'texlive*'
280
281Sphinx:
282
283  # pip install -U Sphinx
284
285Using pip to install Sphinx destroys the python-Sphinx package if installed via
286RPM.
287
288Latex Setup
289~~~~~~~~~~~
290
291Latex is used to create the PDF document.  The setup of Latex varies from host
292to host operating system due to the way each host packages the texlive
293packages. There is no common naming and no real way to figure what texlive
294package is present in a host's packaging. It seems not all of texlive is
295available.
296
297The RTEMS Documentation waf configure phase check for each texlive package used
298in the generated output and the styles. If you complete configure with the
299--pdf option you should be able to build PDF documentation.
300
301The texlive package requirments come from the Latex styles we are using and
302Sphinx.
303
304An example of failures are:
305
306  Checking for Tex package 'Bjarne'        : ok
307  Checking for Tex package 'alltt'         : ok
308  Checking for Tex package 'amsmath'       : ok
309  Checking for Tex package 'amssymb'       : ok
310  Checking for Tex package 'amstext'       : ok
311  Checking for Tex package 'array'         : ok
312  Checking for Tex package 'atbegshi'      : ok
313  Checking for Tex package 'babel'         : ok
314  Checking for Tex package 'calc'          : ok
315  Checking for Tex package 'capt-of'       : not found (please install)
316  Checking for Tex package 'charter'       : ok
317  Checking for Tex package 'cmap'          : ok
318  Checking for Tex package 'color'         : ok
319  Checking for Tex package 'eqparbox'      : not found (please install)
320  Checking for Tex package 'etoolbox'      : ok
321  Checking for Tex package 'fancybox'      : ok
322  Checking for Tex package 'fancyhdr'      : ok
323  Checking for Tex package 'fancyvrb'      : ok
324  Checking for Tex package 'float'         : ok
325  Checking for Tex package 'fncychap'      : ok
326  Checking for Tex package 'fontenc'       : ok
327  Checking for Tex package 'footnote'      : ok
328  Checking for Tex package 'framed'        : ok
329  Checking for Tex package 'graphicx'      : ok
330  Checking for Tex package 'hypcap'        : ok
331  Checking for Tex package 'hyperref'      : ok
332  Checking for Tex package 'ifplatform'    : not found (please install)
333  Checking for Tex package 'ifthen'        : ok
334  Checking for Tex package 'inconsolata'   : not found (please install)
335  Checking for Tex package 'inputenc'      : ok
336  Checking for Tex package 'keyval'        : ok
337  Checking for Tex package 'kvoptions'     : ok
338  Checking for Tex package 'lato'          : not found (please install)
339  Checking for Tex package 'lineno'        : ok
340  Checking for Tex package 'longtable'     : ok
341  Checking for Tex package 'makeidx'       : ok
342  Checking for Tex package 'multirow'      : ok
343  Checking for Tex package 'parskip'       : ok
344  Checking for Tex package 'pdftexcmds'    : ok
345  Checking for Tex package 'textcomp'      : ok
346  Checking for Tex package 'threeparttable' : ok
347  Checking for Tex package 'times'          : ok
348  Checking for Tex package 'titlesec'       : ok
349  Checking for Tex package 'upquote'        : not found (please install)
350  Checking for Tex package 'utf8'           : ok
351  Checking for Tex package 'wrapfig'        : ok
352  Checking for Tex package 'xcolor'         : ok
353  Checking for Tex package 'xstring'        : ok
354  There are 6 Tex package failures. Please fix.
355
356If you find there is an issue please post the developers list.
357
358Building
359--------
360
361Note: waf-1.9.5 is a little noisy when running tex builds and tests. I hope
362      to have this resolved soon.
363
364To build enter in the top directory:
365
366  $ ./waf configure [--pdf] [--singlehtml] [--prefix] \
367                    [--sphinx-options] \
368                    [--sphinx-nit-pick] \
369                    [--plantuml] \
370                    [--ditaa] \
371                    [--disable-extra-fonts]
372
373  $ ./waf
374
375The '--pdf' and '--singlehtml' options can be added to configure to build those
376output formats.
377
378Sphinx options can be added using the `--sphinx-options` option. If you have
379more than option use a quoted argument. This is an advanced feature that can
380be useful when experimenting with the `sphinx-build` command.
381
382Sphinx nit-picky mode adds `-n` to the `sphinx-build` command line to generate
383warnings and extra information about the source to help make sure our
384documentation source is as clean as possible. Please use this when writing
385documentation or making updates.
386
387The '--disable-extra-fonts' allows you to build PDF documents with out the
388fonts we use for a better quality document. Use this option to build without
389needing the extra fonts accepting you will get poor quality documents.
390
391To build and install to a specific location:
392
393  $ ./waf configure --prefix=/foo/my/location
394  $ ./waf build install
395
396To build the PlantUML and Ditaa images:
397
398  $ ./waf configure --plantuml --ditaa
399  $ ./waf clean build
400
401To nit-pick the source use:
402
403  $ ./waf configure --sphinx-nit-pick
404  $ ./waf clean build
405
406If you need to debug what is happening use configure with a suitable Sphinx
407verbose level:
408
409  $ ./waf configure --sphinx-options "-V -V"
410  $ ./waf clean build
411
412You can enter a manual's directory and run the same configure command and build
413just that manual.
414
415Documentation Standard
416----------------------
417
418This following details the documentation standard. If in doubt first search the
419existing documentation for an example and if unsure ask.
420
4211. All text is to be formatted to wrap at 80 columns. Do not manually line feed
422   before 80.
423
4242. Do not insert tab characters, use spaces, no trailing white space.
425
4263. Pasted text such as console output can exceed 80 columns however it is
427   preferred even this text is wrapped at 80 columns. Long lines in code block
428   text causes issues with the PDF output.
429
4304. The headings use the following:
431
432      Heading   Description
433      1  ###### Part
434      2  ****** Section
435      3  ====== Sub-section
436      4  ------ Sub-sub-section
437      5  ^^^^^^ Sub-sub-sub-section
438      6  ~~~~~~ Sub-sub-sub-sub-section
439
4405. For literal output, such as shell commands and code do not use '::'
441   at the trailing edge of the previous paragraph as it generates
442   warnings as the autodetect fails to find a suitable format. Use the
443   '.. code-block::' with a suitable lexical label. The lexers are:
444
445     http://pygments.org/docs/lexers/
446
447   Use the short names. For C code use 'c' code and 'shell' for shell
448   scripts and for terminal output use 'none'. If you need line
449   numbers use:
450
451    .. code-block:: shell
452       :linenos:
453
454   We support two forms of commands and outputs.
455
456   The first is to have a shell command block with just the commands
457   and if required an output block with the output or some of the
458   output. Use 'none' for the output block. Make sure the text clearly
459   states the block is the output, if it has been edited to shorten
460   the amount of output and if there are any special operating modes,
461   for example needing to be 'root'.
462
463   The second is to use a single block of type 'none' with the command
464   and output together as seen in a terminal session. The commands are
465   identifed by the standard shell prompt characters where '$' is a
466   user prompt and '#' is a 'root' prompt.
467
4686. Use the directives for 'note', 'warning', and 'topic'. Do not add 'TIP',
469   'Important' or 'Warning' to the text. Let the mark-up language handle
470   this. The supported directives are:
471
472     .. warning::
473     .. note::
474     .. topic::
475
476   These directives reference specific CSS style support.
477
4787. Images are placed in the 'images' directory. Do not place images in the
479   source directories. Using a common 'images' tree of images promotes sharing
480   of images. To add an image use:
481
482    .. figure:: ../images/my-image.png
483       :wdith: 75%
484       :align: center
485       :alt: This is the alt text for some output types.
486
4878. Callouts can be implemented manually using a literal block which can use
488   '::' or a code block and topic block is used for the items. For
489   example:
490
491     .. code-block: c
492
493        #include <stdio.h>  <1>
494        int main(int argc, char** argv)  <2>
495        {
496           printf("Hello world\n");  <3>
497           return 0;   <4>
498        }
499
500     .. topic:: Items:
501
502       1. Include the standard input/output header file.
503
504       2. The program starts here.
505
506       3. Print something to the standard output device.
507
508       4. Exit with an exit code of 0. This value can be checked by the
509          caller of this program.
510
511   Note, the topic items are manually numbered, which makes it easier to see
512   which item matches the text. Use <> for the number and align at a position
513   that works and makes the number as visible as possible. Use hanging indents
514   if an items extends past a single line.
515
5169. Use the RTEMS domain references for URLs and mailing lists. For example to
517   insert the RTEMS developers list use:
518
519     :r:list:`devel`
520     :r:url:`git`
521
522   The valid lists are:
523
524     announce     : Announce Mailing List
525     bugs         : Bugs Mailing List
526     devel        : Developers Mailing List
527     build        : Build Logs
528     users        : Users Mailing List
529     vc           : Version Control Mailing List
530
531  The valid URLs are:
532
533     trac         : https://devel.rtems.org/
534     devel        : https://devel.rtems.org/
535     www          : https://www.rtems.org/
536     buildbot     : https://buildbot.rtems.org/
537     builder      : https://builder.rtems.org/
538     docs         : https://docs.rtems.org/
539     lists        : https://lists.rtems.org/
540     git          : https://git.rtems.org/
541     ftp          : https://ftp.rtems.org/
542     review       : https://review.rtems.org/
543     bugs         : https://devel.rtems.org/wiki/Bugs/
544     gsoc         : https://devel.rtems.org/wiki/GSoC/
545     socis        : https://devel.rtems.org/wiki/SOCIS/
Note: See TracBrowser for help on using the repository browser.