rustysan-sword
Blade-inspired HTML templates for Rust. Templates are .sword.html files that Sword translates to MiniJinja, which it uses privately, and renders against serde data.
Installation
Use a local checkout until the renamed crate is published.
[]
= { = "../rustysan-sword" }
# With Laravel Rust:
# rustysan-sword = { path = "../rustysan-sword", features = ["laravel"] }
Features, none of them on by default:
laravel:rustysan_sword::laravel::SwordServiceProviderfor Laravel Rust>=0.1.0, <0.1.5.dump: development-only@dump. It also needsConfig::dump(true)and alocalortestingenvironment.
Requires Rust 1.99+, the same as Laravel Rust. Tested against Laravel Rust 0.1.0 and 0.1.4. See installation and setup.
Usage
use Sword;
use json;
let html = default.render_source?;
assert_eq!;
# Ok::
Sword::render resolves dotted names to .sword.html files under ordered template roots, resources/views by default. Guides:
- Usage: rendering, components, layouts, loops and directives
- Configuration
- Components, including typed components
- Authentication and authorization
- Environment, session and context
@dump- Tracing and async use
- Template cache
- Stacks, once and fragments
- Validation bags and loops
- Diagnostics
- Expression contract
- Laravel adapter
Testing
See all quality checks.
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md and the Rust API Guidelines.
License
MIT. See LICENSE.md.