{"id":13629299,"url":"https://github.com/ignatandrei/rscg_templating","last_synced_at":"2025-08-18T07:31:56.920Z","repository":{"id":198769382,"uuid":"701454315","full_name":"ignatandrei/RSCG_Templating","owner":"ignatandrei","description":"Templating for generating everything from classes, methods from a Roslyn Code Generator","archived":false,"fork":false,"pushed_at":"2024-07-20T13:08:38.000Z","size":50,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T00:57:10.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ignatandrei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-10-06T17:05:12.000Z","updated_at":"2024-07-20T13:04:04.000Z","dependencies_parsed_at":"2023-12-20T19:40:34.703Z","dependency_job_id":"7d093f44-06b3-4f5e-9949-a43b03ee4298","html_url":"https://github.com/ignatandrei/RSCG_Templating","commit_stats":null,"previous_names":["ignatandrei/rscg_templating"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ignatandrei/RSCG_Templating","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Templating","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Templating/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Templating/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Templating/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ignatandrei","download_url":"https://codeload.github.com/ignatandrei/RSCG_Templating/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Templating/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644764,"owners_count":24621332,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:01:06.853Z","updated_at":"2025-08-18T07:31:56.677Z","avatar_url":"https://github.com/ignatandrei.png","language":"C#","funding_links":[],"categories":["Content"],"sub_categories":["69. [RSCG_Templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_Templating) , in the [Templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) category"],"readme":"# RSCG_Templating\n\nTemplating for generating everything from classes, methods from a Roslyn Code Generator\n\nTemplating is in SCRIBAN form\n\n## How to use\n\nAdd reference to \n\n```xml\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"RSCG_Templating\" Version=\"2024.720.1603\" OutputItemType=\"Analyzer\"  ReferenceOutputAssembly=\"false\"   /\u003e\n    \u003cPackageReference Include=\"RSCG_TemplatingCommon\" Version=\"2024.720.1603\" /\u003e\n  \u003c/ItemGroup\u003e\n\u003c!-- this is just for debug purposes --\u003e\n\u003cPropertyGroup\u003e\n    \u003cEmitCompilerGeneratedFiles\u003etrue\u003c/EmitCompilerGeneratedFiles\u003e\n    \u003cCompilerGeneratedFilesOutputPath\u003e$(BaseIntermediateOutputPath)\\GX\u003c/CompilerGeneratedFilesOutputPath\u003e\n\u003c/PropertyGroup\u003e\n\u003c!-- those are the templates files, see IGenerateDataFromClass --\u003e\n  \u003cItemGroup\u003e\n    \u003cAdditionalFiles Include=\"ClassTypeName.txt\" /\u003e\n    \u003cAdditionalFiles Include=\"ClassPropByName.txt\" /\u003e\n  \u003c/ItemGroup\u003e\n\n```\n\nThen add additional files , for example \n```scriban\n//autogenerated by RSCG_Templating version {{data.Version}} from file {{fileName}}\nnamespace {{data.nameSpace}} {\n\t \n\tpartial class {{data.className}} {\n\t\tpublic string MyTypeName = \"{{data.nameSpace}}.{{data.className}}\";\t\t\n\t}//end class\n\n}//end namespace\n```\n\nNow add \n\n```csharp\n//can have multiple attributes on partial classes\n[IGenerateDataFromClass(\"ClassTypeName\")]\npublic partial class Person\n```\n\n## Advanced uses\n\nFor the moment , RSCG_Templating generates definition for a class with properties + methods .\nSee example for generating enum from properties and setting properties by name\n\n```csharp\nvar x = new Person();\nConsole.WriteLine(\"The generated string type is \"+x.MyTypeName);\nx.FirstName = \"Andrei\";\n//set last name via prop\nx.SetPropValue(ePerson_Properties.LastName, \"Ignat\");\nConsole.WriteLine(\"called directly first name : \" + x.FirstName);\nConsole.WriteLine(\"called via enum of prop first name : \" + x.GetPropValue(ePerson_Properties.FirstName));\nConsole.WriteLine(\"called get property :\" + x.GetPropValue(ePerson_Properties.Name));\n```\n\nSee example at https://github.com/ignatandrei/RSCG_Templating/tree/main/src/RSCG_Templating\n\n## More templates\n\n\n10. Template for having the class type name: ClassTypeName\n20. Template for having the class properties as enum : ClassPropByName\n30. Template for setting properties after name : ClassPropByName\n40. Template from DebuggerDisplay for properties: ClassDebuggerDisplay\n50. Template for generating interface from class : ClassInterface\n\n# More Roslyn Source Code Generators\n\nYou can find more RSCG with examples at [Roslyn Source Code Generators](https://ignatandrei.github.io/RSCG_Examples/v2/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignatandrei%2Frscg_templating","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignatandrei%2Frscg_templating","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignatandrei%2Frscg_templating/lists"}