{"id":22979676,"url":"https://github.com/verticalsoftware/vertical-templatestring","last_synced_at":"2025-04-02T09:16:27.717Z","repository":{"id":267883961,"uuid":"823175513","full_name":"verticalsoftware/vertical-templatestring","owner":"verticalsoftware","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-02T16:33:39.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-08T00:28:16.574Z","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/verticalsoftware.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":"2024-07-02T14:29:56.000Z","updated_at":"2024-07-02T16:33:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"566904ac-a641-4e47-893f-41942e97ef43","html_url":"https://github.com/verticalsoftware/vertical-templatestring","commit_stats":null,"previous_names":["verticalsoftware/vertical-templatestring"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verticalsoftware%2Fvertical-templatestring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verticalsoftware%2Fvertical-templatestring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verticalsoftware%2Fvertical-templatestring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verticalsoftware%2Fvertical-templatestring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verticalsoftware","download_url":"https://codeload.github.com/verticalsoftware/vertical-templatestring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785485,"owners_count":20833497,"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-12-15T01:33:18.693Z","updated_at":"2025-04-02T09:16:27.711Z","avatar_url":"https://github.com/verticalsoftware.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vertical-templatestring\n\nReplaces interpolation holes in strings with values from a dictionary, where the template is defined a _runtime_.\n\n## Overview\n\nThe `TemplateString` class is a factory that accepts a dictionary of properties, and efficiently replaces tokens in a template to create an output. The template is specified at runtime using \"handlebar\" notation.\n\n```csharp\nusing Vertical.Text;\n\nvar templateString = TemplateString.Create(\"{filename}.{format}[.{compression}]\");\nvar properties = new Dictionary\u003cstring, object?\u003e\n{\n    [\"filename\"] = \"output\",\n    [\"format\"] = \"json\",\n    [\"compression\"] = \"gz\"\n};\n\nConsole.WriteLine(templateString.Replace(properties));\n\n// Output:\n//    output.json.gz\n\nproperties[\"compression\"] = null;\n\nConsole.WriteLine(templateString.Replace(properties));\n\n// Output:\n//    output.json\n```\n\n## Configuration notes\n\n- Properties that are always supplied as non-null values can be defined using braced handlebars.\n- Properties that the application may supply with `null` values must be defined using bracketed handlebars, otherwise the template will throw an exception during the replacement operation.\n- Content inside bracketed handlebars will only be part of replacement strings if a braced handlebar within it has a non-`null` value.\n- A bracketed handlebar is ignored as a template if it doesn't contain a braced handlebar.\n- Braced handlebars can be ignored using double-brace escaping, e.g. `{{escape}}`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverticalsoftware%2Fvertical-templatestring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverticalsoftware%2Fvertical-templatestring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverticalsoftware%2Fvertical-templatestring/lists"}