Skip to content

Commit 3bf7983

Browse files
committed
Put per-letter quicklinks at the top of the HTML bookindex page
1 parent d0f876c commit 3bf7983

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

doc/src/sgml/stylesheet.dsl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,49 @@
371371
(empty-sosofo))))
372372

373373

374+
;; Put index "quicklinks" (A | B | C | ...) at the top of the bookindex page.
375+
376+
(element index
377+
(let ((preamble (node-list-filter-by-not-gi
378+
(children (current-node))
379+
(list (normalize "indexentry"))))
380+
(indexdivs (node-list-filter-by-gi
381+
(children (current-node))
382+
(list (normalize "indexdiv"))))
383+
(entries (node-list-filter-by-gi
384+
(children (current-node))
385+
(list (normalize "indexentry")))))
386+
(html-document
387+
(with-mode head-title-mode
388+
(literal (element-title-string (current-node))))
389+
(make element gi: "DIV"
390+
attributes: (list (list "CLASS" (gi)))
391+
($component-separator$)
392+
($component-title$)
393+
(if (node-list-empty? indexdivs)
394+
(empty-sosofo)
395+
(make element gi: "P"
396+
attributes: (list (list "CLASS" "INDEXDIV-QUICKLINKS"))
397+
(with-mode indexdiv-quicklinks-mode
398+
(process-node-list indexdivs))))
399+
(process-node-list preamble)
400+
(if (node-list-empty? entries)
401+
(empty-sosofo)
402+
(make element gi: "DL"
403+
(process-node-list entries)))))))
404+
405+
406+
(mode indexdiv-quicklinks-mode
407+
(element indexdiv
408+
(make sequence
409+
(make element gi: "A"
410+
attributes: (list (list "HREF" (href-to (current-node))))
411+
(element-title-sosofo))
412+
(if (not (last-sibling?))
413+
(literal " | ")
414+
(literal "")))))
415+
416+
374417
]]> <!-- %output-html -->
375418

376419

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy