Closed Stackclash closed 1 year ago
You should only need this (the get is a bean thing and can be removed):
---
{resource.5eInitiativeYaml}
---
```statblock
{resource.5eStatblockYaml}
I do not hand-tend/hand-create the YAML. It is generated by [SnakeYAML](https://github.com/snakeyaml/snakeyaml), which will produce spec-valid YAML that your linter may not like (but that doesn't mean it isn't valid YAML).
The full 5e statblock body is double quoted YAML syntax because the trait descriptions contain all kinds of characters that can make YAML upset. There is optional type information (I have pending changes that will suppress most of those), but they are valid..
Can you let me know which linter you're using, and what it is complaining about exactly?
I was using https://yamllint.com, but it seems that might not be a good website to use, because I tried https://jsonformatter.org/yaml-validator and it validated it just fine.
I've heard mixed things about yamllint.com, so I would agree that isn't the best website. The similarly named python command line tool is a different thing, and should also be fine (IIUC, they are not related: https://stackoverflow.com/questions/38454142/yamllint-validation).
Is anything else not working right? In other words, do you have more questions or is there something that needs fixing or can we close this? 😁
I was trying to use the 5estatblock in the frontmatter, but it seems that it wasn't created for that. If that's the case we can close this.
There are two examples of using generated yaml in the document header:
Are you having issues with either of these?
The header template wasn't putting actions and other information into initiative tracker. I ended up going with the body template and giving it the frontmatter of statblock: inline
so that it was picked up by initiative tracker. Thanks for your help. We can close this.
I'm trying to get the yaml for a statblock but both of these methods don't return valid yaml. I'm not sure if I'm using it correctly. Running both of the results through a yamllint gives errors. I am using v2.0.5 of the cli.
Template
--- {resource.get5eInitiativeYaml} ---
```statblock {resource.get5eStatblockYaml} ```
Result
--- name: Beholder ac: 18 hp: 180 hit_dice: 19d10 + 76 cr: '13' stats: [ 10, 14, 18, 17, 15, 17 ] source: [ MM, ToA, WDMM, GoS, ERLW, EGW, TCE, CM, JttRC, LoX, KftGV ] ---