ability to customize headers and footers in html output
Submitted by John Cupitt
Link to original bug (#781291)
Description
I'm using gtk-doc for my project and I needed to be able to change the headers and footers in the formatted output to make nice online docs.
I understand gtk-doc is currently being redesigned to include this feature, so maybe my experience is a possible sample use-case. This has been discussed on the gtk-devel mail list here:
https://mail.gnome.org/archives/gtk-devel-list/2017-April/msg00002.html
Summary:
I wanted to be able to put google analytics into the footer of each page, so I can see which doc pages people find most useful, and I wanted to swap the front matter in the page for something that would style the output to match the rest of my micro-site.
I took one of the standard gh-pages jekyll templates:
https://github.com/pages-themes/cayman/blob/master/_layouts/default.html
Expanded out the jekyll parts to make some plain html:
https://github.com/jcupitt/libvips/blob/gh-pages/_layouts/api-default.html
Then ran this tiny bit of ruby to replace the children of main-content with the children of <body>
in the gtk-doc output:
https://github.com/jcupitt/libvips/blob/gh-pages/gen-api.rb
Producing pages like this:
http://jcupitt.github.io/libvips/API/current/VipsImage.html
It seems to work well, though it would have been nice to have been able to just use the jekyll template unexpanded.