docbook / xslTNG

DocBook xslTNG Stylesheets
https://xsltng.docbook.org
MIT License
41 stars 20 forks source link

Can titleabbrev be made available to the navigation sidebar "pagetoc"? #469

Closed ndw closed 5 months ago

ndw commented 5 months ago

The challenge is that the pagetoc is plucked from the actual HTML headers on the rendered HTML page. It's not computed from the DocBook XML directly. That means we have to tunnel the titleabbrev content into the rendered page somehow.

Two possibilities occur to me:

  1. Use a db-titleabbrev attribute on the h1, h2, etc. That's bad because it's wrong to put human-readable content in attribute values. It's also tricky because the headers are generated from templates so you have to be careful about where and when the attribute node is created. Maybe extend the templating system?
  2. Use a <script type='text/html'> element. It's not an attribute, that's good. But what an awful hack.