ventojs / vento

🌬 A template engine for Deno & Node
https://vento.js.org/
MIT License
203 stars 12 forks source link

Vento CLI #57

Closed n18l closed 6 months ago

n18l commented 6 months ago

Hey there! I just stumbled on Vento while looking for an alternative to pug, which has gone unmaintained for a bit too long for my taste. I really like what I've been able to do with Vento so far!

My use case calls for a template engine I can utilize via the command line. I've cobbled a rough CLI script for Vento using Commander to use within my project. As a sample:

$ node src/scripts/utils/compile-vento -h
Usage: compile-vento [options] <templateFile>

Compile a Vento template to HTML.

Arguments:
  templateFile           The Vento template file to compile to HTML

Options:
  -v, --version          Output the current version
  -f, --dataFile <file>  Set the data file to use during compilation
  -o, --output [file]    Set the output location of the compiled Vento template (default: "stdout")
  -h, --help             Display command help

Obviously it's only handling the basics for now, since that's all I need. But I wanted to ask if this fits with your vision for Vento generally. If so, I'd be happy to try and put together a PR, or set you loose to do it yourself if this sparks any interest in you.

oscarotero commented 6 months ago

I didn't test it, but I think this project does what you need: https://github.com/mattvr/dgen

If it doesn't work for you and you want to work on a PR, that's great. But since the code is written in Deno, I'd prefer to use a Deno native library for CLI.

n18l commented 6 months ago

Makes perfect sense. I'll check out dgen, and if I find at some point there's still value in submitting a PR, I'll make sure it's only using Deno modules (like Cliffy or similar).