diff options
author | Ludovic Courtès | 2018-04-22 18:50:41 +0200 |
---|---|---|
committer | Ludovic Courtès | 2018-04-22 18:50:41 +0200 |
commit | 418a759052bbcc48012e2f99e105df796f1453b3 (patch) | |
tree | 3a10672dcfea26761f0768ebef741d67764ce57c /doc/modules | |
parent | ae0bce11d0af4422096f6db8a857286ed26b07b5 (diff) | |
download | skribilo-418a759052bbcc48012e2f99e105df796f1453b3.tar.gz skribilo-418a759052bbcc48012e2f99e105df796f1453b3.tar.lz skribilo-418a759052bbcc48012e2f99e105df796f1453b3.zip |
doc: In HTML, use CSS for the 'doc-engine' markup.
* doc/modules/skribilo/documentation/api.scm (he): Add 'doc-engine'
writer.
(doc-engine): Add a case for HTML alongside Lout.
* doc/user/skribilo.css (.skribilo-doc-markup, .skribilo-doc-engine)
(.skribilo-api-engine-custom-name)
(.skribilo-api-engine-custom-description)
(.skribilo-api-engine-custom-default): New entities.
Diffstat (limited to 'doc/modules')
-rw-r--r-- | doc/modules/skribilo/documentation/api.scm | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/doc/modules/skribilo/documentation/api.scm b/doc/modules/skribilo/documentation/api.scm index 7ac194f..9494591 100644 --- a/doc/modules/skribilo/documentation/api.scm +++ b/doc/modules/skribilo/documentation/api.scm @@ -44,7 +44,7 @@ ;*---------------------------------------------------------------------*/ -;* Html configuration */ +;* HTML configuration */ ;*---------------------------------------------------------------------*/ (let* ((he (find-engine 'html)) (tro (markup-writer-get 'tr he))) @@ -108,7 +108,30 @@ See also $1</div>" (punctuate see)) e)) - (display "</div>\n"))))) + (display "</div>\n")))) + + (markup-writer 'doc-engine he + :action (lambda (n e) + (let ((customs (markup-option n 'customs)) + (defaults (markup-option n 'defaults))) + + (display "\n<div class=\"skribilo-doc-engine\">") + (for-each (match-lambda + ((name desc) + (output (! "\ +<div class=\"skribilo-api-engine-custom\"> \ +<span class=\"skribilo-api-engine-custom-name\">$1</span> \ +<span class=\"skribilo-api-engine-custom-description\"> \ +<span class=\"skribilo-api-engine-custom-default\">default: <tt>$2</tt></span> \ +$3</span></div>\n" + (object->string name) + (match (assq name defaults) + ((_ dflt) + (object->string dflt))) + desc) + e))) + customs) + (display "\n</div>\n"))))) ;*---------------------------------------------------------------------*/ ;* LaTeX configuration */ @@ -808,7 +831,8 @@ def @SkribiloExample named @Title {} right x { ((engine-format? "latex" e) (skribe-warning 3 "'doc-engine' not rendered in LaTeX") #f) - ((engine-format? "lout" e) + ((or (engine-format? "lout" e) + (engine-format? "html" e)) (list (map (lambda (c) (index (symbol->string (car c)) :index idx |