Skip to content

Welcome to Sailfish Documentation!

Sailfish is a simple, small, and extremely fast template engine for Rust. This documentation guides you how to get started with sailfish.

This documentation mainly focuses on concepts of the library, general usage, and template syntax. If you've read this documentation and need more specific information, you might want to read the sailfish API docs.

Why Sailfish ?

There are many libraries for template rendering in Rust. Among those libraries, sailfish aims at rapid development and rapid rendering. Sailfish has many features that other libraries might not support.

  • Write a Rust code directly inside templates, supporting many Rust syntax (struct definition, closure, macro invocation, etc.)
  • Built-in filters
  • Minimal dependencies (<15 crates in total)
  • Extremely fast (See benchmarks)
  • Template rendering is always type-safe because templates are statically compiled.
  • Syntax highlighting (vscode, vim)

Upcoming features

Since sailfish is on early stage of development, there are many upcoming features that is not supported yet. You can find many RFCs in my repository. These RFC include:

  • Template trait (which does not consume itself)
  • Template inheritance (block, partials, etc.)

If you have any idea about them or want to implement that feature, please send a comment on the issue!

License

Copyright © 2020 Ryohei Machida

This project is MIT licensed