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

x-postpress-code

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

x-postpress-code

A web component used for code highlighting.

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
increased by7.14%
Maintainers
1
Weekly downloads
 
Created
Source

x-postpress-code

A web component used for code highlighting. Try it out at JS BIN.

Usage

Use the type attribute and include the source in the default slot with pre tags to render static content:

<x-postpress-code type="bash"><pre>
#/usr/bin/env bash
for file in *; do
  echo $file
done
</pre></x-postpress-code>

Lazy load the content to be highlighted by using both the type and src attributes:

<x-postpress-code
  src="https://example.com/example.js"
  type="js"
></x-postpress-code>

Installation

from unpkg:

<script
  src="https://unpkg.com/x-postpress-code"
  type="module"
></script>

from npm

npm i x-postpress-code
import 'x-postpress-code'

Uses the following highlight.js languages

  • bash
  • c
  • cpp
  • css
  • javascript
  • json
  • markdown
  • php
  • plaintext
  • python
  • shell
  • typescript
  • xml

Keywords

FAQs

Package last updated on 28 Nov 2022

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