class
Can::CLI::Render
- Can::CLI::Render
- Reference
- Object
Overview
Implements the can-render executable.
The CLI renders one .can file by generating a small Crystal program,
compiling it with crystal run, and writing the rendered HTML to stdout
or an output file. It is public so shard users can wrap the same behavior
from their own command-line tools without shelling out to bin/can-render.
Defined in:
can/cli/render.crConstructors
-
.new(argv : Array(String), can_require : String, can_source_dir : String)
Creates a renderer command.
Class Method Summary
-
.run(argv : Array(String), can_require : String, can_source_dir : String) : Int32
Runs the CLI with
argvand returns a process-style exit code.
Instance Method Summary
-
#run : Int32
Parses options, renders the requested template, and returns an exit code.
Constructor Detail
Creates a renderer command.
Most callers should use .run; the constructor stays public for tests
and custom wrappers that want to instantiate before invoking #run.
Class Method Detail
Runs the CLI with argv and returns a process-style exit code.
can_require is the generated program's require target for Can, and
can_source_dir is prepended to CRYSTAL_PATH for the nested compiler.