asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
321 stars 97 forks source link

Find templates automatically under .asciidoctor/templates #843

Open lask79 opened 5 months ago

lask79 commented 5 months ago

It currently is possible to add your own template files using asciidoc.preview.templates. But the path has to be abolute.

Given that the extension already finds extensions under .asciidoctor/lib it would also be great if it also pick up templates under .asciidoctor/templates

ggrossetie commented 5 months ago

I think that's a good idea 👍🏻

ggrossetie commented 5 months ago

@ahus1 Do you think it makes sense to automatically load templates from .asciidoctor/templates?

ahus1 commented 5 months ago

Makes sense to me, I like it. Do you have an example repository somewhere to test it?

Btw, would those templates work the same way for JRuby and the JS variants of Asciidoctor?

ggrossetie commented 5 months ago

Not sure about JRuby templates. In Asciidoctor.js, we are loading files that are located in a template directory based on their name.

ahus1 commented 4 months ago

It seems to make sense for a Asciidoctor.js setup, so let's proceed. I'll then see what I need to do to make it work with AsciidoctorJ one way or another.