GNOME Bugzilla – Bug 781291
ability to customize headers and footers in html output
Last modified: 2018-05-22 13:11:05 UTC
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.
Created attachment 349857 [details] example jekyll template
Created attachment 349858 [details] template with the {{}} mostly expanded
Created attachment 349859 [details] ruby script to paste gtk-doc output into the expanded template
Added the linked to files as attachments, since the links are bound to break.
library.gnome.org does something similliar. Since we're moving gtk-doc to become a toolkit we could include a tool to doc such customization (preferably in python though).
Did you saw my recent work on gtkdoc-mkhtml2. FYI. I've started using jinja2, but it turned out to be somewhat slow too. Maybe we can do templating with a custom python module? WDYT?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk-doc/issues/35.