A sample catalog with rewrite templates. Feel free to fork and modify with your own!
catalogue folder contains a directory tree of templates. Each leaf folder is one rewrite pattern, containing a
match file, a
rewrite file, and optionally, a
rule file. The
match file contents is the match pattern, the
rewrite file contents the rewrite pattern, and the optional
rule file starts with a
where ... rule.
When a directory tree is specified with
comby -templates catalogue, the
catalogue directory tree is traversed fully and every rewrite pattern is run against the file in the leaf folders.
Note that when running the
-templates option without any other flags, all files in the directory will be run against the rewrite patterns. In general, use
-f file-pattern.extension and/or
-d src to run against a particular filepath pattern or directory, respectively. However, you don't need to worry about doing that for this catalog, since the generator script takes care of that for you.
The top level language under the
catalogue directory defines the language label in the rendered site. Use the format in the newline-separated
DOC.md files (example) to produce output entries as in the rendered catalog website.
python generate.py (uses Python 2). This creates a
catalogue.json. The JSON file is refenced in
index.html to generate the site.
See the rendered catalog for this repository.