After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781291 - ability to customize headers and footers in html output
ability to customize headers and footers in html output
Status: RESOLVED OBSOLETE
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-13 21:58 UTC by John Cupitt
Modified: 2018-05-22 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example jekyll template (1.97 KB, text/html)
2017-04-14 09:28 UTC, John Cupitt
Details
template with the {{}} mostly expanded (1.88 KB, text/html)
2017-04-14 09:29 UTC, John Cupitt
Details
ruby script to paste gtk-doc output into the expanded template (1.06 KB, application/x-ruby)
2017-04-14 09:30 UTC, John Cupitt
Details

Description John Cupitt 2017-04-13 21:58:36 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.
Comment 1 John Cupitt 2017-04-14 09:28:53 UTC
Created attachment 349857 [details]
example jekyll template
Comment 2 John Cupitt 2017-04-14 09:29:45 UTC
Created attachment 349858 [details]
template with the {{}} mostly expanded
Comment 3 John Cupitt 2017-04-14 09:30:27 UTC
Created attachment 349859 [details]
ruby script to paste gtk-doc output into the expanded template
Comment 4 John Cupitt 2017-04-14 09:31:21 UTC
Added the linked to files as attachments, since the links are bound to break.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2017-04-16 13:45:29 UTC
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).
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2018-05-08 19:10:06 UTC
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?
Comment 7 GNOME Infrastructure Team 2018-05-22 13:11:05 UTC
-- 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.