From 418a759052bbcc48012e2f99e105df796f1453b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 22 Apr 2018 18:50:41 +0200 Subject: 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. --- doc/modules/skribilo/documentation/api.scm | 30 +++++++++++++++++++++++++++--- 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" (punctuate see)) e)) - (display "\n"))))) + (display "\n")))) + + (markup-writer 'doc-engine he + :action (lambda (n e) + (let ((customs (markup-option n 'customs)) + (defaults (markup-option n 'defaults))) + + (display "\n
") + (for-each (match-lambda + ((name desc) + (output (! "\ +
\ +$1 \ + \ +default: $2 \ +$3
\n" + (object->string name) + (match (assq name defaults) + ((_ dflt) + (object->string dflt))) + desc) + e))) + customs) + (display "\n
\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; } -- cgit v1.2.3