workflow.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. .. _workflow:
  2. Workflow
  3. ========
  4. GeoServer documentation aims to mirror the development process of the software itself. The process for writing/editing documentation is as follows:
  5. * **Step 1**: Check out source
  6. * **Step 2**: Make changes
  7. * **Step 3**: Build and test locally
  8. * **Step 4**: Commit changes
  9. Check out source
  10. ----------------
  11. Software
  12. ````````
  13. You must use the version control software `git` to retrieve files.
  14. * https://windows.github.com
  15. * https://mac.github.com
  16. * http://git-scm.com/downloads/guis
  17. * Or use git on the command line
  18. Repository
  19. ``````````
  20. This documentation source code exists in the same repository as the GeoServer source code::
  21. https://github.com/geoserver/geoserver
  22. Follow these instructions to fork the GeoServer repository:
  23. * https://help.github.com/articles/fork-a-repo
  24. Substituting ``geoserver/geoserver`` in place of ``octocat/Spoon-Knife``,
  25. when you are finished ``git remote -v`` should show::
  26. $ git remote -v
  27. origin https://github.com/YOUR_USERNAME/geoserver.git (fetch)
  28. origin https://github.com/YOUR_USERNAME/geoserver.git (push)
  29. upstream https://github.com/geoserver/geoserver.git (fetch)
  30. upstream https://github.com/geoserver/geoserver.git (push)
  31. Within this repository are the various branches and tags associated with releases, and the documentation is always inside a :file:`doc` path. Inside this path, the repository contains directories corresponding to different translations. The languages are referred to by a two letter code, with ``en`` (English) being the default.
  32. For example, the path review the English docs is::
  33. https://github.com/geoserver/geoserver/tree/main/doc/en
  34. Inside this directory, there are four directories::
  35. user/
  36. developer/
  37. docguide/
  38. theme/
  39. .. list-table::
  40. :widths: 20 80
  41. * - **Directory**
  42. - **Description**
  43. * - :file:`user`
  44. - User Manual source files
  45. * - :file:`developer`
  46. - Developer Manual source files
  47. * - :file:`docguide`
  48. - Documentation Guide source files (this is what you are reading now)
  49. * - :file:`theme`
  50. - GeoServer Sphinx theme (common to all three projects)
  51. Make changes
  52. ------------
  53. Documentation in Sphinx is written in `reStructuredText <https://docutils.sourceforge.io/rst.html>`_, a lightweight markup syntax. For suggestions on writing reStructuredText for use with Sphinx, please see the section on :ref:`sphinx`. For suggestions about writing style, please see the :ref:`style_guidelines`.
  54. Build and test locally
  55. ----------------------
  56. You should install Sphinx on your local system (see the next page on :ref:`install_sphinx`) to build the documentation locally and view any changes made. Sphinx builds the reStructuredText files into HTML pages and PDF files.
  57. #. Confirm availability of Python 3:
  58. .. code-block:: bash
  59. python --version
  60. #. Install sphinx and sphinx-autobuild:
  61. .. code-block:: bash
  62. cd doc\en
  63. pip3 install -r requirements.txt
  64. HTML
  65. ````
  66. #. On a terminal, navigate to your GeoServer source checkout and change to the :file:`doc/en` directory (or whichever project you wish to build).
  67. #. Run the following command to build the docs and open the browser with a live preview:
  68. .. code-block:: bash
  69. ant user-site
  70. The documentation will refresh as you edit individual files.
  71. #. Run the following command to only build the docs:
  72. .. code-block:: bash
  73. ant user
  74. The resulting HTML pages will be contained in :file:`doc/en/target/user/html`.
  75. #. Watch the output of the above commands for any errors and warnings. These could be indicative of problems with your markup. Please fix any errors and warnings before continuing.
  76. PDF
  77. ```
  78. #. On a terminal, navigate to your GeoServer source checkout and change to the :file:`doc/en` directory (or whichever project you wish to build).
  79. #. Run the following command:
  80. .. code-block:: bash
  81. ant user-pdf
  82. This will create a PDF file called :file:`{GeoServerProject}.pdf` in the same directory
  83. .. note:: The exact name of :file:`{GeoServerProject}` depends on which project is being built. However, there will only be one file with the extension ``.tex`` in the :file:`doc/en/user/build/latex` directory, so there should hopefully be little confusion.
  84. .. warning:: This command requires `LaTeX <http://www.latex-project.org/>`_ to be installed, and :command:`pdflatex` to be added to your Path.
  85. #. Watch the output of the above command for any errors and warnings. These could be indicative of problems with your markup. Please fix any errors and warnings before continuing.
  86. Commit changes
  87. --------------
  88. .. warning:: If you have any errors or warnings in your project, please fix them before committing!
  89. The final step is to commit the changes to a branch in *your* repository,
  90. using these commands::
  91. git checkout -b doc-fix
  92. git add [path/file(s)]
  93. git commit -m "message describing your fix"
  94. git push origin doc-fix
  95. You can use any name you like for the branch, often I use the issue number so I
  96. can tell my branches apart if I need to find them later.
  97. :file:`{path/file(s)}` is the path and file(s) you wish to commit to the repository. If you are unclear about which files you have changed you can use ``git status -sb`` to list the files that you have changed, this will give you a list of changed files, and indicate the ones that still need to be added to this commit::
  98. $ git status -sb
  99. ## update
  100. M docguide/source/background.rst
  101. M docguide/source/contributing.rst
  102. M docguide/source/install.rst
  103. M docguide/source/installlatex.rst
  104. M docguide/source/workflow.rst
  105. Here the ``M`` indicate these files are modified but not added. Once ``git add
  106. *.rst`` is run the indicator will change to ``A``, files that are not under
  107. git's control will show a ``?`` these are new files that you may need to add if
  108. you have created them for the documentation.
  109. When ready return to the GitHub website and submit a pull request:
  110. * https://help.github.com/articles/using-pull-requests
  111. The GitHub website provides a link to `CONTRIBUTING.md <https://github.com/geoserver/geoserver/blob/main/CONTRIBUTING.md>`_ outlining how we can accept your patch. Small fixes may be contributed on your behalf, changes larger than a file (such as a tutorial) may require some paperwork.