From 303a12092413c157272d78657d7c4d4c3f6b27b0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 13 Apr 2021 23:30:55 +0200 Subject: software: Generate project list with member details. * software.md: Replace this file... * software.sxml: ...with this new file. * haunt.scm (read-markdown-page): Rename this procedure... (read-page): ...to this procedure and add optional READER argument. (static-pages): Add local definition of SXML-PAGE and use it for software.sxml. --- haunt.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'haunt.scm') diff --git a/haunt.scm b/haunt.scm index d3b5a73..27594b3 100644 --- a/haunt.scm +++ b/haunt.scm @@ -127,10 +127,10 @@ (define read-markdown (reader-proc commonmark-reader)) -(define (read-markdown-page file posts site) +(define* (read-page file posts site #:optional (reader read-markdown)) "Read the CommonMark page from FILE. Return its final SXML representation." - (let ((meta body (read-markdown (string-append %cwd "/" file)))) + (let ((meta body (reader (string-append %cwd "/" file)))) (base-layout `(div (@ (class "post")) (div (@ (class "post-body")) ,body)) @@ -144,13 +144,19 @@ representation." "Return the list of static web pages." (define (markdown-page html md) (lambda (site posts) - (make-page html (read-markdown-page md posts site) + (make-page html (read-page md posts site) + sxml->html))) + (define (sxml-page html sxml) + (lambda (site posts) + (make-page html (read-page sxml posts site (reader-proc sxml-reader)) sxml->html))) (list (markdown-page "index.html" "index.md") - (markdown-page "/en/software/index.html" - "software.md") + (sxml-page "/en/software/index.html" + "software.sxml") + (markdown-page "/en/documents/index.html" + "documents.md") (markdown-page "/en/contribute/index.html" "contribute.md") (markdown-page "/en/documents/index.html" @@ -240,7 +246,7 @@ representation." #:default-metadata '((author . "The GNU Assembly") (email . "assembly@lists.gnu.tools")) - #:readers (list commonmark-reader) + #:readers (list commonmark-reader sxml-reader) #:builders (append (list (static-directory "static")) (static-pages) -- cgit v1.2.1