Neale Pickett
·
2025-02-27
variants.md
1---
2title: Pupate Filesystem
3---
4
5Pupate comes built-in with everything you need to translate to
6MOTHv5 and SCTR outputs,
7as well as an HTML web UI to preview live changes
8and render built-in documentation, such as this page.
9
10But you can override all of these!
11
12
13Variants
14=======
15
16Variants provide translation templates
17that allow a single source category to be converted to multiple output formats.
18
19Variants have two or three subdirectories:
20`category`, `puzzle`, and optionally `web`.
21
22If `config.json` is present, it is read for configuration options (see below).
23
24All files in the `category` directory of a variant will be filled as templates, and
25written at the top-level directory of output categories.
26
27All files in the `puzzles` directory will be filled as templates, and
28written at the top-level directory of output puzzles (subdirectories of a category).
29
30Files in `web` are served by cocoon,
31but only if the file is not found in the directory specified by the `-web` argument.
32This allows variants to provide clients,
33while allowing client authors to use `-web` to test their clients.
34
35
36Variant Configuration
37====
38
39The file `config.yaml` may exist in a variant directory.
40This specifies configuration for the variant.
41
42Current configuration options:
43
44`Reorder` (bool)
45: If true, puzzles will be reordered to 1, 2, 3, 4...
46
47`Variant` (string)
48: The name of the variant. Defaults to the directory name of the variant base.
49: Used by some pages/templates for conditionals.
50
51`Unsafe` (bool)
52: Override the `-unsafe` flag.
53
54`Mothball` (bool)
55: Package each category's built files into a `.mb` file in the output directory.
56: MOTH uses these files.
57
58
59Static Files
60=========
61
62Static files are served verbatim from the `-static` option,
63with the URL prefix `/static`.
64
65This is where common files live:
66helpful JavaScript modules,
67base style sheets,
68and icons.
69
70
71Template functions
72==========
73
74Category and Puzzle templates files have access to all
75[puzzle template functions](puzzle-format.md).
76In addition, template files may call:
77
78 {{eval "name" pipeline}}
79 The template with the specified name is executed with dot set
80 to the value of the pipeline. This is the same as
81 {{template "name" pipeline}}
82 except that eval can be part of a pipeline:
83 {{(eval "name" pipeline) | pipeline}}