Skip to content
axunonb edited this page Feb 27, 2022 · 2 revisions

a) Available NuGet Packages

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 for Newtonsoft.Json variables
  • SmartFormat.Extensions.System.Text.Json - An ISource extension for System.Text.Json variables
  • SmartFormat.Extensions.Time - The formatter for DateTime, DateTimeOffset and TimeSpan variables
  • SmartFormat.Extensions.Xml - Brings the ISource extension for XElement variables, and a formatter for XElements

c) The 'SmartFormat' NuGet Package

SmartFormat is the core package. It comes with the most frequently used extensions built-in:

i. Source extensions:

  • GlobalVariablesSource
  • PersistentVariablesSource
  • StringSource ✔️
  • ListFormatter (implementing ISource) ✔️
  • DictionarySource ✔️
  • ValueTupleSource ✔️
  • ReflectionSource ✔️
  • DefaultSource ✔️
  • KeyValuePairSource ✔️

ii. Formatter extensions:

  • ListFormatter (implementing IFormatter) ✔️
  • 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.

Clone this wiki locally