From 97cfd1fd18efc1945cf5fe4fd1b12311ebac6c63 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 28 Aug 2023 19:00:46 +0100 Subject: html: Implement chapter using CSS. The
tag is deprecated in HTML5. * src/guile/skribilo/engine/html.scm (chapter): Implement using CSS only. --- src/guile/skribilo/engine/html.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm index 496f384..0425cab 100644 --- a/src/guile/skribilo/engine/html.scm +++ b/src/guile/skribilo/engine/html.scm @@ -1402,22 +1402,24 @@ ignored, return #f." :before (lambda (node engine) (let ((title (markup-option node :title)) (ident (markup-ident node))) - (display "\n") - (html-open 'a - `((name . ,(string-canonicalize ident)))) - (html-close 'a) - (html-open 'center) - (html-open 'h1 - `((class . ,(markup-class node)))) - (output (html-container-number node engine) - engine) - (display " ") - (output (markup-option node :title) - engine) - (html-close 'h1) - (html-close 'center)))) + ;; chapter title in comments + (display "\n") + ;; h1 wrapping chapter title + (html-open 'h1 + `((class . ,(markup-class node)) + (id . ,(string-canonicalize ident)) + (style . ,(style-declaration + '((text-align . "center")))))) + ;; chapter number + (output (html-container-number node engine) + engine) + (display " ") + ;; chapter title + (output (markup-option node :title) + engine) + (html-close 'h1)))) ;; This writer is invoked only for chapters rendered inside separate files! (markup-writer 'chapter -- cgit v1.2.3