Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support template directory #12

Closed
ccremer opened this issue Feb 21, 2021 · 3 comments
Closed

Support template directory #12

ccremer opened this issue Feb 21, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ccremer
Copy link

ccremer commented Feb 21, 2021

Currently, each template override has to be explicitly configured with --overrides name=file, e.g.

go run github.com/mariotoffia/goasciidoc -o godoc.adoc -r import=docs/godoc-templates/import.tpl -r var=docs/godoc-templates/var.tpl

But it would be helpful if we can specify a template directory, and use the file basename as the name for *.tpl files, e.g.

$ ls docs/godoc-templates 
import.tpl  var.tpl

A file named var.tpl would provide a name for the var template (compare with var=... above)

go run github.com/mariotoffia/goasciidoc -o godoc.adoc --template-dir docs/godoc-templates

at the moment, I have to construct each individual argument like this:

$ for file in $(find docs/godoc-templates/*.tpl); do name="$(basename ${file%.*})" && printf "%s %s=%s" '-r' $name $file; done && printf '\n'
-r import=docs/godoc-templates/import.tpl -r var=docs/godoc-templates/var.tpl

which works, but isn't exactly pretty

@mariotoffia
Copy link
Owner

Hi @ccremer and thanks for the nice suggestion. I'll put it on my todo-list (if you don't want to do a PR and add this excellent idea!)

Cheers,
Mario :)

@mariotoffia mariotoffia added the enhancement New feature or request label Feb 23, 2021
@mariotoffia mariotoffia self-assigned this Mar 19, 2021
mariotoffia added a commit that referenced this issue Mar 19, 2021
Support for --templatedir.
Fixes issue #11 and isssue #12
@mariotoffia
Copy link
Owner

@ccremer I've added support for --templatedir in v0.4.0 (see release notes / README.md).

Cheers,
Mario :)

@ccremer
Copy link
Author

ccremer commented Mar 22, 2021

Cool, many thanks :)
I'll try it out when I get some spare time.

mariotoffia added a commit that referenced this issue Mar 22, 2021
Support for --templatedir.
Fixes issue #11 and isssue #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants