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 need to be in [💄📝 Les·M·L][LesML] format.
167 Codices, categories, and entries should all have metadata.
168 For entries, the metadata is provided by the record which begins the
170 For codices and categories, the metadata is provided by a special file
171 named `@` in `SRCDIR` or the category directory, respectively.
172 In all cases, metadata is kept in the Record Jar format.
174 The following metadata fields are recognized by default :—
177 Indicates that the current record is a category record.
178 The value of this field gives the identifier for the category.
181 Indicates that the current record is a codex record.
182 The value of this field gives the identifier for the codex.
185 Indicates that the current record is an entry record.
186 The value of this field gives the identifier for the entry.
189 For all record types, gives the title of the thing being described.
191 If the `@` file is missing from a category directory, none of the
192 entries in the category will be recognized.
193 However, a minimal `@` file will be created for you when you create an
194 entry in a new category using `make +⟨category⟩`.
198 Assets are installed to their corresponding location in `DESTDIR`
199 (default: `public/`).
200 An entry with the identifier `%` will be installed to `%.xhtml`.
202 Two index files are created :— `index.xhtml` loads entries
203 dynamically upon request, and `standalone.xhtml` contains all of the
204 entries and does not require a network connection.
206 Output can be customized by supplying additional transforms, ⅌ normal
208 The easiest way to customize the transform is to introduce new
209 templates which operate in the `书社:header`, `书社:footer`, or
212 If you want to customize the actual main body output of 📰 Caudex,
213 you will need a pattern like this :—
216 <?xml version="1.0"?>
218 xmlns="http://www.w3.org/1999/XSL/Transform"
219 xmlns:exsl="http://exslt.org/common"
220 xmlns:html="http://www.w3.org/1999/xhtml"
221 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
222 exclude-result-prefixes="exsl"
225 <书社:id>example:modify-caudex-index</书社:id>
226 <!-- Create a template with increased priority, excluding elements with a `@data-caudex-parse´ attribute. -->
227 <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">
228 <!-- Add the attribute to the element in a variable. -->
229 <variable name="toparse">
231 <attribute name="data-caudex-parse"/>
232 <copy-of select="@*|node()"/>
235 <!-- Apply templates to the contents of the variable, saving the result. -->
236 <variable name="parsed">
237 <apply-templates select="exsl:node-set($toparse)/*"/>
239 <!-- Do something with the result. -->
240 <for-each select="exsl:node-set($parsed)/*">
247 [LesML]: <https://git.ladys.computer/LesML>
248 [Shushe]: <https://git.ladys.computer/Shushe>
249 [draft-phillips-record-jar-01]: <https://datatracker.ietf.org/doc/html/draft-phillips-record-jar-01>