slim-template/slim
67.3
Adequate · 28 September 2026
1.9k
lines of production code
Ruby
primary language
2
measurements over time
What this system is
This system is the Slim template engine, a Ruby-based tool for parsing and rendering HTML templates. It provides a command-line interface and integrates with web frameworks like Rails and Sinatra to convert Slim syntax into HTML output. The engine supports advanced features such as logic-less rendering, smart text processing, and flexible attribute handling via splats.
How it got here
2010 — Temple-based engine rewrite
7 changes.
The project underwent a fundamental architectural shift by replacing the legacy precompiler with a modern Temple-based engine, introducing new parsing pipelines and Rails integration. This period also involved establishing the initial repository structure, updating dependencies to require Ruby 2.5+, and cleaning up obsolete test infrastructure to support the new design.
2011 — Rails integration test scaffolding
7 changes.
This period focused on establishing a comprehensive Rails test application to support the gem's test suite. The work involved creating the necessary directory structure, configuration files, and dummy controllers to facilitate integration testing. It also included adding specific Slim view templates and test fixtures to verify various rendering scenarios and features.
2012–2019 — Logic-less mode and test suite expansion
12 changes.
This period focused on rewriting the Logic Less template mode to support configurable dictionary access and lambda functions, while extracting smart text processing into a standalone plugin. A comprehensive testing infrastructure was established, including a new literate testing framework and extensive suites for core functionality, translators, and framework integrations like Sinatra and Rails.
Features
Add slimrb executable entry point
A new executable script named slimrb has been added to the bin directory. This script initializes the Ruby load path to include the library directory and invokes the Slim command-line interface, allowing users to run Slim templates directly from the command line.
bin · high confidence
Initial repository structure and documentation setup
This change establishes the foundational project structure by adding the MIT License, a comprehensive English and Japanese README, and a detailed changelog. It introduces build and development tooling via a Rakefile (migrating from Jeweler to Bundler and Rake::TestTask) and configuration files like .gitignore and .yardopts. This commit serves as the baseline for the Slim template engine, documenting its features, installation, and syntax while setting up the environment for testing and documentation generation.
(repo-wide) · high confidence
Behavioural changes
New Splat Builder and Filter for HTML attribute handling
The library now includes a dedicated \Slim::Splat::Builder\ and \Slim::Splat::Filter\ to manage HTML attributes passed via splats. This change introduces support for hyphenated attributes (e.g., converting underscores to hyphens in \data\ and \aria\ attributes by default), merging of duplicate attributes, sorting of attributes, and proper HTML escaping. It also handles boolean attributes correctly and integrates with Rails' \capture\ method when Slim capturing is disabled, ensuring compatibility with modern Rails versions and preventing cross-site scripting vulnerabilities in attribute names.
lib/slim/splat · high confidence
Refactored library structure and replaced precompiler with Temple-based engine
The Slim library has been restructured to replace the legacy precompiler with a new engine built on Temple and Tilt. This change updates the core loading mechanism, removing the old \slim/precompiler\ and \Slim.version\ module in favor of explicit requires for new components such as \slim/parser\, \slim/filter\, \slim/controls\, and \slim/code\_attributes\. It also introduces Rails integration via a railtie and adds support for embedded templates and smart text filters, fundamentally changing how Slim templates are parsed and rendered.
lib · high confidence
Rewrite of Logic Less mode with configurable dictionary access and lambda support
The Logic Less template mode has been rewritten to support configurable dictionary access orders (symbol, string, method, instance\_variable) via the new :dictionary\_access option, allowing users to control how variables are resolved. This change introduces support for lambda functions that can iterate over arrays and objects, enabling more complex data rendering within templates. Additionally, the mode now strictly forbids embedded code blocks to maintain its logic-less nature, raising a Temple::FilterError if such code is detected, and ensures conditionals properly check for empty states.
_lib/slim/logic\less · high confidence
Slim template engine upgraded to version 5.2.2 with a Temple-based architecture
The Slim template engine has been upgraded to version 5.2.2, replacing the legacy precompiler with a modern architecture built on the Temple library. This change introduces a new filter pipeline (including \CodeAttributes\, \Controls\, \Embedded\, and \Smart\ text processing) that improves parsing, attribute handling, and embedded engine support. The command-line interface (\slimrb\) has been updated to support new options like \--trace\, \--erb\ for ERB conversion, and \--rails\ for Rails-specific code generation. Additionally, the Rails integration now uses \Temple::Generators::RailsOutputBuffer\ to properly support block capturing and streaming, and the engine now defaults to HTML5 mode with improved smart text and interpolation features.
lib/slim · high confidence
Smart text processing moved to standalone plugin with configurable escaping
Smart text features (newline handling, entity escaping, and implicit text parsing) have been extracted from the core Slim parser into a new \Slim::Smart\ namespace. This change introduces a new \smart\_text\_escaping\ option that allows users to disable automatic HTML entity escaping in smart text blocks, and a new \implicit\_text\ option to control whether implicit text shortcuts are recognized. The smart text logic now operates on \\[:slim, :text, type\]\ expressions rather than \\[:slim, :smart\]\ blocks, providing more granular control over text processing behavior.
lib/slim/smart · high confidence
Test coverage
Added Rails integration test configuration; Added Rails integration tests for Slim template rendering; Added Rails test application scaffolding; Added Slim view templates for Rails integration tests; Added literate test suite for Slim templates; Added manifest.js for Sprockets 4+ compatibility; Added test coverage for logic-less mode; Added test environment configuration for the Rails dummy application; Added test fixtures for Entry model and edit view; Added test fixtures for Rails controller rendering scenarios; Added test layout templates for Rails view variants; Added test suite for Slim template integration; Added tests for smart text recognition and escaping; Added tests for the Slim include directive; Added tests for the Slim translator; Comprehensive test suite for core Slim template functionality; Removal of legacy test infrastructure; Removed legacy Slim test files.
Dependencies
Update runtime dependencies and add development tooling
The Slim template engine now requires Temple \~\> 0.10.0 and Tilt \>= 2.1.0 at runtime, with a minimum Ruby version of 2.5.0. Development dependencies have been added to support testing and documentation, including Minitest \~\> 5.15, Rake \~\> 13.3, Asciidoctor \~\> 2.0, Kramdown \~\> 2.5, Logger \~\> 1.7, and Ostruct \~\> 0.6. The project also introduces environment-variable-driven flexibility in its Gemfile to test against specific versions or master branches of Temple, Tilt, Rails, and Sinatra.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 67 → 67 (+0.0)
- Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.
Lenses
- Code Health 96 → 96 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 59 → 59 (+0.0)
- Readiness 55 → 55 (+0.0)
- Security 100 → 100 (+0.0)
Resolved (2)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
New (3)
- Ambiguous distinction between on_slim_text and on_slim_text_inline. The signatures differ only by the type parameter in the first method. It is unclear if type is a discriminator for block vs inline text, or if on_slim_text_inline is a specialized override. This suggests a potential duplication of intent or unclear state management.
- Inconsistent naming for the primary entry point method. While call is common in Ruby for callable objects, Parser uses call(str) while other components like Engine also use call. However, Parser.initialize takes opts while Engine does not have a visible constructor in the list (or it's implicit). More critically, Slim.Parser.call takes a str (string), whereas Slim.Engine.call takes input (likely a string or IO). This is minor, but the lack of a unified parse or render verb across the board (some use call, some use run in Command) is slightly inconsistent.
- Inconsistent parameter handling for attribute setting. code_attr takes an explicit escape boolean, while attr does not. It is unclear if attr assumes a default escape behavior or if it is for non-escaped attributes, creating ambiguity in how to correctly set attributes.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
slim-template/slim was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 87c68214f1346deadaf371bca0c78a94ece885a5 — the exact code this score is about.
- Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.