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>
Sun, 12 Apr 2020 23:21:49 +0000 (01:21 +0200)
commitda9deba13d551e316f5a99a614834efa27ddc7d1
tree07e787ff4efdcf4edd1ed5e28d67dbb0f624dd6a
parentb36217c54dd92bdfa0984b9eded0765a3b388426
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