-
Notifications
You must be signed in to change notification settings - Fork 6
Template and Component Example
Joe Snee edited this page Sep 9, 2019
·
1 revision
Below are pictured an example template and component for the Pathfinder spell Acid Splash.
Example:
#### {{name}}
**Source** {{source}}
**School** {{school}}; **Level** {{#classes}}{{name}} {{level}}{{^last}}, {{/last}}{{/classes}}
___
- **Casting Time** {{castTime}}
- **Components** {{components}}
- **Range** {{range}}{{#area}} {{.}}{{/area}}
- **Effect** {{effect}}
- **Duration** {{duration}}
{{#savingThrow}}
- **Saving Throw** {{.}}
{{/savingThrow}}
{{#resistance}}
- **Spell Resistance** {{.}}
{{/resistance}}
{{! Description is handled this way in case description is a list or a single value}}
{{#description}}
{{.}}
{{/description}}
With Handlebars, you don't need to set the "last" value like has to be done for mustache. Instead, you can use "@last" to determine when you're on the last of a list. Example:
---
templateEngine: handlebars
---
#### {{name}}
**Source** {{source}}
**School** {{school}}; **Level** {{#each classes}}{{name}} {{level}}{{#unless @last}}, {{/unless}}{{/each}}
___
- **Casting Time** {{castTime}}
- **Components** {{components}}
- **Range** {{range}}{{#if area}} {{this}}{{/if}}
- **Effect** {{effect}}
- **Duration** {{duration}}
{{#if savingThrow}}
- **Saving Throw** {{this}}
{{/if}}
{{#if resistance}}
- **Spell Resistance** {{this}}
{{/if}}
{{! Description is handled this way in case description is a list or a single value}}
{{#description}}
{{this}}
{{/description}}
.yaml
Example:
---
templateItem: spell-block
---
name: Acid Splash
source: PRPG Core Rulebook pg. 239
school: conjuration (creation) [acid]
classes:
- name: arcanist
level: 0
- name: inquisitor
level: 0
- name: magus
level: 0
- name: sorcerer
level: 0
- name: summoner
level: 0
- name: summoner (unchained)
level: 0
- name: wizard
level: 0
last: true
castTime: 1 standard action
components:
- V
- S
range: close
area: 25 ft. + 5 ft./2 levels
effect: one missile of acid
duration: instantaneous
description: You fire a small orb of acid at the target. You must succeed on a ranged touch attack to hit your target. The orb deals 1d3 points of acid damage. This acid disappears after 1 round.
.json
Example:
{
"templateItem": "spell-block",
"name": "Acid Splash",
"source": "PRPG Core Rulebook pg. 239",
"school": "conjuration (creation) [acid]",
"classes": [
{
"name": "arcanist",
"level": 0
},
{
"name": "inquisitor",
"level": 0
},
{
"name": "magus",
"level": 0
},
{
"name": "sorcerer",
"level": 0
},
{
"name": "summoner",
"level": 0
},
{
"name": "summoner (unchained)",
"level": 0
},
{
"name": "wizard",
"level": 0,
"last": true
}
],
"casttime": "1 standard action",
"components": [
"V",
"S"
],
"range": "close",
"area": "25 ft. + 5 ft./2 levels",
"effect": "one missile of acid",
"duration": "instantaneous",
"description": "You fire a small orb of acid at the target. You must succeed on a ranged touch attack to hit your target. The orb deals 1d3 points of acid damage. This acid disappears after 1 round."
}