Socket
Socket
Sign inDemoInstall

@hashicorp/remark-plugins

Package Overview
Dependencies
122
Maintainers
30
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashicorp/remark-plugins

A potpourri of remark plugins used to process .mdx files


Version published
Maintainers
30
Weekly downloads
1,379
decreased by-3.36%

Weekly downloads

Readme

Source

Deprecated: This repository has been archived, our remark plugins now live at hashicorp/web-platform-packages

HashiCorp Remark Plugins

A potpourri of remark plugins used by HashiCorp to process markdown files.

Overview

MDX uses remark internally to process and transform markdown via plugins. We use MDX to process markdown content to build out our docs, learning guides, and write rich content from our CMS. This set of plugins ensures that written markdown is translated properly into markup.

The anchorLinks plugin adds anchor links to headings and when a list begins with an inline code element so that users are able to easily link to a specific place even if it is further down the page. See its readme for more details.

Include Markdown

The includeMarkdown plugin gives authors the ability to use a directive like `@include "filename.md" to import markdown from a separate file, like a partial. See its readme for more details.

Custom Alerts

The paragraphCustomAlerts plugin adds a custom syntax for creating alert boxes. See its readme for more details. This plugin will be deprecated for a <Alert /> component in the future in a step to move us toward full commonmark compliance.

Typography

The typography plugin adds css classes to certain typographical elements so that they adhere to the typography standards from our design system. See its readme for more details.

Usage

Each of the plugins are individually exposed from the default export from this module and can be used as any other remark plugin would be normally. For example, with raw mdx:

const mdx = require('@mdx-js/mdx')
const {typography, anchorLinks} = require('@hashicorp/remark-plugins')

console.log(mdx.sync('some markdown content', {
  remarkPlugins: [typography, anchorLinks]
})

If you'd like to use all of the plugins in one shot, which is typically the case with this module, an array of all the plugins is returned from the allPlugins export, as such:

const mdx = require('@mdx-js/mdx')
const {allPlugins} = require('@hashicorp/remark-plugins')

console.log(mdx.sync('some markdown content', {
  remarkPlugins: allPlugins(/* options */)
})

Plugin options can be passed to allPlugins as an object, with the keys being plugin names. For example, to pass options to headingLinkable, you could call allPlugins({ headingLinkable: { foo: 'bar' } }).

If you are using next-hashicorp, all of these plugins will be included by default.

Publishing

To publish this package to npm, simply run npm run publish. This command will guide you through the versioning/publishing process.

Note: There is no build step when publishing this library. The consumer is expected to transpile the code appropriately.

FAQs

Last updated on 15 Nov 2022

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