I wrote in a previous post about hacking restructuredText support into cgit by way of some nasty .htaccess and cgi scripts. Well, now I’ve built support into CGit properly.
I have in my cgitrc:
repo.readme=master:docs/readme.rst repo.about-filter=/home/gitcode/web/rst2html/rst2html
about-filter is a feature cgit has always had which pipes the readme file through that command before displaying it. In this case, it’s just the standard docutils restructuredText python script. The killer new feature here is the ability to specify that the readme file tree comes from a specific git head. This says to pull it from the master repository. I could specify any branch or even a sha1 id of a specific commit.
So now, http://git.mywebpage.com/about will display the restructuredText of doc/readme.rst converted to its nice HTML display. Best of all, I can go to http://git.mywebpage.com/about/otherfile.rst, and this will translate to master:docs/otherfile.rst. I could replace the about-filter with something for markdown or even a script that chooses which filter based on file name, and get something identical to Github’s readme feature. Now it’s in cgit. Hopefully Lars will pull this soon, as he did my other patches.
[...] I’ve decided to mirror Qt’s repository on my personal server running cgit, which is much much faster than Gitorious. It’s synced once an hour by cron. And if nobody [...]