-
-
Notifications
You must be signed in to change notification settings - Fork 105
Home
axunonb edited this page Feb 6, 2022
·
110 revisions
SmartFormat is a lightweight text templating library written in C#.
It can format various data sources into a string with a minimal, intuitive syntax similar to string.Format.
SmartFormat uses extensions to provide named placeholders, localization, pluralization, gender conjugation, and list and time formatting.
Custom source or formatter extensions can be added easily using simple interfaces.
A very simplistic example:
var data = new { Library = "SmartFormat"};
_ = Smart.Format("Composed with {Library}.", data);
// Result: "Composed with SmartFormat."
- Syntax, Terminology
- Placeholders and Nesting
- string.Format Compatibility
- Character Literals in Format Strings
- HTML With CSS or JavaScript
- Data Source Extensions
- Default _ DefaultFormatter
- Lists _ ListFormatter
- Choose _ ChooseFormatter
- Condition _ ConditionalFormatter
- Null _ NullFormatter
- SubString _ SubStringFormatter
- RegEx _ IsMatchFormatter
- Pluralization _ PluralLocalizationFormatter
- Localization _ LocalizationFormatter
- Templates _ TemplateFormatter
- TimeSpan _ TimeFormatter
- XML _ XElementFormatter
- Extension Methods
- Home
- Common Pitfalls
- HTML with CSS or JavaScript
- Overview
- Main Features
- Formatters
- Extra Features
- Console and StringBuilder
- TemplateFormatter
- SmartSettings to control Smart.Format behavior
- Additional Info
- License