diff options
author | Arun Isaac | 2022-04-05 15:44:45 +0530 |
---|---|---|
committer | Arun Isaac | 2022-04-06 14:18:36 +0530 |
commit | 25104d4422e43b18b7fc4bf17a7ca8440394eda8 (patch) | |
tree | 57da9d865f52928dda74ed4a3c9e17b2254595ec /tissue/tissue.scm | |
parent | 57db90b5089fa94016f606236a85c99a1c93555c (diff) | |
download | tissue-25104d4422e43b18b7fc4bf17a7ca8440394eda8.tar.gz tissue-25104d4422e43b18b7fc4bf17a7ca8440394eda8.tar.lz tissue-25104d4422e43b18b7fc4bf17a7ca8440394eda8.zip |
web: Introduce <file> objects for web export.
With <file> objects specifying the files to export to the web, the
user has ultimate flexibility in their choice of what to export and
how to export.
* bin/tissue (tissue-web): Parameterize %project-name and
%tags-path. Use new signature of build-website.
* tissue/tissue.scm: Import (srfi srfi-1) and (srfi srfi-71).
(<tissue-configuration>)[web-files]: New field.
(tissue-configuration-web-files): New public function.
(tissue-configuration): New macro.
* tissue/web.scm: Import (srfi srfi-9).
(%project-name): New public parameter.
(<file>): New type.
(build-issue-listing): Delete function.
(copier, gemtext-reader, gemtext-exporter, skribe-exporter,
tag-issue-lister, tag-pages): New public functions.
(exporter, with-current-directory): New functions.
(build-website): Simply write <file> objects to files.
(replace-extension): Export.
Diffstat (limited to 'tissue/tissue.scm')
-rw-r--r-- | tissue/tissue.scm | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/tissue/tissue.scm b/tissue/tissue.scm index c1add7a..4af4886 100644 --- a/tissue/tissue.scm +++ b/tissue/tissue.scm @@ -17,25 +17,40 @@ ;;; along with tissue. If not, see <https://www.gnu.org/licenses/>. (define-module (tissue tissue) + #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) + #:use-module (srfi srfi-71) #:export (tissue-configuration tissue-configuration? tissue-configuration-project tissue-configuration-aliases tissue-configuration-web-css - tissue-configuration-web-tags-path)) + tissue-configuration-web-tags-path + tissue-configuration-web-files)) (define-record-type <tissue-configuration> - (make-tissue-configuration project aliases web-css web-tags-path) + (make-tissue-configuration project aliases web-css web-tags-path web-files) tissue-configuration? (project tissue-configuration-project) (aliases tissue-configuration-aliases) (web-css tissue-configuration-web-css) - (web-tags-path tissue-configuration-web-tags-path)) + (web-tags-path tissue-configuration-web-tags-path) + (web-files delayed-tissue-configuration-web-files)) -(define* (tissue-configuration #:key project (aliases '()) web-css (web-tags-path "/tags")) - "PROJECT is the name of the project. It is used in the title of the -generated web pages, among other places. +(define tissue-configuration-web-files + (compose force delayed-tissue-configuration-web-files)) + +(define-syntax tissue-configuration + (lambda (x) + (syntax-case x () + ((_ args ...) + (let ((before after (break (lambda (arg) + (eq? (syntax->datum arg) + #:web-files)) + #'(args ...)))) + #`(apply (lambda* (#:key project (aliases '()) web-css (web-tags-path "/tags") (web-files '())) + "PROJECT is the name of the project. It is used in +the title of the generated web pages, among other places. ALIASES is a list of aliases used to refer to authors in the repository. Each element is in turn a list of aliases an author goes @@ -46,6 +61,14 @@ document root and must begin with a /. If it is #f, no stylesheet is used in the generated web pages. WEB-TAGS-PATH is the path relative to the document root where the -per-tag issue listings are put. It must begin with a /. If it is #f, -per-tag issue listings are not generated." - (make-tissue-configuration project aliases web-css web-tags-path)) +per-tag issue listings are put. It must begin with a /. + +WEB-FILES is a list of <file> objects representing files to be written +to the web output." + (make-tissue-configuration project aliases web-css web-tags-path web-files)) + (list #,@(append before + (syntax-case after () + ((web-files-key web-files rest ...) + #`(web-files-key (delay web-files) + rest ...)) + (() #'())))))))))) |