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
197 stars 40 forks source link

[FR]: Include images in adventure/book export #147

Closed Schmiggolas closed 1 year ago

Schmiggolas commented 1 year ago

Hey, as the title suggests I think it would be cool if exported adventures and books included images in them.

Since most adventures contain maps of some kind and you kind of need them to play (since the book actually references locations on the maps) you would need to manually add them to every adventure page after it has been exported for the exported markdown to be useful.

Is this something that you would consider implementing or can you already do this with the templating engine?

ebullient commented 1 year ago

Working on it. Templates won't be able to handle these well, as they're inline with the text.

Schmiggolas commented 1 year ago

That was fast. Thanks!

ebullient commented 1 year ago

Resolved by 43867ad3e9aa2d5f26c59575db2e470243969547

Try the snapshot? https://github.com/ebullient/ttrpg-convert-cli#use-java-jar

Schmiggolas commented 1 year ago

I will once I've got the time to do so. Thanks a bunch!

ebullient commented 1 year ago

Will wait for your feedback to close. =)

mclearc commented 1 year ago

I just rebuilt and pulled some books. Looks amazing! πŸ₯³ Thank you!! πŸ™

ebullient commented 1 year ago

Note additional admonition type (gallery) here:

https://github.com/ebullient/ttrpg-convert-cli/blob/4bbec3aca77c9e2ee8f2ce0bc3b0e33f1955f05e/examples/admonitions-5e.json

And updated styles for center/right/gallery: https://github.com/ebullient/ttrpg-convert-cli/blob/main/examples/css-snippets/dnd5e-compendium.css

Schmiggolas commented 1 year ago

Unfortunately the cli crashes for me when running it with my setup that worked before. Looks like it breaks while while processing the images in my template. I included the log and one of the templates that causes the crash below.

Before updating to the snapshot version I was running 2.01, just FYI.

Exception

``` io.quarkus.qute.TemplateException at io.quarkus.qute.CompletedStage.get(CompletedStage.java:48) at io.quarkus.qute.MultiResultNode.process(MultiResultNode.java:20) at io.quarkus.qute.MultiResultNode.process(MultiResultNode.java:20) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.lambda$renderData$5(TemplateImpl.java:233) at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883) at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251) at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:143) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderData(TemplateImpl.java:227) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderAsyncNoTimeout(TemplateImpl.java:218) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.render(TemplateImpl.java:143) at dev.ebullient.convert.io.Templates.render(Templates.java:69) at dev.ebullient.convert.io.Templates_ClientProxy.render(Unknown Source) at dev.ebullient.convert.io.MarkdownWriter.doWrite(MarkdownWriter.java:86) at dev.ebullient.convert.io.MarkdownWriter.writeFiles(MarkdownWriter.java:66) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeFiles(Json2MarkdownConverter.java:85) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeAll(Json2MarkdownConverter.java:34) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeAll(Json2MarkdownConverter.java:22) at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:230) at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:39) at picocli.CommandLine.executeUserObject(CommandLine.java:2041) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461) at picocli.CommandLine$RunLast.handle(CommandLine.java:2453) at picocli.CommandLine$RunLast.handle(CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273) at picocli.CommandLine$RunLast.execute(CommandLine.java:2417) at dev.ebullient.convert.RpgDataConvertCli.executionStrategy(RpgDataConvertCli.java:239) at picocli.CommandLine.execute(CommandLine.java:2170) at dev.ebullient.convert.RpgDataConvertCli.run(RpgDataConvertCli.java:259) at dev.ebullient.convert.RpgDataConvertCli_ClientProxy.run(Unknown Source) at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:130) at io.quarkus.runtime.Quarkus.run(Quarkus.java:71) at io.quarkus.runtime.Quarkus.run(Quarkus.java:44) at io.quarkus.runner.GeneratedMain.main(Unknown Source) Caused by: io.quarkus.qute.TemplateException: Rendering error: Property "title" not found on the base object "dev.ebullient.convert.qute.ImageRef" in expression {first.title} at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169) at io.quarkus.qute.EvaluatorImpl.propertyNotFound(EvaluatorImpl.java:247) at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:201) at io.quarkus.qute.EvaluatorImpl.lambda$resolve$4(EvaluatorImpl.java:211) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:208) at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:128) at io.quarkus.qute.EvaluatorImpl.lambda$resolveReference$2(EvaluatorImpl.java:132) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:132) at io.quarkus.qute.EvaluatorImpl.evaluate(EvaluatorImpl.java:87) at io.quarkus.qute.ResolutionContextImpl$ChildResolutionContext.evaluate(ResolutionContextImpl.java:87) at io.quarkus.qute.ExpressionNode.resolve(ExpressionNode.java:34) at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:223) at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:56) at io.quarkus.qute.SetSectionHelper.lambda$resolve$1(SetSectionHelper.java:49) at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883) at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251) at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:143) at io.quarkus.qute.SetSectionHelper.resolve(SetSectionHelper.java:44) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:53) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58) at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:219) at io.quarkus.qute.IfSectionHelper$SingletonContext.lambda$resolve$0(IfSectionHelper.java:68) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.IfSectionHelper$SingletonContext.resolve(IfSectionHelper.java:64) at io.quarkus.qute.IfSectionHelper.resolve(IfSectionHelper.java:45) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:53) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58) at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:223) at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:46) at io.quarkus.qute.Parser$1.resolve(Parser.java:1247) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:53) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58) ... 27 more ```

Offending Template

--- obsidianUIMode: preview cssclass: json5e-monster statblock: inline statblock-link: "#^statblock" {#if resource.tags } tags: {#for tag in resource.tags} - {tag} {/for} {/if} aliases: ["{resource.name}"] --- # {resource.name} *Source: {resource.source}* {#if resource.description } {resource.description} {#each resource.fluffImages}{#if it_index != 0 } ![{it.title}]({it.vaultPath}#center) {/if}{/each} {#else} {#each resource.fluffImages} ![{it.title}]({it.vaultPath}#center) {/each} {/if} ```statblock {resource.5eStatblockYaml} ``` ^statblock {#if resource.environment } ## Environment {resource.environment} {/if}

ebullient commented 1 year ago

Looks like it breaks while while processing the images in my template. I included the log and one of the templates that causes the crash below.

Thanks for the example template & exception. I use the same/similar field, and did not have that issue, but I'll try again to make sure.

As an aside, you'll want to double check how you're including the images & description in the template above, as I think you drop the first image if a description is present. The reference template for images tries to split things: the first image, then the description, then the rest of the images (if there is more than one).

{#if resource.description }
{#if resource.fluffImages && resource.fluffImages.size > 0 }{#let first=resource.fluffImages.get(0)}
![{first.title}]({first.vaultPath}#right)  
{/let}{/if}
{resource.description}

{#each resource.fluffImages}{#if it_index != 0 }
![{it.title}]({it.vaultPath}#center)  
{/if}{/each}
{#else}
{#each resource.fluffImages}
![{it.title}]({it.vaultPath}#center)  
{/each}
{/if}

If you want to show all images after the description, you can simplify:

{#if resource.description }
{resource.description}

{/if}
{#each resource.fluffImages}
![{it.title}]({it.vaultPath}#center)  
{/each}

(mess with whitespace before/after as you wish)

Schmiggolas commented 1 year ago

Thanks you for fixing my template while you're at it lol 😁

Unfortunately I still get the same error.

I removed all templates except one to narrow it down, but it still fails:

Template

--- obsidianUIMode: preview cssclass: json5e-monster statblock: inline statblock-link: "#^statblock" {#if resource.tags } tags: {#for tag in resource.tags} - {tag} {/for} {/if} aliases: ["{resource.name}"] --- # {resource.name} *Source: {resource.source}* {#each resource.fluffImages} ![{it.title}]({it.vaultPath}#center) {/each} {#if resource.description } {resource.description} {/if} ```statblock {resource.5eStatblockYaml} ``` ^statblock {#if resource.environment } ## Environment {resource.environment} {/if}

The template should be fine like that, no?

This is the full log of the tool, not just the exception. Maybe something else is broken?

Log

```  finished reading config. ÔÅ▒ Reading Y:\Repositories\5etools-tooling\5etools\data ÔÅ▒ Reading Y:\Repositories\5etools-tooling\config.json  finished reading data. Β­Ζ’ΓΆΒ© Source KftGV is unknown Β­Ζ’ΓΆΒ© Source HAT-LMI is unknown Β­Ζ’ΓΆΒ© Source MisMV1 is unknown Β­Ζ’ΓΆΒ© Source MCV3MC is unknown Β­Ζ’ΓΆΒ© Source HAT-TG is unknown ­ƒÆí Writing files to Y:\Repositories\5etools-tooling Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|sea hag|mm]: 179 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|diderius|rot]: 229 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|vampire|mm]: 297 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient emerald dragon|ftd]: 196 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|demilich|mm]: 48 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|juiblex|mpmm]: 160 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult deep dragon|ftd]: 174 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|faerie dragon (green)|mm]: 118 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|vampire spellcaster|mm]: 297 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|lich|mm]: 202 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient red dragon|mm]: 98 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult sapphire dragon|ftd]: 215 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|illithilich|vgm]: 172 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|death tyrant|mm]: 29 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|aboleth|mm]: 13 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|sea fury|egw]: 299 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient amethyst dragon|ftd]: 160 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult gold dragon|mm]: 114 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|green hag|mm]: 177 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|morkoth|mpmm]: 186 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|storm giant quintessent|mpmm]: 235 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|graz'zt|mpmm]: 148 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|yeenoghu|mpmm]: 270 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient moonstone dragon|ftd]: 212 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ki-rin|mpmm]: 162 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient dragon turtle|ftd]: 191 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient silver dragon|mm]: 117 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|gynosphinx|mm]: 281 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|faerie dragon (indigo)|mm]: 118 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|vampire warrior|mm]: 297 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|morgantha|cos]: 178 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|orcus|mpmm]: 204 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|faerie dragon (blue)|mm]: 118 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult red dragon|mm]: 98 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult brass dragon|mm]: 105 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|night hag|mm]: 178 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|drow matron mother|mpmm]: 104 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult bronze dragon|mm]: 108 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient blue dragon|mm]: 91 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|oracs the enduring|egw]: 88 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|mummy lord|mm]: 229 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|zuggtmoy|mpmm]: 281 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|faerie dragon (violet)|mm]: 118 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|baphomet|mpmm]: 58 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient bronze dragon|mm]: 108 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult blue dragon|mm]: 91 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult copper dragon|mm]: 112 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient topaz dragon|ftd]: 221 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult white dragon|mm]: 101 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|balhannoth|mpmm]: 55 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient copper dragon|mm]: 112 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient sapphire dragon|ftd]: 215 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult green dragon|mm]: 94 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|strahd von zarovich|cos]: 240 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|unicorn|mm]: 294 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|elder brain|mpmm]: 120 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult topaz dragon|ftd]: 221 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|lorry wanwillow|dsotdq]: 297 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult crystal dragon|ftd]: 171 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|zariel|mpmm]: 280 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult silver dragon|mm]: 117 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|exethanter|cos]: 202 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient white dragon|mm]: 101 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|felgolos|skt]: 108 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient black dragon|mm]: 88 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|fraz-urb'luu|mpmm]: 129 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient crystal dragon|ftd]: 171 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|runara|dosi]: 108 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|geryon|mpmm]: 136 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult red dracolich|tce]: 98 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|beholder|mm]: 28 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult amethyst dragon|ftd]: 160 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|isendraug|skt]: 101 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|demogorgon|mpmm]: 90 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|klauth|skt]: 98 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|cryovain|skt]: 101 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|karkethzerethzerus, the sable despoiler|egw]: 142 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|githzerai anarch|mpmm]: 142 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|kraken|mm]: 197 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|androsphinx|mm]: 281 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient brass dragon|mm]: 105 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|iymrith|skt]: 91 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient deep dragon|ftd]: 174 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult black dragon|mm]: 88 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult blue dracolich|mm]: 91 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult emerald dragon|ftd]: 196 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient deep crow|ai]: 211 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient gold dragon|mm]: 114 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|merrenoloth|mpmm]: 180 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|ancient green dragon|mm]: 94 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|claugiyliamatar|skt]: 94 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|slarkrethel|skt]: 197 Β­Ζ’ΓΈΓ¦ Unknown entry type in sources[monster|adult moonstone dragon|ftd]: 212 io.quarkus.qute.TemplateException at io.quarkus.qute.CompletedStage.get(CompletedStage.java:48) at io.quarkus.qute.MultiResultNode.process(MultiResultNode.java:20) at io.quarkus.qute.MultiResultNode.process(MultiResultNode.java:20) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.lambda$renderData$5(TemplateImpl.java:233) at io.quarkus.qute.CompletedStage.whenComplete(CompletedStage.java:268) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderData(TemplateImpl.java:227) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.renderAsyncNoTimeout(TemplateImpl.java:218) at io.quarkus.qute.TemplateImpl$TemplateInstanceImpl.render(TemplateImpl.java:143) at dev.ebullient.convert.io.Templates.render(Templates.java:69) at dev.ebullient.convert.io.Templates_ClientProxy.render(Unknown Source) at dev.ebullient.convert.io.MarkdownWriter.doWrite(MarkdownWriter.java:86) at dev.ebullient.convert.io.MarkdownWriter.writeFiles(MarkdownWriter.java:66) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeFiles(Json2MarkdownConverter.java:85) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeAll(Json2MarkdownConverter.java:34) at dev.ebullient.convert.tools.dnd5e.Json2MarkdownConverter.writeAll(Json2MarkdownConverter.java:22) at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:230) at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:39) at picocli.CommandLine.executeUserObject(CommandLine.java:2041) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461) at picocli.CommandLine$RunLast.handle(CommandLine.java:2453) at picocli.CommandLine$RunLast.handle(CommandLine.java:2415) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273) at picocli.CommandLine$RunLast.execute(CommandLine.java:2417) at dev.ebullient.convert.RpgDataConvertCli.executionStrategy(RpgDataConvertCli.java:239) at picocli.CommandLine.execute(CommandLine.java:2170) at dev.ebullient.convert.RpgDataConvertCli.run(RpgDataConvertCli.java:259) at dev.ebullient.convert.RpgDataConvertCli_ClientProxy.run(Unknown Source) at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:130) at io.quarkus.runtime.Quarkus.run(Quarkus.java:71) at io.quarkus.runtime.Quarkus.run(Quarkus.java:44) at io.quarkus.runner.GeneratedMain.main(Unknown Source) Caused by: io.quarkus.qute.TemplateException: Rendering error: Property "title" not found on the base object "dev.ebullient.convert.qute.ImageRef" in expression {it.title} at io.quarkus.qute.TemplateException$Builder.build(TemplateException.java:169) at io.quarkus.qute.EvaluatorImpl.propertyNotFound(EvaluatorImpl.java:247) at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:201) at io.quarkus.qute.EvaluatorImpl.lambda$resolve$4(EvaluatorImpl.java:211) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.EvaluatorImpl.resolve(EvaluatorImpl.java:208) at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:128) at io.quarkus.qute.EvaluatorImpl.lambda$resolveReference$2(EvaluatorImpl.java:132) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.EvaluatorImpl.resolveReference(EvaluatorImpl.java:132) at io.quarkus.qute.EvaluatorImpl.evaluate(EvaluatorImpl.java:87) at io.quarkus.qute.ResolutionContextImpl$ChildResolutionContext.evaluate(ResolutionContextImpl.java:87) at io.quarkus.qute.ExpressionNode.resolve(ExpressionNode.java:34) at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:223) at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:56) at io.quarkus.qute.LoopSectionHelper.nextElement(LoopSectionHelper.java:127) at io.quarkus.qute.LoopSectionHelper.lambda$resolve$0(LoopSectionHelper.java:56) at io.quarkus.qute.CompletedStage.thenCompose(CompletedStage.java:232) at io.quarkus.qute.LoopSectionHelper.resolve(LoopSectionHelper.java:45) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:53) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58) at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:223) at io.quarkus.qute.SectionHelper$SectionResolutionContext.execute(SectionHelper.java:46) at io.quarkus.qute.Parser$1.resolve(Parser.java:1247) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:53) at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58) ... 27 more ```

Also this is my config:

Details

``` { "from": [ "AAG", "AI", "CRCotN", "CoS", "DIP", "DMG", "DSotDQ", "DoSI", "EEPC", "EET", "EGW", "FTD", "KftGV", "LMoP", "MM", "MPMM", "MTF", "PHB", "RoT", "SCAG", "SKT", "SLW", "TCE", "VGM", "XGE", "SCREEN", "SCREENDUNGEONKIT", "SCREENWILDERNESSKIT" ], "paths": { "compendium": "Sources/", "rules": "Sources/rules/" }, "template": { "monster": "./templates/monster.txt" }, "convert": { "adventure": [ "DIP" ], "book": [ "DMG", "PHB", "SCAG", "TCE", "MM", "XGE", "FTD", "VGM" ] }, "useDiceRoller": true } ```

And I'm using a python script to automate everything. I'm just calling ttrpg-convert -o ./ 5etools/data/ ./config.json

run.py

```python import os from git import Repo import shutil print("Pulling 5etools repo") five_e_tools_repo = Repo("5etools") five_e_tools_repo.remotes[0].pull() print("Done") print("Deleting old sources") root = "Sources" subdirs = list() for item in os.listdir(root): joinedPath = os.path.join(root, item) if os.path.isdir(joinedPath): subdirs.append(joinedPath) for directory in subdirs: if ".git" in directory: continue shutil.rmtree(directory) print("Deleted " + directory) print("Done") print("Converting 5etools data to markdown") os.system("ttrpg-convert -o ./ 5etools/data/ ./config.json") print("Done") ```

Thank you for helping me this far. Any further help is also greatly appreciated!

//Edit: I'm running the tool through jbang (like you mentioned in your installation guide) using openjdk installed via scoop on a Windows machine. Just to complete the info-dump

ebullient commented 1 year ago

blargh. I really need to do the thing to hide emoji for terminal/command lines that can't handle them. That said, the above suggests that the snapshot is older. I fixed "Source KftGV is unknown" awhile ago. I think the jitpack build is (or was) broken.

Will push a new release shortly.

ebullient commented 1 year ago

Released.. try 2.0.2

Schmiggolas commented 1 year ago

Works like a charm! Thank you very much!