![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@vcarl/remark-headings
Advanced tools
Remark plugin to extract heading metadata while processing markdown files
A remark plugin to add metadata about headings to the parsed output.
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
yarn add @vcarl/remark-headings
Running:
import remarkHeadings from '@vcarl/remark-headings';
import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
const processor = unified()
.use(remarkParse)
.use(remarkStringify)
.use(remarkHeadings);
const input = fs.readFileSync("input.md");
/*
# Heading 1
## Heading 2
### Heading 3
*/
const vfile = await processor.process(input);
console.log(vfile.data.headings)
Yields:
[
{"depth": 1, "value": "Heading 1"},
{"depth": 2, "value": "Heading 2"},
{"depth": 3, "value": "Heading 3"},
]
As a courtesy, any other data found to be attached to the node by other plugins will be forwarded through. For instance if you're using remark-heading-id
, that custom ID will look like:
[
{"depth": 1, "value": "Heading 1", "data": {"id": "custom-id"}},
{"depth": 2, "value": "Heading 2"},
{"depth": 3, "value": "Heading 3"},
]
[MIT][license] © [Carl Vitullo][author]
FAQs
Remark plugin to extract heading metadata while processing markdown files
The npm package @vcarl/remark-headings receives a total of 6,399 weekly downloads. As such, @vcarl/remark-headings popularity was classified as popular.
We found that @vcarl/remark-headings demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.