Socket
Socket
Sign inDemoInstall

mdx-localized-headings

Package Overview
Dependencies
137
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mdx-localized-headings

[![CI](https://github.com/semoal/mdx-localized-headings/actions/workflows/main.yml/badge.svg)](https://github.com/semoal/mdx-localized-headings/actions/workflows/main.yml)


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Install size
11.5 MB
Created
Weekly downloads
 

Readme

Source

MDX/MD Localized Headings Transformation

CI

Inspiration

The inspiration to create this tool is basically that Docusaurus V2, introduces some heading id's to headers.

You can write an id for a heading, in that way it can be localized but the id will keep the same:

## Heading-1 {#heading-1}

They offered a tool to create these ids but what happens when you already have your documentation headings translated? Basically it creates the id based on the translated document, and not in the original.

This tool can pick an original markdown.mdx|md, save their headings ids and add them to the translated ones.

Usage

You can run it through a CLI:

npx mdx-localized-headings ./docs/base.mdx ./docs/translated.mdx

or run it through Node:

npm install mdx-localized-headings
# or use yarn
yarn add --dev mdx-localized-headings
import { transform } from "mdx-localized-headings"

await transform(path1, path2)

Contributing

Tests are implemented with uvu, and we use yarn as package manager:

yarn
yarn test

FAQs

Last updated on 23 Jul 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc