
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
== Stencil === Free text templating system
Stencil is a templating system designed with a free text target in mind, and built around encouraging a separation of concerns. To that end, Stencil templates don't embed arbitrary Ruby, don't assume their output will be HTML, CSS or XML, and don't use any Ruby variable as a source.
Admittedly, the goals and design of Stencil are probably idiosyncratic, but they do reflect needs I had, and I figured someone else might want something similar.
Stencil is structured around data supplied in the form of hashes and arrays. Data is referenced using a reasonably compact (even terse) path. Recognizing that usually, data comes from disparate sources, there's a module that can be included into an object to smoothly extract a view or subview suitable for rendering.
Once views have been extracted, there's an RSpec matcher 'has_subview' that allows the details of a view to be tested easily.
Stencils directives are defined using a reasonably straightforward sub-classing design, and it's my experience that it's reasonably painless to add new directives.
Stencil also provides dynamic templates, that allow for output like JSON or XML from hashes and arrays. They can be applied within a normal template.
Stencil provides a number of pretty straightforward directives:
Some oddball directives, available by inclusion only,
Stencil allows whitespace between the directive delimiters ([; ;]) and the directives themselves, which means that templates can be laid out more readably without wrecking the layout of the final output. (e.g. [; if true ;])
The directive delimiters were chosen first because they don't collide with any output I could think of, are easy to parse, an are quick to type. The end-of-block code: [;/;] is typed all without modifier (no shift) with one hand. It might sound weird, but I've come to really like it.
Templates can be defined in strings, or loaded from a path.
FAQs
Unknown package
We found that Stencil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.