using_doc.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. Using the doc repository of your project
  2. ========================================
  3. In this section of the documentation, we are interested in the doc repository.
  4. The doc repository is a simple Git repo. It can be displayed as a subfolder
  5. of a project or as a dedicated Git repo.
  6. Either way its content can be displayed in 2 ways:
  7. * inline under the `Docs` tab in Pagure:
  8. * https://pagure.io/docs/<project>/ or
  9. * https://pagure.io/docs/<namespace>/<project>/
  10. * standalone:
  11. * https://docs.pagure.org/<project>/ or
  12. * https://docs.pagure.org/<namespace>.<project>/
  13. By default the `Docs` tab in the project's menu is disabled, you
  14. will have to visit the project's settings page and turn it on
  15. in the ``Project options`` section.
  16. The URL to clone the doc repo is:
  17. * https://pagure.io/docs/<namespace>/<project>.git
  18. To view the doc source files in the browser:
  19. * if the doc repo is kept in the project's sources, use the project's website
  20. * if the doc repo is a dedicated repo, use https://pagure.io/<namespace>/<name>
  21. Different file types can be used for your documentation in this repo:
  22. * simple text files
  23. Pagure will display them as plain text. If one of these is named ``index``
  24. it will be presented as the front page.
  25. * RST or markdown files
  26. Pagure will convert them to HTML on the fly and display them as such.
  27. The RST files must end with ``.rst`` and the markdown ones must end with
  28. ``.mk``, ``.md`` or simply ``.markdown``.
  29. * HTML files
  30. Pagure will simply show them as such.
  31. Updating documentation hosted in a dedicated repo is like
  32. `using other repos <https://docs.pagure.org/pagure/usage/forks.html>`_.
  33. Example
  34. -------
  35. Pagure's documentation is kept in pagure's sources, in the `doc` folder there.
  36. You can see it at: `https://pagure.io/pagure/blob/master/f/doc
  37. <https://pagure.io/pagure/blob/master/f/doc>`_. This doc can be built with
  38. `Sphinx <http://sphinx-doc.org/>`_ to make it HTML and prettier.
  39. The built documentation is available at: `https://docs.pagure.org/pagure/
  40. <https://docs.pagure.org/pagure/>`_.
  41. This is how it is built/updated:
  42. * Clone pagure's sources::
  43. git clone https://pagure.io/pagure.git
  44. * Move into its doc folder::
  45. cd pagure/doc
  46. * Build the doc::
  47. make html
  48. * Clone pagure's doc repository::
  49. git clone ssh://git@pagure.io/docs/pagure.git
  50. * Copy the result of sphinx's build to the doc repo::
  51. cp -r _build/html/* pagure/
  52. * Go into the doc repo and update it::
  53. cd pagure
  54. git add .
  55. git commit -am "Update documentation"
  56. git push
  57. * Clean the sources::
  58. cd ..
  59. rm -rf pagure # remove the doc repo
  60. rm -rf _build # remove the output from the sphinx's build
  61. To make things simpler, the following script (name `update_doc.sh`) can be
  62. used:
  63. ::
  64. #!/bin/bash
  65. make html
  66. git clone "ssh://git@pagure.io/docs/$1.git"
  67. cp -r _build/html/* $1/
  68. (
  69. cd $1
  70. git add .
  71. git commit -av
  72. git push
  73. )
  74. rm -rfI _build
  75. rm -rfI $1
  76. It can be used by running `update_doc.sh <project>` from within the folder
  77. containing the doc.
  78. So for pagure it would be something like:
  79. ::
  80. cd pagure/doc
  81. update_doc.sh pagure