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.
Highlight.js-based syntax highlighting for web pages built with markyp-html
Highlight.js-based syntax highlighting for web pages built with markyp-html.
The project is listed on the Python Package Index, it can be installed simply by executing pip install markyp-highlightjs
.
If you are not familiar with the basic concepts of markyp
, please start by having a look at its documentation here.
The following code shows the creation of a simple webpage that displays syntax highlighted Python code. There are three things to note in the example:
highlight()
method.javascript
section of the page.from markyp_html import webpage
from markyp_highlightjs import js, themes, highlight
code = "\n".join([
"from markyp_html import webpage",
"from markyp_highlightjs import js, themes, highlight",
"page = webpage(",
" highlight(\"import antigravity\", language=\"python\"),",
" page_title=\"markyp-highlightjs demo page\",",
" head_elements=[themes.darcula],",
" javascript=js.js",
")",
"",
"print(page)"
])
page = webpage(
highlight(code, language="python"),
page_title="markyp-highlightjs demo page",
head_elements=[themes.github],
javascript=js.js
)
print(page)
For more details on how this package works, please see markyp and markyp-html.
In general, please treat each other with respect and follow the below guidelines to interact with the project:
[Question] <issue-title>
title.[Bug] <issue-title>
title, an adequate description of the bug, and a code snippet that reproduces the issue if possible.[Enhancement] <issue-title>
title and a clear description of the enhancement proposal.Every form of contribution is welcome, including documentation improvements, tests, bug fixes, and feature implementations.
Please follow these guidelines to contribute to the project:
mypy
is used to type-check the codebase, submitted code should not produce typing errors. See this page for more information on mypy
.#refs <issue-id>
to the end of commit messages).If you have any questions about contributing to the project, please contact the project owner.
As mentioned in the contribution guidelines, the project is type-checked using mypy
, so first of all, the project must pass mypy
's static code analysis.
The project is tested using pytest
. The chosen test layout is that tests are outside the application code, see this page for details on what it means in practice.
If pytest
is installed, the test set can be executed using the pytest test
command from within the project directory.
If pytest-cov
is also installed, a test coverage report can be generated by executing pytest test --cov markyp_highlightjs
from the root directory of the project.
The library is open-sourced under the conditions of the MIT license.
FAQs
Highlight.js-based syntax highlighting for web pages built with markyp-html
We found that markyp-highlightjs 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.