-
-
Notifications
You must be signed in to change notification settings - Fork 104
Installation
axunonb edited this page Feb 27, 2022
·
2 revisions
SmartFormat comes with the following packages:
- SmartFormat.NET - includes all SmartFormat extensions listed below.
- SmartFormat - The "Core" package
- SmartFormat.Extensions.Newtonsoft.Json - An
ISource
extension forNewtonsoft.Json
variables - SmartFormat.Extensions.System.Text.Json - An
ISource
extension forSystem.Text.Json
variables - SmartFormat.Extensions.Time - The formatter for
DateTime
,DateTimeOffset
andTimeSpan
variables - SmartFormat.Extensions.Xml - Brings the
ISource
extension forXElement
variables, and a formatter forXElement
s
SmartFormat is the core package. It comes with the most frequently used extensions built-in:
i. Source extensions:
GlobalVariablesSource
PersistentVariablesSource
-
StringSource
✔️ -
ListFormatter
(implementingISource
) ✔️ -
DictionarySource
✔️ -
ValueTupleSource
✔️ -
ReflectionSource
✔️ -
DefaultSource
✔️ -
KeyValuePairSource
✔️
ii. Formatter extensions:
-
ListFormatter
(implementingIFormatter
) ✔️ -
PluralLocalizationFormatter
✔️ -
ConditionalFormatter
✔️ -
IsMatchFormatter
✔️ -
NullFormatter
✔️ LocalizationFormatter
TemplateFormatter
-
ChooseFormatter
✔️ -
SubStringFormatter
✔️ -
DefaultFormatter
✔️
Note: Extensions marked (✔️) are included when calling Smart.CreateDefaultFormatter(...)
and also when using Smart.Format(...)
.
Some extensions (like PersistentVariablesSource
and TemplateFormatter
) require configuration to be useful.
- 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