From 2faff242ffd4faf7c8c53e4a9317d5d9c930ad09 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 12 Nov 2023 12:45:23 -0500 Subject: Remove obsolete website. The official Haunt page is hosted on my blog now. --- website/manual/Reader.html | 179 --------------------------------------------- 1 file changed, 179 deletions(-) delete mode 100644 website/manual/Reader.html (limited to 'website/manual/Reader.html') diff --git a/website/manual/Reader.html b/website/manual/Reader.html deleted file mode 100644 index a25ba11..0000000 --- a/website/manual/Reader.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - -Haunt Reference Manual: Reader - - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Readers   [Contents][Index]

-
-
- -

5.3.1 Reader

-
-
(use-modules (haunt reader))
-
- -

The purpose of a reader is to translate the markup within a post file -into an SXML tree representing the HTML structure and associate some -metadata with it. -

-
-
Scheme Procedure: make-reader matcher proc
-

Create a new reader. The reader is to be activated when -matcher, a procedure that accepts a file name as its only -argument, returns #t. When a post file matches, the procedure -proc, which also accepts a file name as its only argument, reads -the contents and returns a post object (see Posts). -

- -
-
Scheme Procedure: reader? object
-

Return #t if object is a reader. -

- -
-
Scheme Procedure: reader-matcher reader
-

Return the match procedure for reader. -

- -
-
Scheme Procedure: reader-proc reader
-

Return the read procedure for reader. -

- -
-
Scheme Procedure: reader-match? reader file-name
-

Return #t if file-name is a file supported by -reader. -

- -
-
Scheme Procedure: read-post reader file-name [default-metadata]
-

Read a post object from file-name using reader, merging -its metadata with default-metadata, or the empty list if not -specified. -

- -
-
Scheme Procedure: read-posts directory keep? readers [default-metadata]
-

Read all of the files in directory that match keep? as -post objects. The readers list must contain a matching reader -for every post. -

- -
-
Scheme Procedure: make-file-extension-matcher ext
-

Create a procedure that returns #t when a file name ends with -“.ext”. -

- -
-
Scheme Procedure: sxml-reader
-

A basic reader for posts written as Scheme code that evaluates to an -an association list. The special key content contains the post -body as an SXML tree. -

-

Example: -

-
-
(use-modules (haunt utils))
-
-`((title . "Hello, world!")
-  (date . ,(string->date* "2015-04-10 23:00"))
-  (tags "foo" "bar")
-  (summary . "Just a test")
-  (content
-   ((h2 "Hello!")
-    (p "This is Haunt.  A static site generator for GNU Guile."))))
-
- -
- -
-
Scheme Procedure: html-reader
-

A basic reader for posts written in plain ol’ HTML. Metadata is -encoded as the key: value pairs, one per line, at the beginning -of the file. A line with the --- sentinel marks the end of the -metadata section and the rest of the file is encoded as HTML. -

-

Example: -

-
-
title: A Foo Walks Into a Bar
-date: 2015-04-11 20:00
-tags: bar
----
-<p>
-  This is an example using raw HTML, because Guile doesn't have a
-  Markdown parser.
-</p>
-
- -
- -
-
-

-Next: , Up: Readers   [Contents][Index]

-
- - - - - -- cgit v1.2.3