From ce8ab209442beed465642c3208bd3e3ed7609292 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Fri, 21 Jul 2006 16:32:43 +0000 Subject: Made the HTML engine and `web-book' more style-neutral. * src/guile/skribilo/engine/html.scm: Switched all color- and font-related customs to `#f' by default. Adapted a few writers so that they can properly handle this. * src/guile/skribilo/package/web-book.scm: Be careful when using `color' et al. git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-21 --- src/guile/skribilo/engine/html.scm | 33 ++++++++++++++++----------------- src/guile/skribilo/package/web-book.scm | 29 ++++++++++++++++------------- 2 files changed, 32 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm index 15bea53..843f099 100644 --- a/src/guile/skribilo/engine/html.scm +++ b/src/guile/skribilo/engine/html.scm @@ -115,7 +115,7 @@ ;; emit-sui (emit-sui #f) ;; the body - (background "#ffffff") + (background #f) (foreground #f) ;; the margins (margin-padding 3) @@ -124,42 +124,42 @@ (section-left-margin #f) (left-margin-font #f) (left-margin-size 17.) - (left-margin-background "#dedeff") + (left-margin-background #f) (left-margin-foreground #f) (right-margin #f) (chapter-right-margin #f) (section-right-margin #f) (right-margin-font #f) (right-margin-size 17.) - (right-margin-background "#dedeff") + (right-margin-background #f) (right-margin-foreground #f) ;; author configuration (author-font #f) ;; title configuration (title-font #f) - (title-background "#8381de") + (title-background #f) (title-foreground #f) (file-title-separator " -- ") ;; html file naming (file-name-proc ,html-file-default) ;; index configuration - (index-header-font-size +2.) + (index-header-font-size #f) ;; +2. ;; chapter configuration (chapter-number->string number->string) (chapter-file #f) ;; section configuration (section-title-start "

") (section-title-stop "

") - (section-title-background "#dedeff") - (section-title-foreground "black") + (section-title-background #f) + (section-title-foreground #f) (section-title-number-separator " ") (section-number->string number->string) (section-file #f) ;; subsection configuration (subsection-title-start "

") (subsection-title-stop "

") - (subsection-title-background "#ffffff") - (subsection-title-foreground "#8381de") + (subsection-title-background #f) + (subsection-title-foreground #f) (subsection-title-number-separator " ") (subsection-number->string number->string) (subsection-file #f) @@ -167,7 +167,7 @@ (subsubsection-title-start "

") (subsubsection-title-stop "

") (subsubsection-title-background #f) - (subsubsection-title-foreground "#8381de") + (subsubsection-title-foreground #f) (subsubsection-title-number-separator " ") (subsubsection-number->string number->string) (subsubsection-file #f) @@ -877,7 +877,10 @@ (when title (display "\n") (if (html-color-spec? tbg) - (printf "")) ;; name (printf "") ;; title (if title (row title)) diff --git a/src/guile/skribilo/package/web-book.scm b/src/guile/skribilo/package/web-book.scm index a954c7a..e52bdc3 100644 --- a/src/guile/skribilo/package/web-book.scm +++ b/src/guile/skribilo/package/web-book.scm @@ -35,10 +35,11 @@ (center (table :width 97. :border 1 :frame 'box :cellpadding 0 :cellspacing 0 - (tr :bg (engine-custom e 'title-background) - (th (color :fg (engine-custom e 'background) - (bold "main page")))) - (tr :bg (engine-custom e 'background) + (tr :bg (engine-custom e 'title-background) + (th (let ((text (bold "main page")) + (bg (engine-custom e 'background))) + (if bg (color :fg bg text) text)))) + (tr :bg (engine-custom e 'background) (td (apply table :width 100. :border 0 (tr (td :align 'left :valign 'top @@ -60,12 +61,13 @@ (define chapter-browsing (lambda (n e) (center - (table :width 97. :border 1 :frame 'box + (table :width 97. :border 1 :frame 'box :cellpadding 0 :cellspacing 0 - (tr :bg (engine-custom e 'title-background) - (th (color :fg (engine-custom e 'background) - (bold (markup-option n :title))))) - (tr :bg (engine-custom e 'background) + (tr :bg (engine-custom e 'title-background) + (th (let ((title (bold (markup-option n :title))) + (bg (engine-custom e 'background))) + (if bg (color :fg title) title)))) + (tr :bg (engine-custom e 'background) (td (toc (handle n) :chapter #t :section #t :subsection #t))))))) ;*---------------------------------------------------------------------*/ @@ -79,10 +81,11 @@ (center (table :width 97. :border 1 :frame 'box :cellpadding 0 :cellspacing 0 - (tr :bg (engine-custom e 'title-background) - (th (color :fg (engine-custom e 'background) - (bold (if chap "Chapters" "Sections"))))) - (tr :bg (engine-custom e 'background) + (tr :bg (engine-custom e 'title-background) + (th (let ((text (bold (if chap "Chapters" "Sections"))) + (bg (engine-custom e 'background))) + (if bg (color :fg bg text) text)))) + (tr :bg (engine-custom e 'background) (td (if chap (toc (handle n) :chapter #t :section #f) (toc (handle n) :section #t :subsection #t))))))))) -- cgit v1.2.3
" tbg) + (printf "" + (if (html-color-spec? tbg) + (string-append "bgcolor=\"" tbg "\"") + "")) (display "")) (if (string? tfg) (printf "" tfg)) @@ -1068,13 +1071,9 @@ (display "
" align) - (if nfn - (printf "\n" nfn) - (display "\n")) + (if nfn (printf "\n" nfn)) (output name e) - (if nfn - (printf "\n") - (display "\n")) + (if nfn (printf "\n")) (display "