From 4c37bf195c00fe0c9f771aa7eadc0b04767f0426 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 4 Oct 2023 14:27:39 +0200 Subject: html: add simple html index implementation --- tests/html.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/html.scm (limited to 'tests') diff --git a/tests/html.scm b/tests/html.scm new file mode 100644 index 0000000..c5a5967 --- /dev/null +++ b/tests/html.scm @@ -0,0 +1,35 @@ +(define-module (tests html) + #:use-module (src dates) + #:use-module (srfi srfi-64) + #:use-module ((src html) #:prefix html:)) + +(test-begin "HTML index page") + +(define me (html:person "Ekaitz" + #:email "ekaitz@elenq.tech" + #:uri "https://elenq.tech")) +(define index + (html:index #:title "Mi feed" + #:description "Este es mi feed" + #:uri "https://feed.elenq.tech/index.html" + #:styles (list + (html:css "this.css" #:uri "/this.css") + (html:css "that.css" #:uri "/that.css")) + #:scripts (list (html:js "script.js" #:uri "/script.js")) + #:author me + #:posts (list + (html:post #:title "first entry" + #:published (string/ISO->date "2023-03-01") + #:authors (list me) + #:summary-html '(p "Este es el resumen") + #:content-html '(p "Este es el contenido") + #:categories (list "una" "dos" "tres") + #:media (list))))) + + +(let ((html-index (with-output-to-string (lambda () (html:render index))))) + (test-assert (string=? html-index + "

first entry

Ekaitz

Este es el resumen

Este es el contenido