Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markyp-highlightjs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markyp-highlightjs

Highlight.js-based syntax highlighting for web pages built with markyp-html

  • 0.1910.0
  • PyPI
  • Socket score

Maintainers
1

Build Status Downloads Downloads Downloads

markyp-highlightjs

Highlight.js-based syntax highlighting for web pages built with markyp-html.

Installation

The project is listed on the Python Package Index, it can be installed simply by executing pip install markyp-highlightjs.

Getting started

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:

  • The selected theme (CSS) is added to the head of the document.
  • The syntax highlighted code is created using the highlight() method.
  • The JavaScript code that imports and initializes Highlight.js is added to the 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.

Community guidelines

In general, please treat each other with respect and follow the below guidelines to interact with the project:

  • Questions, feedback: Open an issue with a [Question] <issue-title> title.
  • Bug reports: Open an issue with a [Bug] <issue-title> title, an adequate description of the bug, and a code snippet that reproduces the issue if possible.
  • Feature requests and ideas: Open an issue with an [Enhancement] <issue-title> title and a clear description of the enhancement proposal.

Contribution guidelines

Every form of contribution is welcome, including documentation improvements, tests, bug fixes, and feature implementations.

Please follow these guidelines to contribute to the project:

  • Make sure your changes match the documentation and coding style of the project, including PEP 484 type annotations.
  • mypy is used to type-check the codebase, submitted code should not produce typing errors. See this page for more information on mypy.
  • Small fixes can be submitted simply by creating a pull request.
  • Non-trivial changes should have an associated issue in the issue tracker that commits must reference (typically by adding #refs <issue-id> to the end of commit messages).
  • Please write tests for the changes you make (if applicable).

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.

License - MIT

The library is open-sourced under the conditions of the MIT license.

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc