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 | |
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.
-rw-r--r-- | doc/modules/skribilo/documentation/api.scm | 30 | ||||
-rw-r--r-- | doc/user/skribilo.css | 22 |
2 files changed, 42 insertions, 10 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 diff --git a/doc/user/skribilo.css b/doc/user/skribilo.css index eb93784..b74e8a3 100644 --- a/doc/user/skribilo.css +++ b/doc/user/skribilo.css @@ -1,4 +1,4 @@ -/* -*- coding: utf-8; mode: C; -*- +/* -*- coding: utf-8 -*- CSS style sheet for the Skribilo manual. @@ -155,7 +155,7 @@ table.toc { line-height: 1.5; } -.skribilo-doc-markup { +.skribilo-doc-markup, .skribilo-doc-engine { border-top: 1px dotted #333; background: #fef7f7; border-radius: 0px 0px 10px 10px; @@ -167,28 +167,36 @@ table.toc { } .skribilo-api-option-name, -.skribilo-api-argument-name { +.skribilo-api-argument-name, +.skribilo-api-engine-custom-name { font-family: monospace, Courier; font-size: 0.9em; display: inline-block; min-width: 120px; vertical-align: top; } -.skribilo-api-option-description { +.skribilo-api-engine-custom-name { + min-width: 150px; +} +.skribilo-api-option-description, +.skribilo-api-engine-custom-description { display: inline-block; - max-width: 90%; + max-width: 80%; } -.skribilo-api-option-engines { +.skribilo-api-option-engines, +.skribilo-api-engine-custom-default { border-left: 1px dotted #333; border-right: 1px dotted #333; padding-left: 5px; padding-right: 5px; font-size: 0.9em; } +.skribilo-api-engine-custom-default { + color: #333; +} .skribilo-api-see-also { margin-top: 15px; } - /* Links. */ a { text-decoration: none; border: 0 0 0 0; border-style: none; } |