Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.