From 6858a6b3d1236bbffaf32376699c3e193ffad324 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 24 Dec 2022 23:38:55 +0000 Subject: web: Implement themes for the search page. We factor out all display related code to a theming module, and support powerful user customization of the theme thanks to generic functions. * tissue/commit.scm (document->sxml): Move to (tissue web themes default). * tissue/document.scm (document->sxml): Move to (tissue web themes default). * tissue/file-document.scm (document->sxml): Move to (tissue web themes default). * tissue/issue.scm (sanitize-string, document->sxml): Move to (tissue web themes default). * tissue/tissue.scm: Import (tissue web themes default). ()[web-search-renderer]: New field. (tissue-configuration-web-search-renderer): New function. (tissue-configuration): Accept web-search-renderer argument. * tissue/web/server.scm: Import (oop goops) and (tissue web themes). Do not import (tissue document). (%css, make-search-page, search-handler): Move to (tissue web themes default). * tissue/web/themes.scm, tissue/web/themes/default.scm: New files. * Makefile (sources): Add $(top_level_module_dir)/web/themes/*.scm. --- tissue/document.scm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tissue/document.scm') diff --git a/tissue/document.scm b/tissue/document.scm index 65a68b6..38270a5 100644 --- a/tissue/document.scm +++ b/tissue/document.scm @@ -43,8 +43,7 @@ document-snippet-source-text document-snippet print - document-sxml-snippet - document->sxml)) + document-sxml-snippet)) (define (slot-set object slot-name value) "Set @var{slot-name} in @var{object} to @var{value}. This is a purely @@ -138,7 +137,6 @@ mutate @var{object}." (define-generic document-text) (define-generic document-recency-date) (define-generic print) -(define-generic document->sxml) (define-method (document-type (document )) (string-trim-both (symbol->string (class-name (class-of document))) -- cgit v1.2.3