Skip to content

Commit

Permalink
Add reprint behavior to config
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient authored Dec 6, 2024
1 parent d3a4780 commit f47195c
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Here's a more comprehensive `config.json` file.
"include": [
"race|changeling|mpmm"
],
"reprintBehavior": "newest",
"useDiceRoller": true,
"tagPrefix": "ttrpg-cli",
"template": {
Expand All @@ -131,9 +132,10 @@ Additional capabilities:
2. **Define Vault Paths:** The [`path`](#specify-target-paths-paths-key) sets the vault path destination for `rules` content.
3. **Targeted exclusion:** [`excludePattern`](#excluding-content-matching-an-excludepattern) and [`exclude`](#excluding-specific-content-with-exclude) leaves out specific content.
4. **Targeted inclusion:** The [`include`](#including-specific-content-with-include) specifies content that is *always included*.
5. **Use the dice roller plugin:** The [`useDiceRoller`](#use-the-dice-roller-plugin) key enables the dice roller plugin.
6. **Tag prefix:** The [`tagPrefix`](#tag-prefix) key sets the prefix for tags generated by the CLI.
7. **Templates:** The [`template`](#templates) key specifies the templates to use for different types of content.
5. **[Reprint behavior](#reprint-behavior):** Only the latest/newest version of a resource should be emitted (this is the default).
6. **Use the dice roller plugin:** The [`useDiceRoller`](#use-the-dice-roller-plugin) key enables the dice roller plugin.
7. **Tag prefix:** The [`tagPrefix`](#tag-prefix) key sets the prefix for tags generated by the CLI.
8. **Templates:** The [`template`](#templates) key specifies the templates to use for different types of content.

> [!WARNING]
> **Windows Users**: Replace any `\` in your paths with '/' in your JSON and YAML files.
Expand All @@ -152,7 +154,7 @@ If you're expecting to see content from a book or adventure and it's not showing

## Specify content with the `sources` key

> 🔥 SNAPSHOT ONLY. If you're using a 2.x version of the CLI, use [the legacy version](#migrating-from-full-source-and-convert)
> 🔥 Version 3.x or SNAPSHOT ONLY. If you're using a 2.x version of the CLI, use [the legacy version](#migrating-from-full-source-and-convert)
The CLI can emit content from a source in two ways:

Expand Down Expand Up @@ -345,6 +347,29 @@ Specify the data keys you want to include.

This approach is ideal for content acquired in parts, like individual items from D&D Beyond.

## Reprint behavior

> 🔥 Version 3.x or SNAPSHOT ONLY.
Content is often reprinted or updated in later sources or editions. This setting lets you control how reprinted or revised content is handled when generating notes.

``` json
"reprint": "newest"
```

This setting has 3 possible values:

- **`newest`** (default): Only includes notes for the most recent version of reprinted content.
- **`edition`**: Focuses on consolidating content for compatible editions (especially for 5e rules).
Example: Combines 2014 and 2024 item updates, while preserving edition-specific class and subclass definitions.
- **`all`**: Includes notes for all reprinted versions from enabled sources

Troubleshooting:

- If the behavior isn’t what you expect, run with the --log option and check the log file.
The log will show whether a specific key was kept or dropped and explain why.
- To ensure a specific resource is included, add its key to the [`include` filter](#including-specific-content-with-include) instead of relying on reprint behavior.

## Use the dice roller plugin

The CLI can generate notes that include inline dice rolls. To enable this feature, set the `useDiceRoller` attribute to `true`.
Expand Down

0 comments on commit f47195c

Please sign in to comment.