{"id":17930193,"url":"https://github.com/samwillis/python-inline-source","last_synced_at":"2025-07-04T11:06:47.056Z","repository":{"id":57479898,"uuid":"469106531","full_name":"samwillis/python-inline-source","owner":"samwillis","description":"Python Inline Source Syntax Highlighting Using Type Annotations","archived":false,"fork":false,"pushed_at":"2023-11-20T10:28:39.000Z","size":143,"stargazers_count":59,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-27T22:53:04.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/samwillis.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}},"created_at":"2022-03-12T14:31:00.000Z","updated_at":"2024-12-06T03:44:34.000Z","dependencies_parsed_at":"2022-09-26T17:41:32.406Z","dependency_job_id":null,"html_url":"https://github.com/samwillis/python-inline-source","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/samwillis/python-inline-source","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwillis%2Fpython-inline-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwillis%2Fpython-inline-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwillis%2Fpython-inline-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwillis%2Fpython-inline-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samwillis","download_url":"https://codeload.github.com/samwillis/python-inline-source/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwillis%2Fpython-inline-source/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263499191,"owners_count":23476021,"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-10-28T21:12:22.000Z","updated_at":"2025-07-04T11:06:47.031Z","avatar_url":"https://github.com/samwillis.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Python Inline Source Syntax Highlighting Using Type Annotations\n\nThis project enables inline syntax highligting of strings in python source files for \nmultiple languages using type annotations.\n\nSupports `html`, `css`, `javascript`, `typescript`, `sql`, `graphql`, \nmultiple *css extension languages*, *template languages* and many more, \n[see below](#supported-languages) for a full list.\n\nUses [typing.Annotated](https://docs.python.org/3/library/typing.html#typing.Annotated)\nto annotate the `str` type with the language used. You can use \n[typing.get_type_hints](https://docs.python.org/3/library/typing.html#typing.get_type_hints) \nat runtime to determine the language that a string has been annotated with.\n\n- [sourcetypes](https://github.com/samwillis/python-inline-source/tree/main/sourcetypes) Python Types Package.\n- [vscode-python-inline-source](https://github.com/samwillis/python-inline-source/tree/main/vscode-python-inline-source) VS Code Plugin.\n\n## Installation\n\n### Python package:\n\n```\npip install sourcetypes\n```\n\n### VS Code plugin:\n\nInstall `python-inline-source` from extensions (`ctrl + shift + x` or `cmd + shift + x` \non mac).\n\nAlso available on [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=samwillis.python-inline-source)\n\n## Example\n\n[![Example](sourcetypes/docs/examples.png)](sourcetypes/docs/examples.py)\n\n## Usage\n\nUse a type decoration named for language that you are using:\n\n```\nimport sourcetypes\n\nmy_html_string: sourcetypes.html = \"\"\"\n  \u003ch1\u003eSome HTML\u003c/h1\u003e\n\"\"\"\n```\n\nor:\n\n```\nfrom sourcetypes import html\n\nmy_html_string: html = \"\"\"\n  \u003ch1\u003eSome HTML\u003c/h1\u003e\n\"\"\"\n```\n\n## Supported Languages\n\n- `markdown` (aliased as `md`)\n- `html`\n- `django_html` (aliased as `django`)\n- `django_txt`\n- `jinja`\n- `jinja_html`\n- `css` (aliased as `style`, and `styles`)\n- `scss`\n- `less`\n- `sass`\n- `stylus`\n- `javascript` (aliased as `js`)\n- `jsx` (aliased as `javascriptreact`, and `react`)\n- `typescript` (aliased as `ts`)\n- `tsx` (aliased as `typescriptreact`)\n- `coffeescript` (aliased as `coffee`)\n- `sql`\n- `json`\n- `yaml`\n- `graphql`\n- `xml`\n- `python`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwillis%2Fpython-inline-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamwillis%2Fpython-inline-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwillis%2Fpython-inline-source/lists"}