diff options
author | Arun Isaac | 2023-08-28 19:00:46 +0100 |
---|---|---|
committer | Arun Isaac | 2023-08-29 17:08:46 +0100 |
commit | 97cfd1fd18efc1945cf5fe4fd1b12311ebac6c63 (patch) | |
tree | bc97190a8b448b58160c3245d075582c6d41752f | |
parent | 2e9463b564e2dad6a03eaf32ad8d789d7f812e24 (diff) | |
download | skribilo-97cfd1fd18efc1945cf5fe4fd1b12311ebac6c63.tar.gz skribilo-97cfd1fd18efc1945cf5fe4fd1b12311ebac6c63.tar.lz skribilo-97cfd1fd18efc1945cf5fe4fd1b12311ebac6c63.zip |
html: Implement chapter using CSS.
The <center> tag is deprecated in HTML5.
* src/guile/skribilo/engine/html.scm (chapter): Implement using CSS
only.
-rw-r--r-- | src/guile/skribilo/engine/html.scm | 34 |
1 files changed, 18 insertions, 16 deletions
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 "<!-- ") - (output title html-title-engine) - (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 "<!-- ") + (output title html-title-engine) + (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 |