aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Isaac2023-08-28 23:01:31 +0100
committerArun Isaac2023-08-29 17:08:47 +0100
commitcea43d7793d31b49b421a27cf29293011fbe72be (patch)
tree3a4e69183d1ac58b3f2c54de5426b0694bfd1ef9 /src
parent2ecf73a5e3085a2b529b10e92a6371cc211dafba (diff)
downloadskribilo-cea43d7793d31b49b421a27cf29293011fbe72be.tar.gz
skribilo-cea43d7793d31b49b421a27cf29293011fbe72be.tar.lz
skribilo-cea43d7793d31b49b421a27cf29293011fbe72be.zip
html: Implement author without HTML tables.
* src/guile/skribilo/engine/html.scm (author): Implement without HTML tables, using CSS only.
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/engine/html.scm93
1 files changed, 38 insertions, 55 deletions
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index d651de7..96b5565 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -1056,73 +1056,56 @@ ignored, return #f."
;*---------------------------------------------------------------------*/
(markup-writer 'author
:options '(:name :title :affiliation :email :url :address :phone :photo :align)
- :before (lambda (node engine)
- (html-open 'table
- `((class . ,(markup-class node))))
- (html-open 'tbody))
:action (lambda (node engine)
- (let ((name (markup-option node :name))
- (title (markup-option node :title))
- (affiliation (markup-option node :affiliation))
- (email (markup-option node :email))
- (url (markup-option node :url))
- (address (markup-option node :address))
- (phone (markup-option node :phone))
- (nfn (engine-custom engine 'author-font))
- (align (markup-option node :align)))
- (define (row node)
- (html-open 'tr)
- (html-open 'td
- `((align . ,align)))
- (output node engine)
- (html-close 'td)
- (html-close 'tr))
- ;; name
- (html-open 'tr)
- (html-open 'td
- `((align . ,align)))
- (if nfn (format #t "<font ~a>\n" nfn))
- (output name engine)
- (if nfn (html-close 'font))
- (html-close 'td)
- (html-close 'tr)
- ;; title
- (if title (row title))
- ;; affiliation
- (if affiliation (row affiliation))
- ;; address
- (if (pair? address)
- (for-each row address))
- ;; telephone
- (if phone (row phone))
- ;; email
- (if email (row email))
- ;; url
- (if url (row url))))
- :after "</tbody></table>")
+ (let ((name (markup-option node :name))
+ (title (markup-option node :title))
+ (affiliation (markup-option node :affiliation))
+ (email (markup-option node :email))
+ (url (markup-option node :url))
+ (address (markup-option node :address))
+ (phone (markup-option node :phone))
+ (author-font (engine-custom engine 'author-font))
+ (align (markup-option node :align)))
+ (define (row node)
+ (output node engine)
+ (html-open 'br))
+ (html-open 'div
+ `((style . ,(style-declaration
+ `((text-align . ,align))))))
+ ;; name
+ (when author-font
+ (html-open 'span
+ `((style . ,(style-declaration
+ `((font-family . ,author-font)))))))
+ (row name)
+ (when author-font (html-close 'span))
+ ;; title
+ (when title (row title))
+ ;; affiliation
+ (when affiliation (row affiliation))
+ ;; address
+ (when address (for-each row address))
+ ;; telephone
+ (when phone (row phone))
+ ;; email
+ (when email (row email))
+ ;; url
+ (when url (row url))
+ (html-close 'div))))
;*---------------------------------------------------------------------*/
;* author ... */
;*---------------------------------------------------------------------*/
(markup-writer 'author
:options '(:name :title :affiliation :email :url :address :phone :photo :align)
- :predicate (lambda (node engine) (markup-option node :photo))
- :before (lambda (node engine)
- (html-open 'table
- `((class . ,(markup-class node))))
- (html-open 'tbody)
- (html-open 'tr))
+ :predicate (lambda (node engine)
+ (markup-option node :photo))
:action (lambda (node engine)
(let ((photo (markup-option node :photo)))
- (html-open 'td)
(output photo engine)
- (html-close 'td)
- (html-open 'td)
(markup-option-add! node :photo #f)
(output node engine)
- (markup-option-add! node :photo photo)
- (html-close 'td)))
- :after "</tr>\n</tbody></table>")
+ (markup-option-add! node :photo photo))))
;*---------------------------------------------------------------------*/
;* toc ... */