SmartFormat
SmartFormat copied to clipboard
A lightweight text templating library written in C# which can be a drop-in replacement for string.Format
I introduced a small bug in my last PR. The plurals formatter will now also consider bools which changes the behaviors when it is using auto detect. This was causing...
If I want to use both SmartFormat and original ZString packages I get a conflict because the same types are defined in both assemblies. This is due to the inlining...
Add a math formatter extensions that allows the following: ```CSharp Smart.Default.FormatterExtensions.Add(new MathFormatter()); var data = new { Arg1 = 3, Arg2 = 4 }; _ = Smart.Format("{:M():({Arg1} + {Arg2}) *...
I'm trying to reproduce a weird exception I'm occasionally seeing on logs. Somehow it complains about a missing bracket, but clearly there's nothing missing.  This is on version 3.2.2
Makes eliminated packages where they can be provided by the framework by using conditions and added net 6 to STJ so that it can also become optional. Closes #380
**Is your feature request related to a problem? Please describe.** I want to minimise dependencies in my project by utilising framework dependencies wherever possible **Describe the solution you'd like** I...
Hello, i'm updating my SmartFormat package from version 2 to version 3. Try this example in console app : ```csharp Toto toto = new Toto(); toto.strings.Add("a"); toto.strings.Add("b"); Console.WriteLine(SmartFormat.Smart.Format("{strings.Count:plural:aaa|bbb}", toto)); Console.WriteLine(SmartFormat.Smart.Format("{strings.Count:p:aaa|bbb}",...
Closes #425 ### Changes to `ReflectionSource` * Modified `ReflectionSource.TypeCache` to be static, shared across all instances. * Implemented a control mechanism for the size of `ReflectionSource.TypeCache`. When the cache exceeds...
@karljj1 Are these variables **not** `static` by mistake? Can't remember a reason to make them instance variables 😉. Can you help me out? https://github.com/axuno/SmartFormat/blob/421c7155b47d8e819a0a75a392f2b19f2c56e7bd/src/SmartFormat/Extensions/ReflectionSource.cs#L32 https://github.com/axuno/SmartFormat/blob/421c7155b47d8e819a0a75a392f2b19f2c56e7bd/src/SmartFormat/Extensions/DictionarySource.cs#L82
Add `ISpanFormattable.TryFormat(Span, out int, ReadOnlySpan, IFormatProvider)` for targets NET6.0 and later. Main candidate is `DefaultFormatter`.