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

remark-code-title-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-code-title-polyfill

remark plugin to add titles to code blocks

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by19.23%
Maintainers
1
Weekly downloads
 
Created
Source

remark-code-title

preview badge

Remark plugin to add a title to code blocks.

Inspired by:

  • gatsby-remark-code-titles
  • remark-code-titles [currently not maintained]

Demos

AstroNext.js
 Open in StackBlitz  Open in StackBlitz

Installation

npm install remark-code-title

Usage

Given this markdown file example.md:

# Example

```js title="example.js"
console.log("Hello World");
```

And this script, example.js, using remark-code-title:

import codeTitle from "remark-code-title";
import html from "remark-html";
import { read } from "to-vfile";
import { remark } from "remark";

const processor = remark().use(codeTitle).use(html, { sanitize: false });
const markdown = await read("example.md");
const result = await processor.process(markdown);

Running node example.js yields:

<h1>Example</h1>
<div data-remark-code-title data-language="js">example.js</div>
<pre>
  <code>console.log("Hello World");</code>
</pre>

Keywords

FAQs

Package last updated on 27 Oct 2023

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