doc: Emit hyperlinks in HTML output for @lisp snippets.
authorLudovic Courtès <ludo@gnu.org>
Sun, 12 Apr 2020 22:12:20 +0000 (00:12 +0200)
committerLudovic Courtès <ludo@gnu.org>
Tue, 14 Apr 2020 14:01:39 +0000 (16:01 +0200)
commitf37789a523d3e4169b72312c3540b7624415c116
tree7b02e4718319f4dfdae32f6962b10dea66fb50ae
parent1ae7a9251b282a5f5e73a754dbc3b8bd4fe1da74
doc: Emit hyperlinks in HTML output for @lisp snippets.

This makes it easier to jump to the definition of a procedure or
variable when looking at a code snippet.  There can be false-positive
because scoping rules are ignored, for example, but it should be a good
approximation.

* doc/build.scm (syntax-highlighted-html)[build](highlights->sxml*): Add
'anchors' parameter.  Add clause for ('symbol text).
(syntax-highlight): Add 'anchors' parameter.  Wrap body in named let and
use it in recursive calls.  Pass ANCHORS to 'highlights->sxml*'.
(underscore-decode, anchor-id->key, collect-anchors, html?): New procedures.
(process-file): Add 'anchors' parameter. and honor it.
Rewrite mono-node and multi-node HTML files separately.
doc/build.scm