{"id":27131890,"url":"https://github.com/jkmnt/vscode-python-fstring-dsl","last_synced_at":"2026-04-29T01:33:59.092Z","repository":{"id":245019923,"uuid":"816918224","full_name":"jkmnt/vscode-python-fstring-dsl","owner":"jkmnt","description":"Syntax highlighting for HTML, SQL, JS, CSS in Python f-strings","archived":false,"fork":false,"pushed_at":"2024-07-15T13:10:18.000Z","size":505,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T21:44:49.323Z","etag":null,"topics":["f-string","html","python","sql","syntax-highlighting","vscode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jkmnt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-06-18T16:40:44.000Z","updated_at":"2024-07-15T13:10:21.000Z","dependencies_parsed_at":"2026-01-29T09:03:47.997Z","dependency_job_id":null,"html_url":"https://github.com/jkmnt/vscode-python-fstring-dsl","commit_stats":null,"previous_names":["jkmnt/vscode-python-fstring-dsl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jkmnt/vscode-python-fstring-dsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmnt%2Fvscode-python-fstring-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmnt%2Fvscode-python-fstring-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmnt%2Fvscode-python-fstring-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmnt%2Fvscode-python-fstring-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkmnt","download_url":"https://codeload.github.com/jkmnt/vscode-python-fstring-dsl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkmnt%2Fvscode-python-fstring-dsl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32407164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["f-string","html","python","sql","syntax-highlighting","vscode"],"created_at":"2025-04-07T21:40:49.957Z","updated_at":"2026-04-29T01:33:59.072Z","avatar_url":"https://github.com/jkmnt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-python-fstring-dsl\n\nVSCode syntax highlighting for HTML, SQL, JS, CSS in Python f-strings\n\n## Usage\n\nThe syntax highlighting is triggered by wrapping the DSL-string in a\nspecific function call:\n\n- `html(...)`\n- `sql(...)`\n- `js(...)`\n- `css(...)`\n\nThis function may be a noop like the Python's `typing.cast()`. Perhaps it could do something useful, e.g. trimming whitespaces or logging.\n\nIf the string is the template (f-string), the internal f-expressions will be syntax highlighted too.\n\n## Sample\n\n![sample.png](https://raw.githubusercontent.com/jkmnt/vscode-python-fstring-dsl/main/sample.png)\n\nThis sample shows the well-typed server-side Dialog component with\nbootsrap styling, htmx magic, and text escaping.\n\n## Configuration\n\nThe trigger functions names may be configured to suit your project.\nNavigate to **Highlight f-strings** settings in VSCode or edit the settings.json:\n\n```jsonc\n\"python-fstring-dsl.grammar.triggers\": {\n    \"html\": \"html|template\\\\.render\", // html or template.render\n    \"css\": \"css_\\\\d\", // css_0, css_1, etc\n    \"sql\": false // disable the sql\n    // js is not defined, use the default\n}\n```\n\nThe values are regexps. They are inlined inside the larger regexps so don't use capturing groups.\n\nThe changes are not applied automatically. Run _(Ctrl-Shift-P)_ **Highlight f-string: Generate grammar** command to regenerate the internal grammar file of extension and reload VSCode.\n\n## More\n\n- The syntax matching is naive. It will work only for the simple common cases. If something don't color the way it should, the best workaround will be the template simplification.\n\n- This extension deals with the highlighting only, so no Intellisence, hovers, etc.\n\n- f-strings are not very useful with CSS and JS. These languages are brace-heavy - too many braces to be escaped.\n\n- Add these lines to the VSCode settings.json to style the f-expression braces italic as in the sample above:\n\n  ```jsonc\n  \"editor.tokenColorCustomizations\": {\n          \"textMateRules\": [\n              {\n                  \"scope\": \"meta.embedded.inline.f-expression constant.character.format.placeholder.other.python\",\n                  \"settings\": {\n                      \"fontStyle\": \"italic bold\",\n                  },\n              },\n              // ... or maybe underline the full expression ?\n              // {\n              //     \"scope\": \"meta.embedded.inline.f-expression\",\n              //     \"settings\": {\n              //         \"fontStyle\": \"underline\",\n              //     },\n              // },\n      ]\n  },\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkmnt%2Fvscode-python-fstring-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkmnt%2Fvscode-python-fstring-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkmnt%2Fvscode-python-fstring-dsl/lists"}