You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.4 KiB

1 month ago
  1. How to build the Ghostscript documentation
  2. ==========================================
  3. Welcome to the Ghostscript documentation. This documentation relies on Sphinx (https://www.sphinx-doc.org/en/master/) to publish HTML & PDF docs from markdown files written with restructured text / RST (https://en.wikipedia.org/wiki/ReStructuredText).
  4. Installing Sphinx & dependencies
  5. --------------------------------
  6. 1. You should follow the instructions on the Sphinx website to install Sphinx on your system.
  7. 2. Ensure you have Latex (https://www.latex-project.org/get/) installed
  8. This ensures that you can build a PDF of the documentation.
  9. 3. The Sphinx documentation files also rely on the "readthedocs" theme to be installed, follow the instructions here: https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html
  10. 4. Once you have installed the "readthedocs" theme, depending on your OS, it will also have installed a `docutils` (http://docutils.sourceforge.net/) Python package.
  11. This should be okay, however if you have issues with building docs for PDF ensure that the `docutils` version works for you.
  12. To see what version you have do:
  13. python3 -m pip show docutils
  14. On Windows the required version was 0.18.1 to build PDF docs (pip install docutils=0.18.1), however on other systems lower versions were fine.
  15. Editing the documentation
  16. -------------------------
  17. Within this `src` folder update the associated `.rst` files which are in restructured text format. These files represent the corresponding document pages.
  18. Some notes on syntax
  19. ~~~~~~~~~~~~~~~~~~~~
  20. - Use ``for inline code`` or ``computer/technical terminology``
  21. - Use tab indented code for code blocks with, e.g. .. code-block:: bash
  22. - For device names use :title:`deviceName` , e.g. :title:`pdfwrite`
  23. - For headers underline text with ==== for h1 level, ---- for h2, ~~~~ for h3 & """" for h4
  24. For full details on RST syntax, see: https://www.sphinx-doc.org/en/master/usage/restructuredtext/
  25. Building HTML documentation
  26. ---------------------------
  27. From the `doc` location run:
  28. sphinx-build -b html src build
  29. This then creates the HTML documentation within `doc/build` for your review, you can then run `build/index.html` to check out the results.
  30. Building PDF documentation
  31. --------------------------
  32. Ensure that `pdflatex` is on your PATH, test with:
  33. pdflatex --help
  34. Then create the latex build from the `doc` location:
  35. sphinx-build -b latex src build/latex
  36. Once done do:
  37. cd build/latex
  38. make
  39. If there any warnings then hit return to pass through them to continue building ( also decide if you need to fix them or not ).
  40. Now you should have Ghostscript.pdf ready within `build/latex`.
  41. Move the Ghostscript.pdf file into the root of "doc" and replace the existing PDF as required.
  42. Updating the documentation
  43. --------------------------
  44. - Make your edits as required in the relevant RST files ( see above: Editing the documentation )
  45. - Test locally by building and running in local browser ( see above "Building HTML documentation" )
  46. - Ensure to update the version of Ghostscript cited in `conf.py` line 52 ( e.g. release = "10.0.0" )
  47. - Ensure that `News.html` reflects the latest release and has any further "news"
  48. - Once changes are pushed to golden master then readthedocs.io should pick up the changes, build & deploy the docs!
  49. - Visit ghostscript.readthedocs.io once built and deployed to check
  50. ---
  51. For more see: Using Sphinx (https://www.sphinx-doc.org/en/master/usage/index.html)