3 <b>A simple codex generator.</b>
5 <dfn>📰 Caudex</dfn> is a static website generator aimed at
6 generating simple, category⹀based lists of documents akin to the
7 “Codex” feature of games like <cite>Dragon Age</cite>.
8 It is built on top of [⛩️📰 书社][Shushe] and consequently inherits
9 all of the (few) dependencies and prerequisites of the latter.
11 Using 📰 Caudex is fairly straightforward, but customizing its
12 output requires some familiarity with X·S·L·T and, probably, a
13 minimal level of comfort using G·N·U Make.
17 <i lang="la">Caudex</i> is a Latin word meaning “tree trunk, bollard,
19 It is the historical antecedent of Latin (and English) <i
24 For an easy quickstart, you can simply clone the 📰 Caudex
25 repository and work directly in that folder.
28 git clone https://git.ladys.computer/Caudex
30 # Create a new entry in `my_category´ :—
31 make +my_category | xargs -o nano
37 However, the most flexible way to get started with 📰 Caudex is to
38 include it in a project as a Git submodule :—
41 git submodule add https://git.ladys.computer/Caudex
44 It can then be conigured, and activated, through recursive invocation
50 # Location of the 📰 Caudex submodule.
53 # Additional options to pass to 📰 Caudex.
55 # Any variable overrides you explicitly give on the command line will
56 # also automatically be forwarded.
59 # Build the website by running 📰 Caudex `make install´.
60 build: $(CAUDEX)/GNUmakefile
61 $(MAKE) -f $(CAUDEX)/GNUmakefile install $(CAUDEXOPTS)
63 # Forward targets which begin with a plus; these have special meaning
65 +%: $(CAUDEX)/GNUmakefile
66 $(MAKE) -f $(CAUDEX)/GNUmakefile $@ $(CAUDEXOPTS)
68 # If the make·file of 📰 Caudex doesn’t exist, the submodule needs
70 $(CAUDEX)/GNUmakefile:
71 git submodule update --init --recursive '$(CAUDEX)/GNUmakefile'
74 ## Setup and Configuration
76 📰 Caudex inherits all of the dependencies of ⛩️📰 书社 and enables
77 you to override them in the same way.
79 In addition to the configuration variables for ⛩️📰 书社, the
80 following variables are recognized and treated specially by
84 The location of the codex entries and related metadata (default:
86 Only one directory is supported.
89 The location of additional source files (default: `assets`).
90 Multiple asset directories can be provided, so long as the same file
91 subpath doesn’t exist in more than one of them.
93 - **`ASSETINCLUDEDIR`:**
94 The location of includes to be used by additional source files
95 (default: `assets/includes`).
96 Multiple asset include directories can be provided, so long as the
97 same file subpath doesn’t exist in more than one of them.
100 The location of the (temporary) build directory (default: `build`).
101 `make clean` will delete this, and it is recommended that it not be
102 used for programs aside from 📰 Caudex.
105 The location of directory to output files to (default: `public`).
106 `make install` will overwrite files in this directory which
107 correspond to those in `SRCDIR` and `ASSETDIR`.
108 It *will not* touch other files, including those generated from files
109 in `SRCDIR` which have since been deleted.
111 Files are first compiled to `$(BUILDDIR)/⛩️📰/public` before they
112 are copied to `DESTDIR`, so this folder is relatively quick and
113 inexpensive to re·create.
114 It’s reasonable to simply delete it before every `make install` to
115 ensure stale content is removed.
118 The location of the 📰 Caudex `GNUmakefile`.
119 This should be set automatically when calling Make and shouldn’t ever
120 need to be set manually.
123 Additional magic files for ⛩️📰 书社.
125 - **`EXTRAPARSERS`:**
126 Additional parsers for ⛩️📰 书社.
128 - **`EXTRATRANSFORMS`:**
129 Additional transforms for ⛩️📰 书社.
132 The name of the generator program (default: `📰 Caudex`).
135 The current version of `GENERATOR` (default: derived from the current
136 git tag/branch/commit).
139 The current version of the source files (default: derived from the
140 current git tag/branch/commit).
143 If this variable has a value, every recipe instruction will be
144 printed when it runs (default: empty).
145 This is helpful for debugging, but typically too noisy for general
150 Codex entries should be placed in subdirectories of `SRCDIR` and have
151 a file·name of the form `???-????` or `???-????,*`, where `???-????`
152 is a unique identifier for the entry within the codex.
153 The command `make +⟨category⟩` is provided as a convenience to create
154 a new entry with a random identifier within the subdirectory
156 If the identifier is followed by a comma, the remainder of the
157 file·name may be used to provide a human⹀friendly description of the
159 Remember: The file·name still needs to be compatible with ⛩️📰 书社
160 and Make (it must not contain spaces or other fraught Ascii
163 Entries should be of the `text/x.codex-entry` format, which is defined
166 1. The string `%%`, followed by a newline and
168 2. A [Record Jar][draft-phillips-record-jar-01] record starting with
169 `ENTRY :`, followed by
171 3. Any number of additional records, followed by
173 4. Zero or more lines of (mostly⹀)plain text.
180 TITLE : My Amazing Entry
183 This is the text of my amazing entry.
186 The text of the entry is processed minimally:
187 It is broken into paragraphs on blank lines, and paragraphs for which
188 each line begins with white·space are considered block quotations.
189 All other whitespace is trimmed and collapsed.
193 Codices, categories, and entries should all have metadata.
194 For entries, the metadata is provided by the record which begins the
195 `text/x.codex-entry` format.
196 For codicies and categories, the metadata is provided by a special file
197 named `@` in `SRCDIR` or the category directory, respectively.
198 In all cases, metadata is kept in the Record Jar format.
200 The following metadata fields are recognized by default :—
203 Indicates that the current record is a category record.
204 The value of this field gives the identifier for the category.
207 Indicates that the current record is a codex record.
208 The value of this field gives the identifier for the codex.
211 Indicates that the current record is an entry record.
212 The value of this field gives the identifier for the entry.
215 For all record types, gives the title of the thing being described.
217 If the `@` file is missing from a category directory, none of the
218 entries in the category will be recognized.
219 However, a minimal `@` file will be created for you when you create an
220 entry in a new category using `make +⟨category⟩`.
224 Assets are installed to their corresponding location in `DESTDIR`
225 (default: `public/`).
226 An entry with the identifier `%` will be installed to `%.xhtml`.
228 Two index files are created :— `index.xhtml` loads entries
229 dynamically upon request, and `standalone.xhtml` contains all of the
230 entries and does not require a network connection.
232 Output can be customized by supplying additional transforms, ⅌ normal
234 The easiest way to customize the transform is to introduce new
235 templates which operate in the `书社:header`, `书社:footer`, or
238 If you want to customize the actual main body output of 📰 Caudex,
239 you will need a pattern like this :—
242 <?xml version="1.0"?>
244 xmlns="http://www.w3.org/1999/XSL/Transform"
245 xmlns:exsl="http://exslt.org/common"
246 xmlns:html="http://www.w3.org/1999/xhtml"
247 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
248 exclude-result-prefixes="exsl"
251 <书社:id>example:modify-caudex-index</书社:id>
252 <!-- Create a template with increased priority, excluding elements with a `@data-caudex-parse´ attribute. -->
253 <template match="/html:div[@书社:parsed-by='urn:fdc:ladys.computer:20240204:Caudex:catalog.xslt'][@class='index' or @class='fullindex'][not(@data-caudex-parse)]" priority="1">
254 <!-- Add the attribute to the element in a variable. -->
255 <variable name="toparse">
257 <attribute name="data-caudex-parse"/>
258 <copy-of select="@*|node()"/>
261 <!-- Apply templates to the contents of the variable, saving the result. -->
262 <variable name="parsed">
263 <apply-templates select="exsl:node-set($toparse)/*"/>
265 <!-- Do something with the result. -->
266 <for-each select="exsl:node-set($parsed)/*">
273 [Shushe]: <https://git.ladys.computer/Shushe>
274 [draft-phillips-record-jar-01]: <https://datatracker.ietf.org/doc/html/draft-phillips-record-jar-01>