using_doc.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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, whose content will appear under the
  5. `Docs` tab in pagure and on https://docs.pagure.org/<project>/.
  6. There are a few ways you can put your documentation in this repo:
  7. * Simple text files
  8. Pagure will display them as plain text. If one of these is named ``index``
  9. it will be presented as the front page.
  10. * rst or markdown files
  11. Pagure will convert them to html on the fly and display them as such.
  12. The rst files must end with `.rst` and the markdown ones must end with
  13. ``.mk``, ``.md`` or simply ``.markdown``.
  14. * html files
  15. Pagure will simply show them as such.
  16. .. note: By default the `Docs` tab in the project's menu is disabled, you
  17. will have to visit the project's settings page and turn it on
  18. in the ``Project options`` section.
  19. Example
  20. -------
  21. Pagure's documentation is kept in pagure's sources, in the `doc` folder there.
  22. You can see it at: `https://pagure.io/pagure/blob/master/f/doc
  23. <https://pagure.io/pagure/blob/master/f/doc>`_. This doc can be built with
  24. `sphinx <http://sphinx-doc.org/>`_ to make it html and prettier.
  25. The built documentation is available at: `https://docs.pagure.org/pagure/
  26. <https://docs.pagure.org/pagure/>`_.
  27. This is how it is built/updated:
  28. * Clone pagure's sources::
  29. git clone https://pagure.io/docs/pagure.git
  30. * Move into its doc folder::
  31. cd pagure/doc
  32. * Build the doc::
  33. make html
  34. * Clone pagure's doc repository::
  35. git clone ssh://git@pagure.io/docs/pagure.git
  36. * Copy the result of sphinx's build to the doc repo::
  37. cp -r _build/html/* pagure/
  38. * Go into the doc repo and update it::
  39. cd pagure
  40. git add .
  41. git commit -am "Update documentation"
  42. git push
  43. * Clean the sources::
  44. cd ..
  45. rm -rf pagure # remove the doc repo
  46. rm -rf _build # remove the output from the sphinx's build
  47. To make things simpler, the following script (name `update_doc.sh`) can be
  48. used:
  49. ::
  50. #!/bin/bash
  51. make html
  52. git clone "ssh://git@pagure.io/docs/$1.git"
  53. cp -r _build/html/* $1/
  54. (
  55. cd $1
  56. git add .
  57. git commit -av
  58. git push
  59. )
  60. rm -rfI _build
  61. rm -rfI $1
  62. It can be used by running `update_doc.sh <project>` from within the folder
  63. containing the doc.
  64. So for pagure it would be something like:
  65. ::
  66. cd pagure/doc
  67. update_doc.sh pagure