Do you want to strip away HTML in a string, convert BRs to NewLines and back, truncate it without stopping in the middle of an & or ä? This and more is what Razor Blade is for.
A Library for Typical Tasks
Razor Blade is a new c# library solving many trivial but common tasks in Razor Templates. The v1 release contains commands to...
- HTML / Tags tasks (detailed docs)
- Text tasks (detailed docs)
Text.First(value, value[, moreValues, ...])
These helper commands will make your templates easier to read and bullet proof, because you won't re-invent how-to-strip-html in each template.
Note that we really wanted this to be bullet-proof, so Razor Blade contains 30+ automated tests to verify edge cases, and we'll add more if any surprise still pop up.
For C#, DNN and .net Core
We built the library as a cross-platform library, so you can use it in any kind of project and also be sure that once DNN moves to .net core, Razor Blade will move with it.
Tutorials, Blogs and Documentation
To help you get started, we created all the basics you need
- Github Repo containing Razor Blade and the documentation
- DNN Install package in the releases
- Tutorial App showing code for all the commands - source in Github
- Blogs for using this are still WIP, but will be published soon
Note that you can easily install Razor Blade on any DNN or include it with your own DNN modules. 2sxc 9.40 will also include Razor Blade by default, so any Apps you develop for 2sxc 9.40+ will be able to use the features of Razor Blade 1.0.
We're currently working on future enhancements, which will cover common challenges like
- Read / Write the page title and metadata from your scripts
- Generate e-mails using Razor e-mail templates
Love from Switzerland,