Using the doc repository of your project¶
In this section of the documentation, we are interested in the doc repository.
The documentation repository is a plain git repository. It can be displayed as a subfolder of a project or as a dedicated git repository. Either way its content can be displayed in 2 ways:
- inline under the
Docstab in SourceLab:- https://pagure.io/docs/<project>/ or
- https://pagure.io/docs/<namespace>/<project>/
- standalone:
- https://docs.pagure.org/<project>/ or
- https://docs.pagure.org/<namespace>.<project>/
By default the Docs tab in the project's menu is disabled, you will have to visit the project's settings page and turn it on in the Project options section.
The URL to clone the doc repo is:
- https://pagure.io/docs/<namespace>/<project>.git
To view the doc source files in the browser:
- if the doc repo is kept in the project's sources, use the project's website
- if the doc repo is a dedicated repo, use https://pagure.io/<namespace>/<name>
Different file types can be used for your documentation in this repo:
-
simple text files
SourceLab will display them as plain text. If one of these is named
indexit will be presented as the front page. -
RST or markdown files
SourceLab will convert them to HTML on the fly and display them as such. The RST files must end with
.rstand the markdown ones must end with.mk,.mdor simply.markdown. -
HTML files
SourceLab will simply show them as such.
Updating documentation hosted in a dedicated repo is like using other repos.
Example¶
Say that the project myproject keeps the sources of its documentation in a doc folder, and builds them with Sphinx, which outputs HTML in _build/html. You publish the result by committing it to the project's documentation repository.
The following script (named update_doc.sh), run from the doc folder, does this:
#!/bin/bash
make html
git clone "ssh://git@pagure.io/docs/$1.git"
cp -r _build/html/* "$1/"
(
cd "$1"
git add .
git commit -av
git push
)
rm -rf "$1" # remove the doc repo
rm -rf _build # remove the output of the build
Call it with the name of the project: