├── .gitignore ├── LICENSE ├── README.md ├── generate.py ├── languages.json ├── sourcetypes ├── LICENSE ├── README.md ├── docs │ ├── examples.png │ └── examples.py ├── setup.py └── sourcetypes.py └── vscode-python-inline-source ├── .vscode └── launch.json ├── .vscodeignore ├── LICENSE ├── README.md ├── docs ├── examples.png └── examples.py ├── language-configuration.json ├── package.json └── syntaxes └── python-inline-source.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.vsix 3 | 4 | # PYTHON: 5 | 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | *$py.class 10 | 11 | # C extensions 12 | *.so 13 | 14 | # Distribution / packaging 15 | .Python 16 | build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | sdist/ 26 | var/ 27 | wheels/ 28 | share/python-wheels/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | MANIFEST 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .nox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *.cover 54 | *.py,cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | cover/ 58 | 59 | # Translations 60 | *.mo 61 | *.pot 62 | 63 | # Django stuff: 64 | *.log 65 | local_settings.py 66 | db.sqlite3 67 | db.sqlite3-journal 68 | 69 | # Flask stuff: 70 | instance/ 71 | .webassets-cache 72 | 73 | # Scrapy stuff: 74 | .scrapy 75 | 76 | # Sphinx documentation 77 | docs/_build/ 78 | 79 | # PyBuilder 80 | .pybuilder/ 81 | target/ 82 | 83 | # Jupyter Notebook 84 | .ipynb_checkpoints 85 | 86 | # IPython 87 | profile_default/ 88 | ipython_config.py 89 | 90 | # pyenv 91 | # For a library or package, you might want to ignore these files since the code is 92 | # intended to run in multiple environments; otherwise, check them in: 93 | # .python-version 94 | 95 | # pipenv 96 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 97 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 98 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 99 | # install all needed dependencies. 100 | #Pipfile.lock 101 | 102 | # poetry 103 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 104 | # This is especially recommended for binary packages to ensure reproducibility, and is more 105 | # commonly ignored for libraries. 106 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 107 | #poetry.lock 108 | 109 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 110 | __pypackages__/ 111 | 112 | # Celery stuff 113 | celerybeat-schedule 114 | celerybeat.pid 115 | 116 | # SageMath parsed files 117 | *.sage.py 118 | 119 | # Environments 120 | .env 121 | .venv 122 | env/ 123 | venv/ 124 | ENV/ 125 | env.bak/ 126 | venv.bak/ 127 | 128 | # Spyder project settings 129 | .spyderproject 130 | .spyproject 131 | 132 | # Rope project settings 133 | .ropeproject 134 | 135 | # mkdocs documentation 136 | /site 137 | 138 | # mypy 139 | .mypy_cache/ 140 | .dmypy.json 141 | dmypy.json 142 | 143 | # Pyre type checker 144 | .pyre/ 145 | 146 | # pytype static type analyzer 147 | .pytype/ 148 | 149 | # Cython debug symbols 150 | cython_debug/ 151 | 152 | # PyCharm 153 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 154 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 155 | # and can be added to the global gitignore or merged into this file. For a more nuclear 156 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 157 | #.idea/ 158 | 159 | # NODE: 160 | 161 | # Logs 162 | logs 163 | *.log 164 | npm-debug.log* 165 | yarn-debug.log* 166 | yarn-error.log* 167 | lerna-debug.log* 168 | .pnpm-debug.log* 169 | 170 | # Diagnostic reports (https://nodejs.org/api/report.html) 171 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 172 | 173 | # Runtime data 174 | pids 175 | *.pid 176 | *.seed 177 | *.pid.lock 178 | 179 | # Directory for instrumented libs generated by jscoverage/JSCover 180 | lib-cov 181 | 182 | # Coverage directory used by tools like istanbul 183 | coverage 184 | *.lcov 185 | 186 | # nyc test coverage 187 | .nyc_output 188 | 189 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 190 | .grunt 191 | 192 | # Bower dependency directory (https://bower.io/) 193 | bower_components 194 | 195 | # node-waf configuration 196 | .lock-wscript 197 | 198 | # Compiled binary addons (https://nodejs.org/api/addons.html) 199 | build/Release 200 | 201 | # Dependency directories 202 | node_modules/ 203 | jspm_packages/ 204 | 205 | # Snowpack dependency directory (https://snowpack.dev/) 206 | web_modules/ 207 | 208 | # TypeScript cache 209 | *.tsbuildinfo 210 | 211 | # Optional npm cache directory 212 | .npm 213 | 214 | # Optional eslint cache 215 | .eslintcache 216 | 217 | # Optional stylelint cache 218 | .stylelintcache 219 | 220 | # Microbundle cache 221 | .rpt2_cache/ 222 | .rts2_cache_cjs/ 223 | .rts2_cache_es/ 224 | .rts2_cache_umd/ 225 | 226 | # Optional REPL history 227 | .node_repl_history 228 | 229 | # Output of 'npm pack' 230 | *.tgz 231 | 232 | # Yarn Integrity file 233 | .yarn-integrity 234 | 235 | # dotenv environment variable files 236 | .env 237 | .env.development.local 238 | .env.test.local 239 | .env.production.local 240 | .env.local 241 | 242 | # parcel-bundler cache (https://parceljs.org/) 243 | .cache 244 | .parcel-cache 245 | 246 | # Next.js build output 247 | .next 248 | out 249 | 250 | # Nuxt.js build / generate output 251 | .nuxt 252 | dist 253 | 254 | # Gatsby files 255 | .cache/ 256 | # Comment in the public line in if your project uses Gatsby and not Next.js 257 | # https://nextjs.org/blog/next-9-1#public-directory-support 258 | # public 259 | 260 | # vuepress build output 261 | .vuepress/dist 262 | 263 | # vuepress v2.x temp and cache directory 264 | .temp 265 | .cache 266 | 267 | # Docusaurus cache and generated files 268 | .docusaurus 269 | 270 | # Serverless directories 271 | .serverless/ 272 | 273 | # FuseBox cache 274 | .fusebox/ 275 | 276 | # DynamoDB Local files 277 | .dynamodb/ 278 | 279 | # TernJS port file 280 | .tern-port 281 | 282 | # Stores VSCode versions used for testing VSCode extensions 283 | .vscode-test 284 | 285 | # yarn v2 286 | .yarn/cache 287 | .yarn/unplugged 288 | .yarn/build-state.yml 289 | .yarn/install-state.gz 290 | .pnp.* 291 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Sam Willis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python Inline Source Syntax Highlighting Using Type Annotations 2 | 3 | This project enables inline syntax highligting of strings in python source files for 4 | multiple languages using type annotations. 5 | 6 | Supports `html`, `css`, `javascript`, `typescript`, `sql`, `graphql`, 7 | multiple *css extension languages*, *template languages* and many more, 8 | [see below](#supported-languages) for a full list. 9 | 10 | Uses [typing.Annotated](https://docs.python.org/3/library/typing.html#typing.Annotated) 11 | to annotate the `str` type with the language used. You can use 12 | [typing.get_type_hints](https://docs.python.org/3/library/typing.html#typing.get_type_hints) 13 | at runtime to determine the language that a string has been annotated with. 14 | 15 | - [sourcetypes](https://github.com/samwillis/python-inline-source/tree/main/sourcetypes) Python Types Package. 16 | - [vscode-python-inline-source](https://github.com/samwillis/python-inline-source/tree/main/vscode-python-inline-source) VS Code Plugin. 17 | 18 | ## Installation 19 | 20 | ### Python package: 21 | 22 | ``` 23 | pip install sourcetypes 24 | ``` 25 | 26 | ### VS Code plugin: 27 | 28 | Install `python-inline-source` from extensions (`ctrl + shift + x` or `cmd + shift + x` 29 | on mac). 30 | 31 | Also available on [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=samwillis.python-inline-source) 32 | 33 | ## Example 34 | 35 | [![Example](sourcetypes/docs/examples.png)](sourcetypes/docs/examples.py) 36 | 37 | ## Usage 38 | 39 | Use a type decoration named for language that you are using: 40 | 41 | ``` 42 | import sourcetypes 43 | 44 | my_html_string: sourcetypes.html = """ 45 |

Some HTML

46 | """ 47 | ``` 48 | 49 | or: 50 | 51 | ``` 52 | from sourcetypes import html 53 | 54 | my_html_string: html = """ 55 |

Some HTML

56 | """ 57 | ``` 58 | 59 | ## Supported Languages 60 | 61 | - `markdown` (aliased as `md`) 62 | - `html` 63 | - `django_html` (aliased as `django`) 64 | - `django_txt` 65 | - `jinja` 66 | - `jinja_html` 67 | - `css` (aliased as `style`, and `styles`) 68 | - `scss` 69 | - `less` 70 | - `sass` 71 | - `stylus` 72 | - `javascript` (aliased as `js`) 73 | - `jsx` (aliased as `javascriptreact`, and `react`) 74 | - `typescript` (aliased as `ts`) 75 | - `tsx` (aliased as `typescriptreact`) 76 | - `coffeescript` (aliased as `coffee`) 77 | - `sql` 78 | - `json` 79 | - `yaml` 80 | - `graphql` 81 | - `xml` 82 | - `python` 83 | -------------------------------------------------------------------------------- /generate.py: -------------------------------------------------------------------------------- 1 | import os, json, re 2 | 3 | directory = os.path.dirname(os.path.realpath(__file__)) 4 | 5 | regex = '(:) ((((\w+)(\.))?(%s))|((")(%s)("))|((\')(%s)(\'))) (=) ([bBrRuU]?f?)("{3})' 6 | # ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 7 | # 1 5 6 7 9 10 11 13 14 15 16 17 18 8 | 9 | begin_captures = { 10 | "1": {"name": "punctuation.separator.colon.python"}, 11 | "5": {"name": "source.python"}, 12 | "6": {"name": "punctuation.separator.period.python"}, 13 | "7": {"name": "meta.attribute.python"}, 14 | "9": {"name": "string.quoted.single.python"}, 15 | "10": {"name": "string.quoted.single.python"}, 16 | "11": {"name": "string.quoted.single.python"}, 17 | "13": {"name": "string.quoted.single.python"}, 18 | "14": {"name": "string.quoted.single.python"}, 19 | "15": {"name": "string.quoted.single.python"}, 20 | "16": {"name": "keyword.operator.assignment.python"}, 21 | "17": {"name": "storage.type.string.python"}, 22 | "18": {"name": "string.quoted.multi.python"}, 23 | } 24 | 25 | 26 | def make_vs_code_extension(languages): 27 | package_file_path = os.path.join( 28 | directory, "vscode-python-inline-source", "package.json" 29 | ) 30 | readme_file_path = os.path.join( 31 | directory, "vscode-python-inline-source", "README.md" 32 | ) 33 | add_supported_languages_to_readme(languages, readme_file_path) 34 | syntax_file_path = os.path.join( 35 | directory, 36 | "vscode-python-inline-source", 37 | "syntaxes", 38 | "python-inline-source.json", 39 | ) 40 | with open(package_file_path, "r") as f: 41 | package = json.load(f) 42 | with open(syntax_file_path, "r") as f: 43 | syntax = json.load(f) 44 | embedded_languages = {} 45 | patterns = [] 46 | for langname, options in languages.items(): 47 | embedded_languages[options["contentName"]] = langname 48 | patterns.append( 49 | { 50 | "contentName": options["contentName"], 51 | "begin": regex % ((options["match"],) * 3), 52 | "beginCaptures": begin_captures, 53 | "end": '("{3})', 54 | "endCaptures": {"1": {"name": "string.quoted.multi.python"}}, 55 | "patterns": [{"include": options["include"]}], 56 | } 57 | ) 58 | package["contributes"]["grammars"][0]["embeddedLanguages"] = embedded_languages 59 | syntax["patterns"] = patterns 60 | with open(package_file_path, 'w') as f: 61 | json.dump(package, f, indent=4) 62 | with open(syntax_file_path, 'w') as f: 63 | json.dump(syntax, f, indent=4) 64 | 65 | 66 | def make_python_types(languages): 67 | sourcetypes_file_path = os.path.join( 68 | directory, "sourcetypes", "sourcetypes.py" 69 | ) 70 | readme_file_path = os.path.join( 71 | directory, "sourcetypes", "README.md" 72 | ) 73 | add_supported_languages_to_readme(languages, readme_file_path) 74 | with open(sourcetypes_file_path, 'w') as f: 75 | f.writelines( 76 | [ 77 | "try:\n", 78 | " from typing import Annotated\n", 79 | "except ImportError:\n", 80 | " from typing_extensions import Annotated\n", 81 | "\n", 82 | "source_code = Annotated[str, 'source_code']\n", 83 | "\n", 84 | ] 85 | ) 86 | for langname, options in languages.items(): 87 | f.write(f"{langname} = Annotated[source_code, '{langname}']\n") 88 | for alias in options["match"].split("|"): 89 | if alias != langname: 90 | f.write(f"{alias} = {langname}\n") 91 | f.write("\n") 92 | 93 | 94 | def add_supported_languages_to_readme(languages, readme_file_path): 95 | with open(readme_file_path, "r") as f: 96 | readme = f.read() 97 | readme_text = [] 98 | for langname, options in languages.items(): 99 | readme_text_line = f"\n- `{langname}`" 100 | aliases = [f"`{m}`" for m in options['match'].split("|") if m != langname] 101 | if aliases: 102 | if len(aliases) > 1: 103 | aliases[-1] = f"and {aliases[-1]}" 104 | readme_text_line = f"{readme_text_line} (aliased as {', '.join(aliases)})" 105 | readme_text.append(readme_text_line) 106 | readme = re.sub(r"(## Supported Languages\n)[^#]*", fr"\1{''.join(readme_text)}\n\n", readme) 107 | with open(readme_file_path, 'w') as f: 108 | f.write(readme) 109 | 110 | 111 | def main(): 112 | with open(os.path.join(directory, "languages.json"), "r") as f: 113 | languages = json.load(f) 114 | make_vs_code_extension(languages) 115 | make_python_types(languages) 116 | add_supported_languages_to_readme(languages, os.path.join(directory, "README.md")) 117 | 118 | 119 | if __name__ == "__main__": 120 | main() 121 | -------------------------------------------------------------------------------- /languages.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdown": { 3 | "match": "markdown|md", 4 | "contentName": "meta.embedded.inline.markdown", 5 | "include": "text.html.markdown" 6 | }, 7 | "html": { 8 | "match": "html", 9 | "contentName": "meta.embedded.inline.html", 10 | "include": "text.html.basic" 11 | }, 12 | "django_html": { 13 | "match": "django_html|django", 14 | "contentName": "meta.embedded.inline.django_html", 15 | "include": "text.html.django" 16 | }, 17 | "django_txt": { 18 | "match": "django_txt", 19 | "contentName": "meta.embedded.inline.django_txt", 20 | "include": "text.django" 21 | }, 22 | "jinja": { 23 | "match": "jinja", 24 | "contentName": "meta.embedded.inline.jinja", 25 | "include": "source.jinja" 26 | }, 27 | "jinja_html": { 28 | "match": "jinja_html", 29 | "contentName": "meta.embedded.inline.jinja_html", 30 | "include": "text.html.jinja" 31 | }, 32 | "css": { 33 | "match": "css|style|styles", 34 | "contentName": "meta.embedded.inline.css", 35 | "include": "source.css" 36 | }, 37 | "scss": { 38 | "match": "scss", 39 | "contentName": "meta.embedded.inline.scss", 40 | "include": "source.css.scss" 41 | }, 42 | "less": { 43 | "match": "less", 44 | "contentName": "meta.embedded.inline.less", 45 | "include": "source.css.less" 46 | }, 47 | "sass": { 48 | "match": "sass", 49 | "contentName": "meta.embedded.inline.sass", 50 | "include": "source.sass" 51 | }, 52 | "stylus": { 53 | "match": "stylus", 54 | "contentName": "meta.embedded.inline.stylus", 55 | "include": "source.stylus" 56 | }, 57 | "javascript": { 58 | "match": "javascript|js", 59 | "contentName": "meta.embedded.inline.js", 60 | "include": "source.js" 61 | }, 62 | "jsx": { 63 | "match": "javascriptreact|react|jsx", 64 | "contentName": "meta.embedded.inline.jsx", 65 | "include": "source.js.jsx" 66 | }, 67 | "typescript": { 68 | "match": "typescript|ts", 69 | "contentName": "meta.embedded.inline.ts", 70 | "include": "source.ts" 71 | }, 72 | "tsx": { 73 | "match": "typescriptreact|tsx", 74 | "contentName": "meta.embedded.inline.tsx", 75 | "include": "source.tsx" 76 | }, 77 | "coffeescript": { 78 | "match": "coffeescript|coffee", 79 | "contentName": "meta.embedded.inline.coffeescript", 80 | "include": "source.coffee" 81 | }, 82 | "sql": { 83 | "match": "sql", 84 | "contentName": "meta.embedded.inline.sql", 85 | "include": "source.sql" 86 | }, 87 | "json": { 88 | "match": "json", 89 | "contentName": "meta.embedded.inline.json", 90 | "include": "source.json" 91 | }, 92 | "yaml": { 93 | "match": "yaml", 94 | "contentName": "meta.embedded.inline.yaml", 95 | "include": "source.yaml" 96 | }, 97 | "graphql": { 98 | "match": "graphql", 99 | "contentName": "meta.embedded.inline.graphql", 100 | "include": "source.graphql" 101 | }, 102 | "xml": { 103 | "match": "xml", 104 | "contentName": "meta.embedded.inline.xml", 105 | "include": "text.xml" 106 | }, 107 | "python": { 108 | "match": "python", 109 | "contentName": "meta.embedded.inline.python", 110 | "include": "source.python" 111 | } 112 | } -------------------------------------------------------------------------------- /sourcetypes/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Sam Willis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /sourcetypes/README.md: -------------------------------------------------------------------------------- 1 | # Python Source Code Types For Inline Syntax Highlighting 2 | 3 | Type annotations for various languages, when applied to multi line strings will syntax 4 | highlighting with the `python-inline-source` VS Code plugin. 5 | 6 | Supports `html`, `css`, `javascript`, `typescript`, `sql`, `graphql`, 7 | multiple *css extension languages*, *template languages* and many more, 8 | [see below](#supported-languages) for a full list. 9 | 10 | Uses [typing.Annotated](https://docs.python.org/3/library/typing.html#typing.Annotated) 11 | to annotate the `str` type with the language used. You can use 12 | [typing.get_type_hints](https://docs.python.org/3/library/typing.html#typing.get_type_hints) 13 | at runtime to determine the language that a string has been annotated with. 14 | 15 | On Python versions prior to 3.9 uses [typing_extensions](https://pypi.org/project/typing-extensions/) to support `Annotated` types. 16 | 17 | ## Installation 18 | 19 | ``` 20 | pip install sourcetypes 21 | ``` 22 | 23 | ## Example 24 | 25 | [![Example](docs/examples.png)](docs/examples.py) 26 | 27 | ## Usage 28 | 29 | Use a type decoration named for language that you are using: 30 | 31 | ``` 32 | import sourcetypes 33 | 34 | my_html_string: sourcetypes.html = """ 35 |

Some HTML

36 | """ 37 | ``` 38 | 39 | or: 40 | 41 | ``` 42 | from sourcetypes import html 43 | 44 | my_html_string: html = """ 45 |

Some HTML

46 | """ 47 | ``` 48 | 49 | ## Supported Languages 50 | 51 | - `markdown` (aliased as `md`) 52 | - `html` 53 | - `django_html` (aliased as `django`) 54 | - `django_txt` 55 | - `jinja` 56 | - `jinja_html` 57 | - `css` (aliased as `style`, and `styles`) 58 | - `scss` 59 | - `less` 60 | - `sass` 61 | - `stylus` 62 | - `javascript` (aliased as `js`) 63 | - `jsx` (aliased as `javascriptreact`, and `react`) 64 | - `typescript` (aliased as `ts`) 65 | - `tsx` (aliased as `typescriptreact`) 66 | - `coffeescript` (aliased as `coffee`) 67 | - `sql` 68 | - `json` 69 | - `yaml` 70 | - `graphql` 71 | - `xml` 72 | - `python` 73 | 74 | ## Release Notes 75 | 76 | ### [0.0.2] - 2022-03-13 77 | - Doc tweaks 78 | 79 | ### [0.0.1] - 2022-03-11 80 | - Alpha release -------------------------------------------------------------------------------- /sourcetypes/docs/examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/python-inline-source/ace69115034953e46694ccbc29f6d50f8d0cd5c6/sourcetypes/docs/examples.png -------------------------------------------------------------------------------- /sourcetypes/docs/examples.py: -------------------------------------------------------------------------------- 1 | import sourcetypes 2 | from sourcetypes import html, sql 3 | 4 | test_html: html = """ 5 | 6 | 7 |

Inline syntax highlighting!

8 | 9 | 10 | """ 11 | 12 | test_sql: sql = """ 13 | SELECT test 14 | FROM a_table 15 | """ 16 | 17 | test_css: sourcetypes.css = """ 18 | body { 19 | font-weight: bold; 20 | color: #f00; 21 | } 22 | """ 23 | 24 | test_javascript: sourcetypes.javascript = """ 25 | function() { 26 | var text = "Some Text"; 27 | alert(text) 28 | } 29 | """ 30 | 31 | test_typescript: sourcetypes.ts = """ 32 | function() { 33 | var text = "Some Text"; 34 | alert(text) 35 | } 36 | """ 37 | 38 | test_jsx: sourcetypes.jsx = """ 39 | function() { 40 | const element =

Hello, world!

; 41 | return element 42 | } 43 | """ 44 | 45 | test_tsx: sourcetypes.tsx = """ 46 | function() { 47 | const element =

Hello, world!

; 48 | return element 49 | } 50 | """ 51 | 52 | test_python: sourcetypes.python = """ 53 | test = "123" 54 | def my_function(): 55 | return f"My string: {test}" 56 | """ 57 | 58 | test_sql2: sourcetypes.sql = """ 59 | SELECT test 60 | FROM a_table 61 | """ 62 | 63 | test_html2: "html" = """ 64 | 65 | 66 |

Inline syntax highlighting

67 | 68 | 69 | """ 70 | -------------------------------------------------------------------------------- /sourcetypes/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | with open("README.md", "r") as fh: 4 | long_description = fh.read() 5 | img_url = "https://raw.githubusercontent.com/samwillis/python-inline-source/main/sourcetypes/docs/examples.png" 6 | long_description = long_description.replace("(docs/examples.png)", f"({img_url})") 7 | 8 | setup( 9 | name='sourcetypes', 10 | version='0.0.4', 11 | author="Sam Willis", 12 | description="Python Source Code Types For Inline Syntax Highlighting", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | url="https://github.com/samwillis/python-inline-source/sourcetypes", 16 | py_modules=['sourcetypes'], 17 | classifiers=[ 18 | "Programming Language :: Python :: 3", 19 | "License :: OSI Approved :: MIT License", 20 | "Operating System :: OS Independent", 21 | ], 22 | python_requires='>=3.7', 23 | install_requires=[ 24 | 'typing-extensions>=3.7.4', 25 | ] 26 | ) 27 | -------------------------------------------------------------------------------- /sourcetypes/sourcetypes.py: -------------------------------------------------------------------------------- 1 | try: 2 | from typing import Annotated 3 | except ImportError: 4 | from typing_extensions import Annotated 5 | 6 | source_code = Annotated[str, 'source_code'] 7 | 8 | markdown = Annotated[source_code, 'markdown'] 9 | md = markdown 10 | 11 | html = Annotated[source_code, 'html'] 12 | 13 | django_html = Annotated[source_code, 'django_html'] 14 | django = django_html 15 | 16 | django_txt = Annotated[source_code, 'django_txt'] 17 | 18 | jinja = Annotated[source_code, 'jinja'] 19 | 20 | jinja_html = Annotated[source_code, 'jinja_html'] 21 | 22 | css = Annotated[source_code, 'css'] 23 | style = css 24 | styles = css 25 | 26 | scss = Annotated[source_code, 'scss'] 27 | 28 | less = Annotated[source_code, 'less'] 29 | 30 | sass = Annotated[source_code, 'sass'] 31 | 32 | stylus = Annotated[source_code, 'stylus'] 33 | 34 | javascript = Annotated[source_code, 'javascript'] 35 | js = javascript 36 | 37 | jsx = Annotated[source_code, 'jsx'] 38 | javascriptreact = jsx 39 | react = jsx 40 | 41 | typescript = Annotated[source_code, 'typescript'] 42 | ts = typescript 43 | 44 | tsx = Annotated[source_code, 'tsx'] 45 | typescriptreact = tsx 46 | 47 | coffeescript = Annotated[source_code, 'coffeescript'] 48 | coffee = coffeescript 49 | 50 | sql = Annotated[source_code, 'sql'] 51 | 52 | json = Annotated[source_code, 'json'] 53 | 54 | yaml = Annotated[source_code, 'yaml'] 55 | 56 | graphql = Annotated[source_code, 'graphql'] 57 | 58 | xml = Annotated[source_code, 'xml'] 59 | 60 | python = Annotated[source_code, 'python'] 61 | 62 | -------------------------------------------------------------------------------- /vscode-python-inline-source/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /vscode-python-inline-source/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | -------------------------------------------------------------------------------- /vscode-python-inline-source/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Sam Willis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vscode-python-inline-source/README.md: -------------------------------------------------------------------------------- 1 | # Python Inline Source Syntax Highlighting 2 | 3 | VS Code plugin to add syntax highlight to multi line Python strings using type 4 | annotations. Supports `html`, `css`, `javascript`, `typescript`, `sql`, `graphql`, 5 | multiple *css extension languages*, *template languages* and many more, 6 | [see below](#supported-languages) for a full list. 7 | 8 | ## Installation 9 | 10 | Install `python-inline-source` from extensions (`ctrl + shift + x` or `cmd + shift + x` 11 | on mac). 12 | 13 | Also available on [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=samwillis.python-inline-source) 14 | 15 | ## Example 16 | 17 | ![Example](docs/examples.png) 18 | 19 | ## Usage 20 | 21 | Use a type decoration named for language that you are using, the simplest for of this is 22 | to do something like this: 23 | 24 | ``` 25 | html = str # Create an alias of the str type named for the language you are using 26 | 27 | my_html_string: html = """ 28 |

Some HTML

29 | """ 30 | ``` 31 | 32 | In order to aid with the type decorations the `sourcetypes` package can be 33 | installed (`pip install sourcetypes`) which allows this for all supported 34 | languages: 35 | 36 | ``` 37 | import sourcetypes 38 | 39 | my_html_string: sourcetypes.html = """ 40 |

Some HTML

41 | """ 42 | ``` 43 | 44 | The `sourcetypes` package uses [typing.Annotated](https://docs.python.org/3/library/typing.html#typing.Annotated) 45 | to annotate the `str` type with the language used. You can use 46 | [typing.get_type_hints](https://docs.python.org/3/library/typing.html#typing.get_type_hints) 47 | at runtime to determine the language that a string has been annotated with. 48 | 49 | ## Supported Languages 50 | 51 | - `markdown` (aliased as `md`) 52 | - `html` 53 | - `django_html` (aliased as `django`) 54 | - `django_txt` 55 | - `jinja` 56 | - `jinja_html` 57 | - `css` (aliased as `style`, and `styles`) 58 | - `scss` 59 | - `less` 60 | - `sass` 61 | - `stylus` 62 | - `javascript` (aliased as `js`) 63 | - `jsx` (aliased as `javascriptreact`, and `react`) 64 | - `typescript` (aliased as `ts`) 65 | - `tsx` (aliased as `typescriptreact`) 66 | - `coffeescript` (aliased as `coffee`) 67 | - `sql` 68 | - `json` 69 | - `yaml` 70 | - `graphql` 71 | - `xml` 72 | - `python` 73 | 74 | ## Requirements 75 | 76 | - At least Visual Studio Code v1.64.0 recommended, not tested on older versions. 77 | 78 | ## Release Notes 79 | 80 | ### [0.0.2] - 2022-03-13 81 | - Doc tweaks 82 | 83 | ### [0.0.1] - 2022-03-11 84 | - Alpha release -------------------------------------------------------------------------------- /vscode-python-inline-source/docs/examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/python-inline-source/ace69115034953e46694ccbc29f6d50f8d0cd5c6/vscode-python-inline-source/docs/examples.png -------------------------------------------------------------------------------- /vscode-python-inline-source/docs/examples.py: -------------------------------------------------------------------------------- 1 | import sourcetypes 2 | from sourcetypes import html, sql 3 | 4 | test_html: html = """ 5 | 6 | 7 |

Inline syntax highlighting!

8 | 9 | 10 | """ 11 | 12 | test_sql: sql = """ 13 | SELECT test 14 | FROM a_table 15 | """ 16 | 17 | test_css: sourcetypes.css = """ 18 | body { 19 | font-weight: bold; 20 | color: #f00; 21 | } 22 | """ 23 | 24 | test_javascript: sourcetypes.javascript = """ 25 | function() { 26 | var text = "Some Text"; 27 | alert(text) 28 | } 29 | """ 30 | 31 | test_typescript: sourcetypes.ts = """ 32 | function() { 33 | var text = "Some Text"; 34 | alert(text) 35 | } 36 | """ 37 | 38 | test_jsx: sourcetypes.jsx = """ 39 | function() { 40 | const element =

Hello, world!

; 41 | return element 42 | } 43 | """ 44 | 45 | test_tsx: sourcetypes.tsx = """ 46 | function() { 47 | const element =

Hello, world!

; 48 | return element 49 | } 50 | """ 51 | 52 | test_python: sourcetypes.python = """ 53 | test = "123" 54 | def my_function(): 55 | return f"My string: {test}" 56 | """ 57 | 58 | test_sql2: sourcetypes.sql = """ 59 | SELECT test 60 | FROM a_table 61 | """ 62 | 63 | test_html2: "html" = """ 64 | 65 | 66 |

Inline syntax highlighting

67 | 68 | 69 | """ 70 | -------------------------------------------------------------------------------- /vscode-python-inline-source/language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["'", "'"] 21 | ], 22 | // symbols that can be used to surround a selection 23 | "surroundingPairs": [ 24 | ["{", "}"], 25 | ["[", "]"], 26 | ["(", ")"], 27 | ["\"", "\""], 28 | ["'", "'"] 29 | ] 30 | } -------------------------------------------------------------------------------- /vscode-python-inline-source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "python-inline-source", 3 | "displayName": "Python Inline Source Syntax Highlighting", 4 | "description": "Inline syntax highlighting for Python using type hints.", 5 | "version": "0.0.2", 6 | "publisher": "samwillis", 7 | "engines": { 8 | "vscode": "^1.64.0" 9 | }, 10 | "categories": [ 11 | "Programming Languages" 12 | ], 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/samwillis/python-inline-source.git", 16 | "directory": "vscode-python-inline-source" 17 | }, 18 | "contributes": { 19 | "languages": [ 20 | { 21 | "id": "python", 22 | "aliases": [ 23 | "python" 24 | ], 25 | "extensions": [ 26 | ".py", 27 | ".py3" 28 | ] 29 | } 30 | ], 31 | "grammars": [ 32 | { 33 | "injectTo": [ 34 | "source.python" 35 | ], 36 | "scopeName": "inline.python-inline-source", 37 | "path": "./syntaxes/python-inline-source.json", 38 | "embeddedLanguages": { 39 | "meta.embedded.inline.markdown": "markdown", 40 | "meta.embedded.inline.html": "html", 41 | "meta.embedded.inline.django_html": "django_html", 42 | "meta.embedded.inline.django_txt": "django_txt", 43 | "meta.embedded.inline.jinja": "jinja", 44 | "meta.embedded.inline.jinja_html": "jinja_html", 45 | "meta.embedded.inline.css": "css", 46 | "meta.embedded.inline.scss": "scss", 47 | "meta.embedded.inline.less": "less", 48 | "meta.embedded.inline.sass": "sass", 49 | "meta.embedded.inline.stylus": "stylus", 50 | "meta.embedded.inline.js": "javascript", 51 | "meta.embedded.inline.jsx": "jsx", 52 | "meta.embedded.inline.ts": "typescript", 53 | "meta.embedded.inline.tsx": "tsx", 54 | "meta.embedded.inline.coffeescript": "coffeescript", 55 | "meta.embedded.inline.sql": "sql", 56 | "meta.embedded.inline.json": "json", 57 | "meta.embedded.inline.yaml": "yaml", 58 | "meta.embedded.inline.graphql": "graphql", 59 | "meta.embedded.inline.xml": "xml", 60 | "meta.embedded.inline.python": "python" 61 | } 62 | } 63 | ] 64 | } 65 | } -------------------------------------------------------------------------------- /vscode-python-inline-source/syntaxes/python-inline-source.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopeName": "inline.python-inline-source", 3 | "injectionSelector": "L:source.python", 4 | "fileTypes": [ 5 | "py" 6 | ], 7 | "patterns": [ 8 | { 9 | "contentName": "meta.embedded.inline.markdown", 10 | "begin": "(:) ((((\\w+)(\\.))?(markdown|md))|((\")(markdown|md)(\"))|((')(markdown|md)('))) (=) ([bBrRuU]?f?)(\"{3})", 11 | "beginCaptures": { 12 | "1": { 13 | "name": "punctuation.separator.colon.python" 14 | }, 15 | "5": { 16 | "name": "source.python" 17 | }, 18 | "6": { 19 | "name": "punctuation.separator.period.python" 20 | }, 21 | "7": { 22 | "name": "meta.attribute.python" 23 | }, 24 | "9": { 25 | "name": "string.quoted.single.python" 26 | }, 27 | "10": { 28 | "name": "string.quoted.single.python" 29 | }, 30 | "11": { 31 | "name": "string.quoted.single.python" 32 | }, 33 | "13": { 34 | "name": "string.quoted.single.python" 35 | }, 36 | "14": { 37 | "name": "string.quoted.single.python" 38 | }, 39 | "15": { 40 | "name": "string.quoted.single.python" 41 | }, 42 | "16": { 43 | "name": "keyword.operator.assignment.python" 44 | }, 45 | "17": { 46 | "name": "storage.type.string.python" 47 | }, 48 | "18": { 49 | "name": "string.quoted.multi.python" 50 | } 51 | }, 52 | "end": "(\"{3})", 53 | "endCaptures": { 54 | "1": { 55 | "name": "string.quoted.multi.python" 56 | } 57 | }, 58 | "patterns": [ 59 | { 60 | "include": "text.html.markdown" 61 | } 62 | ] 63 | }, 64 | { 65 | "contentName": "meta.embedded.inline.html", 66 | "begin": "(:) ((((\\w+)(\\.))?(html))|((\")(html)(\"))|((')(html)('))) (=) ([bBrRuU]?f?)(\"{3})", 67 | "beginCaptures": { 68 | "1": { 69 | "name": "punctuation.separator.colon.python" 70 | }, 71 | "5": { 72 | "name": "source.python" 73 | }, 74 | "6": { 75 | "name": "punctuation.separator.period.python" 76 | }, 77 | "7": { 78 | "name": "meta.attribute.python" 79 | }, 80 | "9": { 81 | "name": "string.quoted.single.python" 82 | }, 83 | "10": { 84 | "name": "string.quoted.single.python" 85 | }, 86 | "11": { 87 | "name": "string.quoted.single.python" 88 | }, 89 | "13": { 90 | "name": "string.quoted.single.python" 91 | }, 92 | "14": { 93 | "name": "string.quoted.single.python" 94 | }, 95 | "15": { 96 | "name": "string.quoted.single.python" 97 | }, 98 | "16": { 99 | "name": "keyword.operator.assignment.python" 100 | }, 101 | "17": { 102 | "name": "storage.type.string.python" 103 | }, 104 | "18": { 105 | "name": "string.quoted.multi.python" 106 | } 107 | }, 108 | "end": "(\"{3})", 109 | "endCaptures": { 110 | "1": { 111 | "name": "string.quoted.multi.python" 112 | } 113 | }, 114 | "patterns": [ 115 | { 116 | "include": "text.html.basic" 117 | } 118 | ] 119 | }, 120 | { 121 | "contentName": "meta.embedded.inline.django_html", 122 | "begin": "(:) ((((\\w+)(\\.))?(django_html|django))|((\")(django_html|django)(\"))|((')(django_html|django)('))) (=) ([bBrRuU]?f?)(\"{3})", 123 | "beginCaptures": { 124 | "1": { 125 | "name": "punctuation.separator.colon.python" 126 | }, 127 | "5": { 128 | "name": "source.python" 129 | }, 130 | "6": { 131 | "name": "punctuation.separator.period.python" 132 | }, 133 | "7": { 134 | "name": "meta.attribute.python" 135 | }, 136 | "9": { 137 | "name": "string.quoted.single.python" 138 | }, 139 | "10": { 140 | "name": "string.quoted.single.python" 141 | }, 142 | "11": { 143 | "name": "string.quoted.single.python" 144 | }, 145 | "13": { 146 | "name": "string.quoted.single.python" 147 | }, 148 | "14": { 149 | "name": "string.quoted.single.python" 150 | }, 151 | "15": { 152 | "name": "string.quoted.single.python" 153 | }, 154 | "16": { 155 | "name": "keyword.operator.assignment.python" 156 | }, 157 | "17": { 158 | "name": "storage.type.string.python" 159 | }, 160 | "18": { 161 | "name": "string.quoted.multi.python" 162 | } 163 | }, 164 | "end": "(\"{3})", 165 | "endCaptures": { 166 | "1": { 167 | "name": "string.quoted.multi.python" 168 | } 169 | }, 170 | "patterns": [ 171 | { 172 | "include": "text.html.django" 173 | } 174 | ] 175 | }, 176 | { 177 | "contentName": "meta.embedded.inline.django_txt", 178 | "begin": "(:) ((((\\w+)(\\.))?(django_txt))|((\")(django_txt)(\"))|((')(django_txt)('))) (=) ([bBrRuU]?f?)(\"{3})", 179 | "beginCaptures": { 180 | "1": { 181 | "name": "punctuation.separator.colon.python" 182 | }, 183 | "5": { 184 | "name": "source.python" 185 | }, 186 | "6": { 187 | "name": "punctuation.separator.period.python" 188 | }, 189 | "7": { 190 | "name": "meta.attribute.python" 191 | }, 192 | "9": { 193 | "name": "string.quoted.single.python" 194 | }, 195 | "10": { 196 | "name": "string.quoted.single.python" 197 | }, 198 | "11": { 199 | "name": "string.quoted.single.python" 200 | }, 201 | "13": { 202 | "name": "string.quoted.single.python" 203 | }, 204 | "14": { 205 | "name": "string.quoted.single.python" 206 | }, 207 | "15": { 208 | "name": "string.quoted.single.python" 209 | }, 210 | "16": { 211 | "name": "keyword.operator.assignment.python" 212 | }, 213 | "17": { 214 | "name": "storage.type.string.python" 215 | }, 216 | "18": { 217 | "name": "string.quoted.multi.python" 218 | } 219 | }, 220 | "end": "(\"{3})", 221 | "endCaptures": { 222 | "1": { 223 | "name": "string.quoted.multi.python" 224 | } 225 | }, 226 | "patterns": [ 227 | { 228 | "include": "text.django" 229 | } 230 | ] 231 | }, 232 | { 233 | "contentName": "meta.embedded.inline.jinja", 234 | "begin": "(:) ((((\\w+)(\\.))?(jinja))|((\")(jinja)(\"))|((')(jinja)('))) (=) ([bBrRuU]?f?)(\"{3})", 235 | "beginCaptures": { 236 | "1": { 237 | "name": "punctuation.separator.colon.python" 238 | }, 239 | "5": { 240 | "name": "source.python" 241 | }, 242 | "6": { 243 | "name": "punctuation.separator.period.python" 244 | }, 245 | "7": { 246 | "name": "meta.attribute.python" 247 | }, 248 | "9": { 249 | "name": "string.quoted.single.python" 250 | }, 251 | "10": { 252 | "name": "string.quoted.single.python" 253 | }, 254 | "11": { 255 | "name": "string.quoted.single.python" 256 | }, 257 | "13": { 258 | "name": "string.quoted.single.python" 259 | }, 260 | "14": { 261 | "name": "string.quoted.single.python" 262 | }, 263 | "15": { 264 | "name": "string.quoted.single.python" 265 | }, 266 | "16": { 267 | "name": "keyword.operator.assignment.python" 268 | }, 269 | "17": { 270 | "name": "storage.type.string.python" 271 | }, 272 | "18": { 273 | "name": "string.quoted.multi.python" 274 | } 275 | }, 276 | "end": "(\"{3})", 277 | "endCaptures": { 278 | "1": { 279 | "name": "string.quoted.multi.python" 280 | } 281 | }, 282 | "patterns": [ 283 | { 284 | "include": "source.jinja" 285 | } 286 | ] 287 | }, 288 | { 289 | "contentName": "meta.embedded.inline.jinja_html", 290 | "begin": "(:) ((((\\w+)(\\.))?(jinja_html))|((\")(jinja_html)(\"))|((')(jinja_html)('))) (=) ([bBrRuU]?f?)(\"{3})", 291 | "beginCaptures": { 292 | "1": { 293 | "name": "punctuation.separator.colon.python" 294 | }, 295 | "5": { 296 | "name": "source.python" 297 | }, 298 | "6": { 299 | "name": "punctuation.separator.period.python" 300 | }, 301 | "7": { 302 | "name": "meta.attribute.python" 303 | }, 304 | "9": { 305 | "name": "string.quoted.single.python" 306 | }, 307 | "10": { 308 | "name": "string.quoted.single.python" 309 | }, 310 | "11": { 311 | "name": "string.quoted.single.python" 312 | }, 313 | "13": { 314 | "name": "string.quoted.single.python" 315 | }, 316 | "14": { 317 | "name": "string.quoted.single.python" 318 | }, 319 | "15": { 320 | "name": "string.quoted.single.python" 321 | }, 322 | "16": { 323 | "name": "keyword.operator.assignment.python" 324 | }, 325 | "17": { 326 | "name": "storage.type.string.python" 327 | }, 328 | "18": { 329 | "name": "string.quoted.multi.python" 330 | } 331 | }, 332 | "end": "(\"{3})", 333 | "endCaptures": { 334 | "1": { 335 | "name": "string.quoted.multi.python" 336 | } 337 | }, 338 | "patterns": [ 339 | { 340 | "include": "text.html.jinja" 341 | } 342 | ] 343 | }, 344 | { 345 | "contentName": "meta.embedded.inline.css", 346 | "begin": "(:) ((((\\w+)(\\.))?(css|style|styles))|((\")(css|style|styles)(\"))|((')(css|style|styles)('))) (=) ([bBrRuU]?f?)(\"{3})", 347 | "beginCaptures": { 348 | "1": { 349 | "name": "punctuation.separator.colon.python" 350 | }, 351 | "5": { 352 | "name": "source.python" 353 | }, 354 | "6": { 355 | "name": "punctuation.separator.period.python" 356 | }, 357 | "7": { 358 | "name": "meta.attribute.python" 359 | }, 360 | "9": { 361 | "name": "string.quoted.single.python" 362 | }, 363 | "10": { 364 | "name": "string.quoted.single.python" 365 | }, 366 | "11": { 367 | "name": "string.quoted.single.python" 368 | }, 369 | "13": { 370 | "name": "string.quoted.single.python" 371 | }, 372 | "14": { 373 | "name": "string.quoted.single.python" 374 | }, 375 | "15": { 376 | "name": "string.quoted.single.python" 377 | }, 378 | "16": { 379 | "name": "keyword.operator.assignment.python" 380 | }, 381 | "17": { 382 | "name": "storage.type.string.python" 383 | }, 384 | "18": { 385 | "name": "string.quoted.multi.python" 386 | } 387 | }, 388 | "end": "(\"{3})", 389 | "endCaptures": { 390 | "1": { 391 | "name": "string.quoted.multi.python" 392 | } 393 | }, 394 | "patterns": [ 395 | { 396 | "include": "source.css" 397 | } 398 | ] 399 | }, 400 | { 401 | "contentName": "meta.embedded.inline.scss", 402 | "begin": "(:) ((((\\w+)(\\.))?(scss))|((\")(scss)(\"))|((')(scss)('))) (=) ([bBrRuU]?f?)(\"{3})", 403 | "beginCaptures": { 404 | "1": { 405 | "name": "punctuation.separator.colon.python" 406 | }, 407 | "5": { 408 | "name": "source.python" 409 | }, 410 | "6": { 411 | "name": "punctuation.separator.period.python" 412 | }, 413 | "7": { 414 | "name": "meta.attribute.python" 415 | }, 416 | "9": { 417 | "name": "string.quoted.single.python" 418 | }, 419 | "10": { 420 | "name": "string.quoted.single.python" 421 | }, 422 | "11": { 423 | "name": "string.quoted.single.python" 424 | }, 425 | "13": { 426 | "name": "string.quoted.single.python" 427 | }, 428 | "14": { 429 | "name": "string.quoted.single.python" 430 | }, 431 | "15": { 432 | "name": "string.quoted.single.python" 433 | }, 434 | "16": { 435 | "name": "keyword.operator.assignment.python" 436 | }, 437 | "17": { 438 | "name": "storage.type.string.python" 439 | }, 440 | "18": { 441 | "name": "string.quoted.multi.python" 442 | } 443 | }, 444 | "end": "(\"{3})", 445 | "endCaptures": { 446 | "1": { 447 | "name": "string.quoted.multi.python" 448 | } 449 | }, 450 | "patterns": [ 451 | { 452 | "include": "source.css.scss" 453 | } 454 | ] 455 | }, 456 | { 457 | "contentName": "meta.embedded.inline.less", 458 | "begin": "(:) ((((\\w+)(\\.))?(less))|((\")(less)(\"))|((')(less)('))) (=) ([bBrRuU]?f?)(\"{3})", 459 | "beginCaptures": { 460 | "1": { 461 | "name": "punctuation.separator.colon.python" 462 | }, 463 | "5": { 464 | "name": "source.python" 465 | }, 466 | "6": { 467 | "name": "punctuation.separator.period.python" 468 | }, 469 | "7": { 470 | "name": "meta.attribute.python" 471 | }, 472 | "9": { 473 | "name": "string.quoted.single.python" 474 | }, 475 | "10": { 476 | "name": "string.quoted.single.python" 477 | }, 478 | "11": { 479 | "name": "string.quoted.single.python" 480 | }, 481 | "13": { 482 | "name": "string.quoted.single.python" 483 | }, 484 | "14": { 485 | "name": "string.quoted.single.python" 486 | }, 487 | "15": { 488 | "name": "string.quoted.single.python" 489 | }, 490 | "16": { 491 | "name": "keyword.operator.assignment.python" 492 | }, 493 | "17": { 494 | "name": "storage.type.string.python" 495 | }, 496 | "18": { 497 | "name": "string.quoted.multi.python" 498 | } 499 | }, 500 | "end": "(\"{3})", 501 | "endCaptures": { 502 | "1": { 503 | "name": "string.quoted.multi.python" 504 | } 505 | }, 506 | "patterns": [ 507 | { 508 | "include": "source.css.less" 509 | } 510 | ] 511 | }, 512 | { 513 | "contentName": "meta.embedded.inline.sass", 514 | "begin": "(:) ((((\\w+)(\\.))?(sass))|((\")(sass)(\"))|((')(sass)('))) (=) ([bBrRuU]?f?)(\"{3})", 515 | "beginCaptures": { 516 | "1": { 517 | "name": "punctuation.separator.colon.python" 518 | }, 519 | "5": { 520 | "name": "source.python" 521 | }, 522 | "6": { 523 | "name": "punctuation.separator.period.python" 524 | }, 525 | "7": { 526 | "name": "meta.attribute.python" 527 | }, 528 | "9": { 529 | "name": "string.quoted.single.python" 530 | }, 531 | "10": { 532 | "name": "string.quoted.single.python" 533 | }, 534 | "11": { 535 | "name": "string.quoted.single.python" 536 | }, 537 | "13": { 538 | "name": "string.quoted.single.python" 539 | }, 540 | "14": { 541 | "name": "string.quoted.single.python" 542 | }, 543 | "15": { 544 | "name": "string.quoted.single.python" 545 | }, 546 | "16": { 547 | "name": "keyword.operator.assignment.python" 548 | }, 549 | "17": { 550 | "name": "storage.type.string.python" 551 | }, 552 | "18": { 553 | "name": "string.quoted.multi.python" 554 | } 555 | }, 556 | "end": "(\"{3})", 557 | "endCaptures": { 558 | "1": { 559 | "name": "string.quoted.multi.python" 560 | } 561 | }, 562 | "patterns": [ 563 | { 564 | "include": "source.sass" 565 | } 566 | ] 567 | }, 568 | { 569 | "contentName": "meta.embedded.inline.stylus", 570 | "begin": "(:) ((((\\w+)(\\.))?(stylus))|((\")(stylus)(\"))|((')(stylus)('))) (=) ([bBrRuU]?f?)(\"{3})", 571 | "beginCaptures": { 572 | "1": { 573 | "name": "punctuation.separator.colon.python" 574 | }, 575 | "5": { 576 | "name": "source.python" 577 | }, 578 | "6": { 579 | "name": "punctuation.separator.period.python" 580 | }, 581 | "7": { 582 | "name": "meta.attribute.python" 583 | }, 584 | "9": { 585 | "name": "string.quoted.single.python" 586 | }, 587 | "10": { 588 | "name": "string.quoted.single.python" 589 | }, 590 | "11": { 591 | "name": "string.quoted.single.python" 592 | }, 593 | "13": { 594 | "name": "string.quoted.single.python" 595 | }, 596 | "14": { 597 | "name": "string.quoted.single.python" 598 | }, 599 | "15": { 600 | "name": "string.quoted.single.python" 601 | }, 602 | "16": { 603 | "name": "keyword.operator.assignment.python" 604 | }, 605 | "17": { 606 | "name": "storage.type.string.python" 607 | }, 608 | "18": { 609 | "name": "string.quoted.multi.python" 610 | } 611 | }, 612 | "end": "(\"{3})", 613 | "endCaptures": { 614 | "1": { 615 | "name": "string.quoted.multi.python" 616 | } 617 | }, 618 | "patterns": [ 619 | { 620 | "include": "source.stylus" 621 | } 622 | ] 623 | }, 624 | { 625 | "contentName": "meta.embedded.inline.js", 626 | "begin": "(:) ((((\\w+)(\\.))?(javascript|js))|((\")(javascript|js)(\"))|((')(javascript|js)('))) (=) ([bBrRuU]?f?)(\"{3})", 627 | "beginCaptures": { 628 | "1": { 629 | "name": "punctuation.separator.colon.python" 630 | }, 631 | "5": { 632 | "name": "source.python" 633 | }, 634 | "6": { 635 | "name": "punctuation.separator.period.python" 636 | }, 637 | "7": { 638 | "name": "meta.attribute.python" 639 | }, 640 | "9": { 641 | "name": "string.quoted.single.python" 642 | }, 643 | "10": { 644 | "name": "string.quoted.single.python" 645 | }, 646 | "11": { 647 | "name": "string.quoted.single.python" 648 | }, 649 | "13": { 650 | "name": "string.quoted.single.python" 651 | }, 652 | "14": { 653 | "name": "string.quoted.single.python" 654 | }, 655 | "15": { 656 | "name": "string.quoted.single.python" 657 | }, 658 | "16": { 659 | "name": "keyword.operator.assignment.python" 660 | }, 661 | "17": { 662 | "name": "storage.type.string.python" 663 | }, 664 | "18": { 665 | "name": "string.quoted.multi.python" 666 | } 667 | }, 668 | "end": "(\"{3})", 669 | "endCaptures": { 670 | "1": { 671 | "name": "string.quoted.multi.python" 672 | } 673 | }, 674 | "patterns": [ 675 | { 676 | "include": "source.js" 677 | } 678 | ] 679 | }, 680 | { 681 | "contentName": "meta.embedded.inline.jsx", 682 | "begin": "(:) ((((\\w+)(\\.))?(javascriptreact|react|jsx))|((\")(javascriptreact|react|jsx)(\"))|((')(javascriptreact|react|jsx)('))) (=) ([bBrRuU]?f?)(\"{3})", 683 | "beginCaptures": { 684 | "1": { 685 | "name": "punctuation.separator.colon.python" 686 | }, 687 | "5": { 688 | "name": "source.python" 689 | }, 690 | "6": { 691 | "name": "punctuation.separator.period.python" 692 | }, 693 | "7": { 694 | "name": "meta.attribute.python" 695 | }, 696 | "9": { 697 | "name": "string.quoted.single.python" 698 | }, 699 | "10": { 700 | "name": "string.quoted.single.python" 701 | }, 702 | "11": { 703 | "name": "string.quoted.single.python" 704 | }, 705 | "13": { 706 | "name": "string.quoted.single.python" 707 | }, 708 | "14": { 709 | "name": "string.quoted.single.python" 710 | }, 711 | "15": { 712 | "name": "string.quoted.single.python" 713 | }, 714 | "16": { 715 | "name": "keyword.operator.assignment.python" 716 | }, 717 | "17": { 718 | "name": "storage.type.string.python" 719 | }, 720 | "18": { 721 | "name": "string.quoted.multi.python" 722 | } 723 | }, 724 | "end": "(\"{3})", 725 | "endCaptures": { 726 | "1": { 727 | "name": "string.quoted.multi.python" 728 | } 729 | }, 730 | "patterns": [ 731 | { 732 | "include": "source.js.jsx" 733 | } 734 | ] 735 | }, 736 | { 737 | "contentName": "meta.embedded.inline.ts", 738 | "begin": "(:) ((((\\w+)(\\.))?(typescript|ts))|((\")(typescript|ts)(\"))|((')(typescript|ts)('))) (=) ([bBrRuU]?f?)(\"{3})", 739 | "beginCaptures": { 740 | "1": { 741 | "name": "punctuation.separator.colon.python" 742 | }, 743 | "5": { 744 | "name": "source.python" 745 | }, 746 | "6": { 747 | "name": "punctuation.separator.period.python" 748 | }, 749 | "7": { 750 | "name": "meta.attribute.python" 751 | }, 752 | "9": { 753 | "name": "string.quoted.single.python" 754 | }, 755 | "10": { 756 | "name": "string.quoted.single.python" 757 | }, 758 | "11": { 759 | "name": "string.quoted.single.python" 760 | }, 761 | "13": { 762 | "name": "string.quoted.single.python" 763 | }, 764 | "14": { 765 | "name": "string.quoted.single.python" 766 | }, 767 | "15": { 768 | "name": "string.quoted.single.python" 769 | }, 770 | "16": { 771 | "name": "keyword.operator.assignment.python" 772 | }, 773 | "17": { 774 | "name": "storage.type.string.python" 775 | }, 776 | "18": { 777 | "name": "string.quoted.multi.python" 778 | } 779 | }, 780 | "end": "(\"{3})", 781 | "endCaptures": { 782 | "1": { 783 | "name": "string.quoted.multi.python" 784 | } 785 | }, 786 | "patterns": [ 787 | { 788 | "include": "source.ts" 789 | } 790 | ] 791 | }, 792 | { 793 | "contentName": "meta.embedded.inline.tsx", 794 | "begin": "(:) ((((\\w+)(\\.))?(typescriptreact|tsx))|((\")(typescriptreact|tsx)(\"))|((')(typescriptreact|tsx)('))) (=) ([bBrRuU]?f?)(\"{3})", 795 | "beginCaptures": { 796 | "1": { 797 | "name": "punctuation.separator.colon.python" 798 | }, 799 | "5": { 800 | "name": "source.python" 801 | }, 802 | "6": { 803 | "name": "punctuation.separator.period.python" 804 | }, 805 | "7": { 806 | "name": "meta.attribute.python" 807 | }, 808 | "9": { 809 | "name": "string.quoted.single.python" 810 | }, 811 | "10": { 812 | "name": "string.quoted.single.python" 813 | }, 814 | "11": { 815 | "name": "string.quoted.single.python" 816 | }, 817 | "13": { 818 | "name": "string.quoted.single.python" 819 | }, 820 | "14": { 821 | "name": "string.quoted.single.python" 822 | }, 823 | "15": { 824 | "name": "string.quoted.single.python" 825 | }, 826 | "16": { 827 | "name": "keyword.operator.assignment.python" 828 | }, 829 | "17": { 830 | "name": "storage.type.string.python" 831 | }, 832 | "18": { 833 | "name": "string.quoted.multi.python" 834 | } 835 | }, 836 | "end": "(\"{3})", 837 | "endCaptures": { 838 | "1": { 839 | "name": "string.quoted.multi.python" 840 | } 841 | }, 842 | "patterns": [ 843 | { 844 | "include": "source.tsx" 845 | } 846 | ] 847 | }, 848 | { 849 | "contentName": "meta.embedded.inline.coffeescript", 850 | "begin": "(:) ((((\\w+)(\\.))?(coffeescript|coffee))|((\")(coffeescript|coffee)(\"))|((')(coffeescript|coffee)('))) (=) ([bBrRuU]?f?)(\"{3})", 851 | "beginCaptures": { 852 | "1": { 853 | "name": "punctuation.separator.colon.python" 854 | }, 855 | "5": { 856 | "name": "source.python" 857 | }, 858 | "6": { 859 | "name": "punctuation.separator.period.python" 860 | }, 861 | "7": { 862 | "name": "meta.attribute.python" 863 | }, 864 | "9": { 865 | "name": "string.quoted.single.python" 866 | }, 867 | "10": { 868 | "name": "string.quoted.single.python" 869 | }, 870 | "11": { 871 | "name": "string.quoted.single.python" 872 | }, 873 | "13": { 874 | "name": "string.quoted.single.python" 875 | }, 876 | "14": { 877 | "name": "string.quoted.single.python" 878 | }, 879 | "15": { 880 | "name": "string.quoted.single.python" 881 | }, 882 | "16": { 883 | "name": "keyword.operator.assignment.python" 884 | }, 885 | "17": { 886 | "name": "storage.type.string.python" 887 | }, 888 | "18": { 889 | "name": "string.quoted.multi.python" 890 | } 891 | }, 892 | "end": "(\"{3})", 893 | "endCaptures": { 894 | "1": { 895 | "name": "string.quoted.multi.python" 896 | } 897 | }, 898 | "patterns": [ 899 | { 900 | "include": "source.coffee" 901 | } 902 | ] 903 | }, 904 | { 905 | "contentName": "meta.embedded.inline.sql", 906 | "begin": "(:) ((((\\w+)(\\.))?(sql))|((\")(sql)(\"))|((')(sql)('))) (=) ([bBrRuU]?f?)(\"{3})", 907 | "beginCaptures": { 908 | "1": { 909 | "name": "punctuation.separator.colon.python" 910 | }, 911 | "5": { 912 | "name": "source.python" 913 | }, 914 | "6": { 915 | "name": "punctuation.separator.period.python" 916 | }, 917 | "7": { 918 | "name": "meta.attribute.python" 919 | }, 920 | "9": { 921 | "name": "string.quoted.single.python" 922 | }, 923 | "10": { 924 | "name": "string.quoted.single.python" 925 | }, 926 | "11": { 927 | "name": "string.quoted.single.python" 928 | }, 929 | "13": { 930 | "name": "string.quoted.single.python" 931 | }, 932 | "14": { 933 | "name": "string.quoted.single.python" 934 | }, 935 | "15": { 936 | "name": "string.quoted.single.python" 937 | }, 938 | "16": { 939 | "name": "keyword.operator.assignment.python" 940 | }, 941 | "17": { 942 | "name": "storage.type.string.python" 943 | }, 944 | "18": { 945 | "name": "string.quoted.multi.python" 946 | } 947 | }, 948 | "end": "(\"{3})", 949 | "endCaptures": { 950 | "1": { 951 | "name": "string.quoted.multi.python" 952 | } 953 | }, 954 | "patterns": [ 955 | { 956 | "include": "source.sql" 957 | } 958 | ] 959 | }, 960 | { 961 | "contentName": "meta.embedded.inline.json", 962 | "begin": "(:) ((((\\w+)(\\.))?(json))|((\")(json)(\"))|((')(json)('))) (=) ([bBrRuU]?f?)(\"{3})", 963 | "beginCaptures": { 964 | "1": { 965 | "name": "punctuation.separator.colon.python" 966 | }, 967 | "5": { 968 | "name": "source.python" 969 | }, 970 | "6": { 971 | "name": "punctuation.separator.period.python" 972 | }, 973 | "7": { 974 | "name": "meta.attribute.python" 975 | }, 976 | "9": { 977 | "name": "string.quoted.single.python" 978 | }, 979 | "10": { 980 | "name": "string.quoted.single.python" 981 | }, 982 | "11": { 983 | "name": "string.quoted.single.python" 984 | }, 985 | "13": { 986 | "name": "string.quoted.single.python" 987 | }, 988 | "14": { 989 | "name": "string.quoted.single.python" 990 | }, 991 | "15": { 992 | "name": "string.quoted.single.python" 993 | }, 994 | "16": { 995 | "name": "keyword.operator.assignment.python" 996 | }, 997 | "17": { 998 | "name": "storage.type.string.python" 999 | }, 1000 | "18": { 1001 | "name": "string.quoted.multi.python" 1002 | } 1003 | }, 1004 | "end": "(\"{3})", 1005 | "endCaptures": { 1006 | "1": { 1007 | "name": "string.quoted.multi.python" 1008 | } 1009 | }, 1010 | "patterns": [ 1011 | { 1012 | "include": "source.json" 1013 | } 1014 | ] 1015 | }, 1016 | { 1017 | "contentName": "meta.embedded.inline.yaml", 1018 | "begin": "(:) ((((\\w+)(\\.))?(yaml))|((\")(yaml)(\"))|((')(yaml)('))) (=) ([bBrRuU]?f?)(\"{3})", 1019 | "beginCaptures": { 1020 | "1": { 1021 | "name": "punctuation.separator.colon.python" 1022 | }, 1023 | "5": { 1024 | "name": "source.python" 1025 | }, 1026 | "6": { 1027 | "name": "punctuation.separator.period.python" 1028 | }, 1029 | "7": { 1030 | "name": "meta.attribute.python" 1031 | }, 1032 | "9": { 1033 | "name": "string.quoted.single.python" 1034 | }, 1035 | "10": { 1036 | "name": "string.quoted.single.python" 1037 | }, 1038 | "11": { 1039 | "name": "string.quoted.single.python" 1040 | }, 1041 | "13": { 1042 | "name": "string.quoted.single.python" 1043 | }, 1044 | "14": { 1045 | "name": "string.quoted.single.python" 1046 | }, 1047 | "15": { 1048 | "name": "string.quoted.single.python" 1049 | }, 1050 | "16": { 1051 | "name": "keyword.operator.assignment.python" 1052 | }, 1053 | "17": { 1054 | "name": "storage.type.string.python" 1055 | }, 1056 | "18": { 1057 | "name": "string.quoted.multi.python" 1058 | } 1059 | }, 1060 | "end": "(\"{3})", 1061 | "endCaptures": { 1062 | "1": { 1063 | "name": "string.quoted.multi.python" 1064 | } 1065 | }, 1066 | "patterns": [ 1067 | { 1068 | "include": "source.yaml" 1069 | } 1070 | ] 1071 | }, 1072 | { 1073 | "contentName": "meta.embedded.inline.graphql", 1074 | "begin": "(:) ((((\\w+)(\\.))?(graphql))|((\")(graphql)(\"))|((')(graphql)('))) (=) ([bBrRuU]?f?)(\"{3})", 1075 | "beginCaptures": { 1076 | "1": { 1077 | "name": "punctuation.separator.colon.python" 1078 | }, 1079 | "5": { 1080 | "name": "source.python" 1081 | }, 1082 | "6": { 1083 | "name": "punctuation.separator.period.python" 1084 | }, 1085 | "7": { 1086 | "name": "meta.attribute.python" 1087 | }, 1088 | "9": { 1089 | "name": "string.quoted.single.python" 1090 | }, 1091 | "10": { 1092 | "name": "string.quoted.single.python" 1093 | }, 1094 | "11": { 1095 | "name": "string.quoted.single.python" 1096 | }, 1097 | "13": { 1098 | "name": "string.quoted.single.python" 1099 | }, 1100 | "14": { 1101 | "name": "string.quoted.single.python" 1102 | }, 1103 | "15": { 1104 | "name": "string.quoted.single.python" 1105 | }, 1106 | "16": { 1107 | "name": "keyword.operator.assignment.python" 1108 | }, 1109 | "17": { 1110 | "name": "storage.type.string.python" 1111 | }, 1112 | "18": { 1113 | "name": "string.quoted.multi.python" 1114 | } 1115 | }, 1116 | "end": "(\"{3})", 1117 | "endCaptures": { 1118 | "1": { 1119 | "name": "string.quoted.multi.python" 1120 | } 1121 | }, 1122 | "patterns": [ 1123 | { 1124 | "include": "source.graphql" 1125 | } 1126 | ] 1127 | }, 1128 | { 1129 | "contentName": "meta.embedded.inline.xml", 1130 | "begin": "(:) ((((\\w+)(\\.))?(xml))|((\")(xml)(\"))|((')(xml)('))) (=) ([bBrRuU]?f?)(\"{3})", 1131 | "beginCaptures": { 1132 | "1": { 1133 | "name": "punctuation.separator.colon.python" 1134 | }, 1135 | "5": { 1136 | "name": "source.python" 1137 | }, 1138 | "6": { 1139 | "name": "punctuation.separator.period.python" 1140 | }, 1141 | "7": { 1142 | "name": "meta.attribute.python" 1143 | }, 1144 | "9": { 1145 | "name": "string.quoted.single.python" 1146 | }, 1147 | "10": { 1148 | "name": "string.quoted.single.python" 1149 | }, 1150 | "11": { 1151 | "name": "string.quoted.single.python" 1152 | }, 1153 | "13": { 1154 | "name": "string.quoted.single.python" 1155 | }, 1156 | "14": { 1157 | "name": "string.quoted.single.python" 1158 | }, 1159 | "15": { 1160 | "name": "string.quoted.single.python" 1161 | }, 1162 | "16": { 1163 | "name": "keyword.operator.assignment.python" 1164 | }, 1165 | "17": { 1166 | "name": "storage.type.string.python" 1167 | }, 1168 | "18": { 1169 | "name": "string.quoted.multi.python" 1170 | } 1171 | }, 1172 | "end": "(\"{3})", 1173 | "endCaptures": { 1174 | "1": { 1175 | "name": "string.quoted.multi.python" 1176 | } 1177 | }, 1178 | "patterns": [ 1179 | { 1180 | "include": "text.xml" 1181 | } 1182 | ] 1183 | }, 1184 | { 1185 | "contentName": "meta.embedded.inline.python", 1186 | "begin": "(:) ((((\\w+)(\\.))?(python))|((\")(python)(\"))|((')(python)('))) (=) ([bBrRuU]?f?)(\"{3})", 1187 | "beginCaptures": { 1188 | "1": { 1189 | "name": "punctuation.separator.colon.python" 1190 | }, 1191 | "5": { 1192 | "name": "source.python" 1193 | }, 1194 | "6": { 1195 | "name": "punctuation.separator.period.python" 1196 | }, 1197 | "7": { 1198 | "name": "meta.attribute.python" 1199 | }, 1200 | "9": { 1201 | "name": "string.quoted.single.python" 1202 | }, 1203 | "10": { 1204 | "name": "string.quoted.single.python" 1205 | }, 1206 | "11": { 1207 | "name": "string.quoted.single.python" 1208 | }, 1209 | "13": { 1210 | "name": "string.quoted.single.python" 1211 | }, 1212 | "14": { 1213 | "name": "string.quoted.single.python" 1214 | }, 1215 | "15": { 1216 | "name": "string.quoted.single.python" 1217 | }, 1218 | "16": { 1219 | "name": "keyword.operator.assignment.python" 1220 | }, 1221 | "17": { 1222 | "name": "storage.type.string.python" 1223 | }, 1224 | "18": { 1225 | "name": "string.quoted.multi.python" 1226 | } 1227 | }, 1228 | "end": "(\"{3})", 1229 | "endCaptures": { 1230 | "1": { 1231 | "name": "string.quoted.multi.python" 1232 | } 1233 | }, 1234 | "patterns": [ 1235 | { 1236 | "include": "source.python" 1237 | } 1238 | ] 1239 | } 1240 | ] 1241 | } --------------------------------------------------------------------------------