khnum 0.2.0 copy "khnum: ^0.2.0" to clipboard
khnum: ^0.2.0 copied to clipboard

Khnum HTML templates for pure Dart servers with layouts, includes, components, and safe escaping.

0.2.0 #

  • Made conditions and boolean operators require bool instead of applying loose truthiness.
  • Added explicit null-aware ?. and ?[...] access plus postfix !.
  • Replaced PHP-shaped loops with @for (final item in items) and explicit map iteration through .entries.
  • Made raw map keys use brackets while dot access exposes Dart collection properties.
  • Added function() for registered Dart functions; helper() is deprecated until 0.3.0.
  • Missing variables and keys now always throw. Removed legacy loop and @unless syntax.

0.1.0 #

Initial release.

  • File-based templates with nested directories, development reload on file change, in-memory cache in production.
  • {{ }} escaped output, {!! !!} raw output, HtmlString, json() helper safe for <script>.
  • Restricted expression language: literals, member and index access, arithmetic, comparison, logic, ??, ?:, helper calls.
  • @if/@elseif/@else, @unless, @foreach with key => value and a loop variable, @for.
  • Layouts: @extends, @section, @yield with default, @parent, @show, inline sections.
  • @include with scope sharing and data override.
  • Anonymous components: attributes, :bound attributes, interpolated attributes, slot, named slots, @props, attributes bag with merge.
  • Extensibility: helper(), directive(), resolve<T>(), share(), custom TemplateLoader.
  • Errors carry template name and line; path traversal and recursion are rejected.
0
likes
150
points
44
downloads

Documentation

API reference

Publisher

verified publishergaitco.com

Weekly Downloads

Khnum HTML templates for pure Dart servers with layouts, includes, components, and safe escaping.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

path

More

Packages that depend on khnum