{"id":13629650,"url":"https://github.com/NeVeSpl/NSourceGenerators","last_synced_at":"2025-04-17T09:35:29.035Z","repository":{"id":203161359,"uuid":"707305196","full_name":"NeVeSpl/NSourceGenerators","owner":"NeVeSpl","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-09T11:44:54.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-22T04:33:51.105Z","etag":null,"topics":["roslyn"],"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/NeVeSpl.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-19T16:13:09.000Z","updated_at":"2024-06-22T16:43:11.948Z","dependencies_parsed_at":null,"dependency_job_id":"6d69e6e8-07ef-4e7c-a3c7-182dc1e89d3b","html_url":"https://github.com/NeVeSpl/NSourceGenerators","commit_stats":null,"previous_names":["nevespl/nsourcegenerators"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeVeSpl%2FNSourceGenerators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeVeSpl%2FNSourceGenerators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeVeSpl%2FNSourceGenerators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeVeSpl%2FNSourceGenerators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeVeSpl","download_url":"https://codeload.github.com/NeVeSpl/NSourceGenerators/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751334,"owners_count":17196615,"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":["roslyn"],"created_at":"2024-08-01T22:01:15.691Z","updated_at":"2024-11-08T20:31:34.208Z","avatar_url":"https://github.com/NeVeSpl.png","language":"C#","funding_links":[],"categories":["Do not want to test 113 ( old ISourceGenerator )"],"sub_categories":["1. [ThisAssembly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ThisAssembly) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category"],"readme":"# NSourceGenerators\n\n## NSourceGenerators.CodeToString\n\n[![Nuget](https://img.shields.io/nuget/v/NSourceGenerators.CodeToString?color=%23004880\u0026label=NSourceGenerators.CodeToString)](https://www.nuget.org/packages/NSourceGenerators.CodeToString)\n\n\nRoslyn source generator that turns c# source code decorated with `[CodeToString]` atribute into a string literal.\n\n- `[CodeToString]` attribute can be placed on: classes, structs and methods\n- access to generated string representation is provided through static method: `CodeToStringRepo.GetText(\"key\")`\n- generated code uses raw string literals ``` that were introduced in C# 11\n- user can provide custom keys, if not provided, full symbol name with namespace is used as a key\n### Demo\n\nA simple console app, that writes its own code to console output:\n\nInput\n```csharp\nusing NSourceGenerators;\n\nnamespace CodeToString.Sample\n{\n    [CodeToString]\n    partial class Program\n    {\n        [CodeToString(\"MainKey\")]       \n        static void Main(string[] args)\n        {\n            var programCode = CodeToStringRepo.GetText(\"CodeToString.Sample.Program\");\n            Console.WriteLine(programCode);\n\n            var mainCode = CodeToStringRepo.GetText(\"MainKey\");\n            Console.WriteLine(mainCode);\n        }        \n    }\n}\n```\nOutput\n```\n    partial class Program\n    {\n        [CodeToString(\"MainKey\")]\n        static void Main(string[] args)\n        {\n            var programCode = CodeToStringRepo.GetText(\"CodeToString.Sample.Program\");\n            Console.WriteLine(programCode);\n\n            var mainCode = CodeToStringRepo.GetText(\"MainKey\");\n            Console.WriteLine(mainCode);\n        }\n    }\n        static void Main(string[] args)\n        {\n            var programCode = CodeToStringRepo.GetText(\"CodeToString.Sample.Program\");\n            Console.WriteLine(programCode);\n\n            var mainCode = CodeToStringRepo.GetText(\"MainKey\");\n            Console.WriteLine(mainCode);\n        }\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeVeSpl%2FNSourceGenerators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNeVeSpl%2FNSourceGenerators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNeVeSpl%2FNSourceGenerators/lists"}