Skip to content

Commit ff8957d

Browse files
committed
Document flag support
1 parent 91c7f71 commit ff8957d

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Config Flags
2+
3+
As of `v1!0.1.0a31`, hexdoc has full support for Patchouli's [config flag system](https://vazkiimods.github.io/Patchouli/docs/patchouli-basics/config-gating).
4+
5+
## Default flags
6+
7+
The following flags default to false:
8+
9+
- `debug`
10+
- `advancements_disabled`
11+
- All flags starting with `advancements_disabled_`
12+
- `testing_mode`
13+
14+
Unlike Patchouli, **all other flags default to true** if not defined. This generally provides a more complete default state for the web book, ensuring that all optional content is enabled by default.
15+
16+
:::tip
17+
18+
This behaviour makes it easy to add content that's only visible in Patchouli or hexdoc, but not both. You can use the flag `mod:hexdoc:web_only` to hide content ingame, or `!mod:hexdoc:web_only` to hide content in the web book. This flag has no special meaning in hexdoc or Patchouli; rather, it exploits the fact that hexdoc and Patchouli have opposite defaults for unknown flags. The `mod:` prefix ensures that an "undefined flag" warning will not be logged, and the `:` in `hexdoc:web_only` ensures that this flag will never conflict with an actual modid.
19+
20+
:::
21+
22+
## Setting flags
23+
24+
There are two ways to override the default values of flags in hexdoc. The first method is to add them to `hexdoc.toml` as follows:
25+
26+
```toml title="doc/hexdoc.toml"
27+
[flags]
28+
"yourmod:foo" = false
29+
```
30+
31+
Flags set in `hexdoc.toml` only apply to your own web book - they won't affect other mods that depend on your hexdoc plugin. Also, this can be used to **override** values from other sources. For example, if another mod sets flag `foo` to true, you can use `hexdoc.toml` to override it to false.
32+
33+
The second method is to implement [`ModPlugin.flags`](pathname:///docs/api/hexdoc/plugin/mod_plugin.html#ModPlugin.flags). Flags returned by this hook are available for use by mods that depend on your hexdoc plugin. If multiple mods define flags using this hooks, the values are combined using OR. For example, if one mod uses this hook to set flag `foo` to true, and another mod sets it to false, the final value will be true.

web/docusaurus/docs/03-guides/06-standalone/01-model-rendering/amethyst_sconce.png renamed to web/docusaurus/docs/03-guides/07-standalone/01-model-rendering/amethyst_sconce.png

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/01-model-rendering/anvil.png renamed to web/docusaurus/docs/03-guides/07-standalone/01-model-rendering/anvil.png

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/01-model-rendering/edified_stairs.png renamed to web/docusaurus/docs/03-guides/07-standalone/01-model-rendering/edified_stairs.png

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/01-model-rendering/index.md renamed to web/docusaurus/docs/03-guides/07-standalone/01-model-rendering/index.md

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/01-model-rendering/sculk_shrieker.png renamed to web/docusaurus/docs/03-guides/07-standalone/01-model-rendering/sculk_shrieker.png

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/02-patchouli-schemas.md renamed to web/docusaurus/docs/03-guides/07-standalone/02-patchouli-schemas.md

File renamed without changes.

web/docusaurus/docs/03-guides/06-standalone/_category_.yml renamed to web/docusaurus/docs/03-guides/07-standalone/_category_.yml

File renamed without changes.

0 commit comments

Comments
 (0)