ebullient / ttrpg-convert-cli

Utility to convert JSON data (for content you own) from 5etools or pf2etools into Obsidian-friendly Markdown.
https://www.ebullient.dev/projects/ttrpg-convert-cli/
Apache License 2.0
185 stars 37 forks source link

Add support for Pathfinder 2e YAML statblocks #497

Open miscoined opened 2 months ago

miscoined commented 2 months ago

This is done using a new Pathfinder 2e Bestiary layout which currently has an open PR here. This is part of an overall plan to add this statblock layout natively to the Fantasy Statblocks plugin (https://github.com/javalent/fantasy-statblocks/issues/436)

Opening this as a draft PR for now until the base layout PR is done. I haven't added any documentation for this yet either - I'm currently planning to leave that til I do a full check over the documentation after all the changes I've made to the PF2e side of things so I can also catch any other documentation errors, as well as hopefully add auto-generation of documentation for the template extension methods.

The main structural change here is the addition of a new template resource boolean: asYamlStatblock, which is defined for embedded templates only and is used to determine whether it's being rendered within a YAML statblock. I specifically wanted a way for template authors to customize the YAML output themselves and this seemed like the best tradeoff between functionality and not totally reworking how parsing and rendering works.