Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Type annotations for various languages, when applied to multi line strings will syntax
highlighting with the python-inline-source
VS Code plugin.
Supports html
, css
, javascript
, typescript
, sql
, graphql
,
multiple css extension languages, template languages and many more,
see below for a full list.
Uses typing.Annotated
to annotate the str
type with the language used. You can use
typing.get_type_hints
at runtime to determine the language that a string has been annotated with.
On Python versions prior to 3.9 uses typing_extensions to support Annotated
types.
pip install sourcetypes
Use a type decoration named for language that you are using:
import sourcetypes
my_html_string: sourcetypes.html = """
<h1>Some HTML</h1>
"""
or:
from sourcetypes import html
my_html_string: html = """
<h1>Some HTML</h1>
"""
markdown
(aliased as md
)html
django_html
(aliased as django
)django_txt
jinja
jinja_html
css
(aliased as style
, and styles
)scss
less
sass
stylus
javascript
(aliased as js
)jsx
(aliased as javascriptreact
, and react
)typescript
(aliased as ts
)tsx
(aliased as typescriptreact
)coffeescript
(aliased as coffee
)sql
json
yaml
graphql
xml
python
FAQs
Python Source Code Types For Inline Syntax Highlighting
We found that sourcetypes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.