From 54ae61cd32d6580791aff55bfce96386fdff9550 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 1 Dec 2007 16:01:58 +0100 Subject: doc: Improve building using the Lout engine, with a `book' style. * doc/modules/skribilo/documentation/api.scm (doc-engine): Use `ctrtable' instead of `table'. * doc/modules/skribilo/documentation/manual.scm: Add customs for the `lout' engine. (ctrtable): New. (prgm): Don't center frames in Lout. * doc/user/Makefile.am (EXTRA_DIST): Add `lout/book-style.lout'. (%.ps): Add "-r4 -I$(srcdir)/lout". * doc/user/char.skb: Use `ctrtable' instead of `(center (table...' for the list of chars. * doc/user/markup.skb: Add emacsology. * doc/user/package.skb: Don't show the sample code with non-HTML engines. * doc/user/src/html-navtabs.skb: Fix typo. * doc/user/user.skb: Don't produce out-of-chapter text in Lout. --- doc/modules/skribilo/documentation/api.scm | 11 +++---- doc/modules/skribilo/documentation/manual.scm | 46 +++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 12 deletions(-) (limited to 'doc/modules') diff --git a/doc/modules/skribilo/documentation/api.scm b/doc/modules/skribilo/documentation/api.scm index 429dcf6..1426521 100644 --- a/doc/modules/skribilo/documentation/api.scm +++ b/doc/modules/skribilo/documentation/api.scm @@ -1,7 +1,7 @@ ;;; api.scm -- The style for documenting Scheme APIs. ;;; +;;; Copyright 2005, 2006, 2007 Ludovic Courtès ;;; Copyright 2003, 2004 Manuel Serrano -;;; Copyright 2005, 2006, 2007 Ludovic Courtès ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -30,7 +30,7 @@ :use-module (skribilo utils syntax) ;; `%skribilo-module-reader' :use-module (skribilo package base) - :use-module (skribilo documentation manual) ;; `*markup-index*' + :use-module (skribilo documentation manual) :use-module (skribilo documentation env) ;; `*api-engines*' :use-module (srfi srfi-1) @@ -609,8 +609,7 @@ ((engine-format? "latex") #f) (else - (center - (apply table + (apply ctrtable :&location &invocation-location :width *prgm-width* (tr :class 'api-table-header @@ -629,5 +628,5 @@ (td :valign 'top (code (exp->skribe (cadr def))))) (td :align 'left :valign 'top (cadr r)))) - (filter cadr args)))))))))) - + (filter cadr args))))))))) + diff --git a/doc/modules/skribilo/documentation/manual.scm b/doc/modules/skribilo/documentation/manual.scm index 6978afd..2c08aa1 100644 --- a/doc/modules/skribilo/documentation/manual.scm +++ b/doc/modules/skribilo/documentation/manual.scm @@ -1,7 +1,7 @@ ;;; manual.scm -- Skribilo manuals and documentation style. ;;; -;;; Copyright 2003, 2004 Manuel Serrano ;;; Copyright 2007 Ludovic Courtès +;;; Copyright 2003, 2004 Manuel Serrano ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -92,7 +92,7 @@ :text "Directory")))))))) ;*---------------------------------------------------------------------*/ -;* Html configuration */ +;* HTML configuration */ ;*---------------------------------------------------------------------*/ (let* ((he (find-engine 'html)) (bd (markup-writer-get 'bold he))) @@ -117,6 +117,35 @@ (engine-custom-set! le 'class-has-chapters? #t) (engine-custom-set! le 'usepackage npckg)) +;*---------------------------------------------------------------------*/ +;* Lout */ +;*---------------------------------------------------------------------*/ +(let* ((le (find-engine 'lout))) + (engine-custom-set! le 'document-type 'book) + (engine-custom-set! le 'document-include + "@Include { \"book-style.lout\" }") + (engine-custom-set! le 'initial-language "English") + (engine-custom-set! le 'initial-font "Palatino Base 10p")) + + + +;*---------------------------------------------------------------------*/ +;* ctrtable ... */ +;*---------------------------------------------------------------------*/ +(define-markup (ctrtable :rest args) + (resolve (lambda (n e env) + ;; With Lout, centering whole tables precludes breaking over + ;; several pages (because `@Center' has an `@OneRow' effect), + ;; which is a problem with large tables. + (if (engine-format? "lout" e) + (list (linebreak) + (apply table + :&location &invocation-location + args)) + (center (apply table + :&location &invocation-location + args)))))) + ;*---------------------------------------------------------------------*/ ;* prgm ... */ ;*---------------------------------------------------------------------*/ @@ -136,10 +165,15 @@ (line (prog :line line sc)) (else - (pre sc))))) - (center - (frame :margin 5 :border 0 :width *prgm-width* - (color :margin 5 :width 100. :bg c pr))))) + (pre sc)))) + (f (frame :margin 5 :border 0 :width *prgm-width* + (color :margin 5 :width 100. :bg c pr)))) + (resolve (lambda (n e env) + ;; Same trick as for `ctrtable': don't center frames (which + ;; are actually `@Tbl') in Lout. + (if (engine-format? "lout" e) + (list (! "\n@LP\n@DP\n") f) + f))))) ;*---------------------------------------------------------------------*/ ;* disp ... */ -- cgit v1.2.3