{"id":13628805,"url":"https://github.com/JKamsker/JKToolKit.TemplatePropertyGenerator","last_synced_at":"2025-04-17T04:32:27.045Z","repository":{"id":247262110,"uuid":"825412432","full_name":"JKamsker/JKToolkit.TemplatePropertyGenerator","owner":"JKamsker","description":"Generates strongly typed stringformatters based on Stringformats","archived":false,"fork":false,"pushed_at":"2024-07-09T13:27:02.000Z","size":627,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T02:59:16.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JKamsker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-07T17:39:52.000Z","updated_at":"2024-07-08T22:19:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdc54b07-7b1c-45e0-b1d7-48a75c4de89b","html_url":"https://github.com/JKamsker/JKToolkit.TemplatePropertyGenerator","commit_stats":null,"previous_names":["jkamsker/jktoolkit.templatepropertygenerator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JKamsker%2FJKToolkit.TemplatePropertyGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JKamsker%2FJKToolkit.TemplatePropertyGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JKamsker%2FJKToolkit.TemplatePropertyGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JKamsker%2FJKToolkit.TemplatePropertyGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JKamsker","download_url":"https://codeload.github.com/JKamsker/JKToolkit.TemplatePropertyGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249315989,"owners_count":21249868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:00:57.761Z","updated_at":"2025-04-17T04:32:22.029Z","avatar_url":"https://github.com/JKamsker.png","language":"C#","funding_links":[],"categories":["Content","Source Generators"],"sub_categories":["147. [JKToolKit.TemplatePropertyGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/JKToolKit.TemplatePropertyGenerator) , in the [Templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) category","Text templating"],"readme":"\u003c!-- # JKToolKit.TemplatePropertyGenerator --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets/logo/logo_small_128x128.png\"\u003e\n      \u003cimg src=\"assetss/logo/logo_small_128x128.png\" height=\"128\"\u003e\n    \u003c/picture\u003e\n    \u003ch1 align=\"center\"\u003eTemplatePropertyGenerator\u003c/h1\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.nuget.org/packages/JKToolKit.TemplatePropertyGenerator/\"\u003e\u003cimg src=\"https://img.shields.io/nuget/v/JKToolKit.TemplatePropertyGenerator\" alt=\"NuGet\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.nuget.org/packages/JKToolKit.TemplatePropertyGenerator/\"\u003e\u003cimg src=\"https://img.shields.io/nuget/dt/JKToolKit.TemplatePropertyGenerator\" alt=\"Nuget\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/JKamsker/JKToolKit.TemplatePropertyGenerator\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/JKamsker/JKToolKit.TemplatePropertyGenerator/pulls\"\u003e\u003cimg src=\"https://img.shields.io/badge/PR-Welcome-blue\" alt=\"PR\"\u003e\u003c/a\u003e\n  \u003c!-- \u003ca href=\"https://github.com/JKamsker/JKToolKit.TemplatePropertyGenerator/actions/workflows/build-test.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/JKamsker/JKToolKit.TemplatePropertyGenerator/build-test.yml?branch=master\" alt=\"GitHub Workflow Status\"\u003e\u003c/a\u003e --\u003e\n\u003c/p\u003e\n\n## Overview\n\n`TemplatePropertyGenerator` is a C# source generator that creates strongly-typed template properties from annotated classes. This allows for easy and safe string formatting by generating classes with methods to format predefined templates.\n\n## Features\n\n- Define template properties with format strings using attributes.\n- Auto-generate classes with methods to format the strings.\n- Supports FormattableString for more complex formatting needs.\n\n## How to Use\n\n1. **Install the NuGet package:**\n\n\tEnsure you have the NuGet package installed in your project. If not, you can install it via the NuGet Package Manager or the .NET CLI.\n\n\t```sh\n\tdotnet add package JKToolKit.TemplatePropertyGenerator\n\t```\n\n2. **Define your templates:**\n\n   Use the `TemplateProperty` attribute to define your template properties in a partial class. The attribute takes the name of the property and the format string as parameters.\n\n    ```csharp\n    [TemplateProperty(\"Hello\", \"Hello {value}, {value}!\")]\n    [TemplateProperty(\"FooBar\", \"Foo {value}, Bar {value}\")]\n    public static partial class Consts\n    {\n    }\n    ```\n\n3. **Use the generated code:**\n\n   Once the generator runs, it will produce a class with properties and methods to format your strings. You can use these in your code as shown below:\n\n   ```csharp\n   private static void Main(string[] args)\n   {\n       Console.WriteLine(Consts.Hello.Template); // Output: Hello {value}, {value}!\n       Console.WriteLine(Consts.Hello.Format(\"World\")); // Output: Hello World, World!\n\t   Console.WriteLine(Consts.FooBar.Format(\"Foo1\", \"Bar1\")); // Output: Foo Foo1, Bar Bar1\n   }\n   ```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue to discuss any changes or improvements.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\n- [Source Generators in .NET](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview)\n- [Microsoft Roslyn](https://github.com/dotnet/roslyn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJKamsker%2FJKToolKit.TemplatePropertyGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJKamsker%2FJKToolKit.TemplatePropertyGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJKamsker%2FJKToolKit.TemplatePropertyGenerator/lists"}