Docs in Pagure
3 min read
I took this week to hack on this feature called Docs which gives you the ability to host documentation of your project in Pagure. I have never explored this feature before so I started to hack on it .
This feature is pretty straight forward to use. Once you have your project up and running you can go to
Setting of the project and under
Project Option click on
Activate Documentation this will actually activate a Doc tab in the main project. This can be used to host your docs specifically now this is a little tricky because you need to clone and push to a different URL, the docs are maintain in a separate location this is due to security concerns. When you activate the
Project option you are provided with a
Doc specific URL, you need to push your document or static pages to that URL and automatically any page named as
index will be taken as the first page.
You have to click on the more button beside GIT URLs to get your Docs URL and then you are good to go to host your static page.
For people who want to hack on Docs in Pagure you need to pull a few tricks to do that.
First and foremost is you need to get the code from pagure.io and then after setting up Pagure for development, you need to run two servers :
- Pagure server
- Doc server
The script corresponding to them are
So if you have ever hacked on Pagure then you will know that you have to log in make repo and follow the same steps mentioned above to see the Doc tab.
pagure/default_conf.py a new conf key has to be added which is
DOC_APP_URL = 'https://localhost:5001'
This tells Pagure that this instance supports Doc.
Now comes the tricky part, if you need to see Doc there should be a
<project_name>.git created in the
docs repo which is not there you just need to copy the file from
repo directory to
docs. Once this is done you need to clone the project repo from docs delete all the files there put the files you want in the static page , we support a lot of formats like
rst etc. Add, commit and push and voila you will see them in your local instance.
I am actually working on issue 469 in which Ryan has suggested to make docs more specific to static page hosting with the architecture that docs is based on this is actually a straight forward task but a really beautiful one which need a bit of deliberation on things we want to achieve. Hope it gave you insight in what I am trying to to do.
More documentation on this can be found in the usage section of Pagure Docs.
Did you find this article valuable?
Support Farhaan Bukhsh by becoming a sponsor. Any amount is appreciated!