X-Git-Url: https://git.ladys.computer/Shushe/blobdiff_plain/05576f88d7808054799537e89c7888e870df66bf..2a4b2ff1cb88305fb662deda701ee23afbf56498:/README.markdown diff --git a/README.markdown b/README.markdown index 5b5b84c..e0a143e 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,6 @@ # ⛩️📰 书社 -An X·S·L·T‐based static site generator. +A make·file for X·M·L. ⛩️📰 书社 aims to make it easy to generate websites with X·S·L·T and G·N·U Make. @@ -18,6 +18,15 @@ It makes things easier by :⁠— It aims to do this with zero dependencies beyond the programs already installed on your computer. +(On Linux machines, you may need to install `libxml2-utils` to get the + commandline programs from `libxml2`.) + +**Note:** +⛩️📰 书社 requires functionality present in G·N·U Make 3.81 (or later) + and will not work in previous versions, or other implementations of + Make. +Compatibility with later versions of G·N·U Make is assumed, but not + tested. ## Nomenclature @@ -91,21 +100,29 @@ In every case, you may supply your own implementation by overriding the corresponding (allcaps) variable (e·g, set `MKDIR` to supply your own `mkdir` implementation). +- `awk` - `cat` +- `cksum` - `cp` +- `date` - `echo` - `file` - `find` +- `git` (optional; set `GIT=` to disable) +- `ln` - `mkdir` (requires support for `-p`) - `mv` +- `od` (requires support for `-t x1`) - `printf` - `rm` - `sed` - `sleep` +- `stat` - `test` - `touch` - `tr` (requires support for `-d`) - `uuencode` (requires support for `-m` and `-r`) +- `xargs` (requires support for `-0`) - `xmlcatalog` (provided by `libxml2`) - `xmllint` (provided by `libxml2`) - `xsltproc` (provided by `libxslt`) @@ -115,16 +132,32 @@ The following additional variables can be used to control the behaviour - **`SRCDIR`:** The location of the source files (default: `sources`). + Multiple source directories can be provided, so long as the same + file subpath doesn’t exist in more than one of them. - **`INCLUDEDIR`:** - The location of the source files (default: `sources/includes`). + The location of source includes (default: `sources/includes`). This can be inside of `SRCDIR`, but needn’t be. + Multiple include directories can be provided, so long as the same + file subpath doesn’t exist in more than one of them. - **`BUILDDIR`:** The location of the (temporary) build directory (default: `build`). + `make clean` will delete this, and it is recommended that it not be + used for programs aside from ⛩️📰 书社. - **`DESTDIR`:** The location of directory to output files to (default: `public`). + `make install` will overwrite files in this directory which + correspond to those in `SRCDIR`. + It *will not* touch other files, including those generated from files + in `SRCDIR` which have since been deleted. + + Files are first compiled to `$(BUILDDIR)/public` before they are + copied to `DESTDIR`, so this folder is relatively quick and + inexpensive to re·create. + It’s reasonable to simply delete it before every `make install` to + ensure stale content is removed. - **`THISDIR`:** The location of the ⛩️📰 书社 `GNUmakefile`. @@ -133,29 +166,65 @@ The following additional variables can be used to control the behaviour This variable is used to find the ⛩️📰 书社 `lib/` folder, which is expected to be in the same location. -- **`MAGICDIR`:** - The location of the magic files to use (default: `$(THISDIR)/magic`). +- **`MAGIC`:** + A white·space‐separated list of magic files to use (default: + `$(THISDIR)/magic/*`). -- **`FINDOPTS`:** - Options to pass to `find` when searching for source files (default: - `-LE`). +- **`EXTRAMAGIC`:** + The value of this variable is appended to `MAGIC` by default, to + enable additional magic files without overriding the existing ones. - **`FINDRULES`:** - Rules to use with `find` when searching for source files (default: - `-flags -nohidden -and -not -name '.*'`). + Rules to use with `find` when searching for source files. + The default ignores files that start with a period or hyphen‐minus, + those which end with a cloparen, and those which contain a hash, + buck, percent, asterisk, colon, semi, eroteme, bracket, backslash, + or pipe. + +- **`EXTRAFINDRULES`:** + The value of this variable is appended to `FINDRULES` by default, to + enable additional rules without overriding the existing ones. + +- **`FINDINCLUDERULES`:** + Rules to use with `find` when searching for includes (default: + `$(FINDRULES)`). + +- **`EXTRAFINDINCLUDERULES`:** + The value of this variable is appended to `FINDINCLUDERULES` by + default, to enable additional rules without overriding the existing + ones. - **`PARSERS`:** A white·space‐separated list of parsers to use (default: `$(THISDIR)/parsers/*.xslt`). +- **`EXTRAPARSERS`:** + The value of this variable is appended to `PARSERS` by default, to + enable additional parsers without overriding the existing ones. + - **`TRANSFORMS`:** A white·space‐separated list of transforms to use (default: `$(THISDIR)/transforms/*.xslt`). +- **`EXTRATRANSFORMS`:** + The value of this variable is appended to `TRANSFORMS` by default, to + enable additional transforms without overriding the existing ones. + - **`XMLTYPES`:** A white·space‐separated list of media types to consider X·M·L (default: `application/xml text/xml`). +- **`GENERATOR`:** + The name of the generator program (default: `⛩️📰 书社`). + +- **`VERSION`:** + The current version of `GENERATOR` (default: derived from the current + git tag/branch/commit). + +- **`SRCREV`:** + The current version of the source files (default: derived from the + current git tag/branch/commit). + - **`VERBOSE`:** If this variable has a value, every recipe instruction will be printed when it runs (default: empty). @@ -175,6 +244,8 @@ Supported magic numbers include :⁠— - `#!js` for `text/javascript` files - `@charset "` for `text/css` files - `#!tsv` for `text/tab-separated-values` files +- `%%` for `text/record-jar` files (unregistered; see + [[draft-phillips-record-jar-01][]]) Text formats with associated X·S·L·T parsers are wrapped in a H·T·M·L `