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

expressive-code-plugin-data-lang

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expressive-code-plugin-data-lang

Plugin to inject a data-lang attribute for Expressive Code, a text marking & annotation engine for presenting source code on the web.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

@expressive-code/plugin-collapsible-sections

A third-party plugin for Expressive Code, an engine for presenting source code on the web.

It adds a data-lang="<language>" attribute onto the root HTML element of the code block (usually the Frame <figure> element).

This can be styled with psuedo-elements to display the code block language to the website user.

HTML code block in a webpage, with "html" written in the bottom right corner

Example usage

// astro.config.js
import { defineConfig } from "astro/config";
import expressiveCode from "astro-expressive-code";
import { pluginDataLang } from "expressive-code-plugin-data-lang";

export default defineConfig({
  integrations: [
    expressiveCode({
      plugins: [pluginDataLang()],
    }),
  ],
});

Example CSS for showing the psuedo-element

.expressive-code .frame::after {
  content: attr(data-lang);
  position: absolute;
  right: 1em;
  bottom: 1em;
  opacity: 0.7;
}

Keywords

FAQs

Package last updated on 25 Mar 2024

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