Skip to content

Releases: ccpgames/ccp-stencil

Version 0.8.0 - Line ending change

04 Jun 14:55
Compare
Choose a tag to compare

Changed

  • FileRenderer (and thus DirectoryRenderer) now use \n line endings in the
    resulting file. This should probably just be an option with the default being
    to preserve the line ending format of the template file, but since this is
    being used to render files that should run on Linux and apparently incorrect
    line endings mess up the shebang reading and sht like that so I'm applying
    this "sh
    t fix" for now.

Version 0.7.0 - Directory Rendering

30 May 18:27
2ee878b
Compare
Choose a tag to compare

[0.7.0] - 2024-05-30

Added

  • A new DirectoryRenderer and DirectoryTemplate to render entire directories
    of templates in one go
  • Support for {% skip_if %} and {% setfilename %} tags to control directory
    names and skipping by adding them to a file called __stencil_meta__ placed in
    any directory in a DirectoryTemplate
  • The ability to run directory rendering via command line with the -d flag

Version 0.6.1 - FileRenderer Fix

30 May 14:42
77812f0
Compare
Choose a tag to compare

Fixed

  • Issue where FileRenderer output path got truncated by one directory if the target location didn't exist

Changed

  • The FileRenderer output is now evaluated as a directory if it ends with a slash (or backslash), otherwise a file

Version 0.6.0 - SetFilename Update

30 May 13:53
fe06f12
Compare
Choose a tag to compare

[0.6.0] - 2024-05-30

Added

  • A new {% setfilename %} tag where you can set the desired filename of the
    rendered file dynamically in the tags body with normal template code e.g.
    using the template context

Changed

  • The FileRenderer can now define a directory as output location which will
    result in the rendered file to be the same as the input template file name
    (if any) unless set explicitly via the {% setfilename %} tag.

Version 0.5.1

30 May 12:24
2a12b7d
Compare
Choose a tag to compare

Version 0.5.1 - Fix to FileRenderer Loop

Fixed

  • FileRenderer was hitting an infinite loop
  • Added dynamic path extension to include cwd to enable ${__PY__:...} injecting from project roots

Version 0.5.0 - Alviss version bump

30 May 11:49
c4a9e55
Compare
Choose a tag to compare

Version 0.5.0 - Alviss version bump

Changed

  • Bumped the version requirement of Alviss to 3.3 to get support for the new
    ${__PY__:...} expressions in order to inject module versions into Alviss
    contexts for CI/CD manifests

Version 0.4.0 - The "Skip If" tag update

30 May 09:50
c03cbdb
Compare
Choose a tag to compare

Added

  • New Extension that adds a {% skip_if %} tag where you can insert any
    condition (e.g. checking the Context) and if it evals as True, a
    CancelRendering exception is raised and caught by the Renderers causing
    them to silently just skip rendering that template.
    • The StringRenderer returns None
    • The StoutRenderer prints out nothing
    • The FileRenderer doesn't create an output file
  • Added unittests for the {% skip_if %} tag

Version 0.3.0

28 May 17:40
057e7f2
Compare
Choose a tag to compare

Fixed

  • A bug in the guess_template_by_argument method that raised exceptions while
    checking to see if a given string could be interpreted as a path to an
    existing file (which should be allowed to fail silently and then the string
    returned as a StringTemplate)

Version 0.2.0 - Embedding Extension & Base64 Filter update

28 May 16:01
43e770c
Compare
Choose a tag to compare

Version 0.2.0 - Embedding Extension & Base64 Filter update

Added

  • The EmbedExtension to the Jinja2 environment used that enables using the
    {% embed 'my_file.txt' %} to embed the requested file "as-is" (so not
    parsed as a template or anything like that) into templates wholesale with
    these optional arguments:
    • indent (default: 0) to indent each line of the embedded file by a certain
      number of spaces, e.g. for embedding into YAML files, where indent is
      syntactically important
    • alviss (default: False) to run the embedded file though the Alviss
      "render_loader" before embedding the results
    • env (default: False) to make the Alviss parser render ${__ENV__:...}
      expressions
    • fidelius (default: False) to make the Alviss parser render
      ${__FID__:...} expressions
  • The main use case here was considered things like creating Kubernetes File
    Config maps where e.g. config file content is embedded wholesale into the
    manifest's YAML
  • The base64 filter to the Jinja2 environment used to quicly encode context
    variables as base64 encoded strings
    • The main use case here was considered things like rendering of Kubernetes
      Secret manifests where keys need to be base64 encoded
  • A bunch of "proper" unittests for the new embedding and filter functions

Changed

  • The FileTemplate now uses the Jinja2 environment's FileSystemLoader,
    pre-seeded with search paths of the current working directory (os.getcwd())
    as well as the root directory of the script being executed (sys.argv[0])
    plus whatever paths are defined in the STENCIL_TEMPLATE_PATH environment
    variable, if any (multiple paths seperated by ;)

Version 0.1.0 - Initial Build

24 May 18:43
3247d82
Compare
Choose a tag to compare
  • Giving this a spin