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

gatsby-remark-blocks

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

gatsby-remark-blocks

Plugin for gatsby-transformer-remark to wrap Markdown elements in HTML divs

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Gatsby Remark Blocks

A plugin for gatsby-transformer-remark to frame Markdown AST (mdast) elements in an HTML div, creating a block in the layout.

You might want blocks if you're working on a novel layout where content is on one cohesive grid system, but positioned at different x/y positions and at different widths/heights.

Input:

# Hello, World!

Output:

<div class="markdown-heading">
    <h1>Hello, World!</h1>
</div>

Getting Started

Install with npm:

npm i gatsby-remark-blocks -S

Add to the config-gatsby.js file:

module.exports = { 
    plugins: [
        {
            resolve: 'gatsby-transformer-remark',
            options: {
                plugins: [
                    'gatsby-remark-blocks',
                    ...
                ]
            }
        }
    ]
}

Config

If you want to change the default CSS class names, add the custom class names to the plugin options:

module.exports = { 
    plugins: [
        {
            resolve: 'gatsby-transformer-remark',
            options: {
                plugins: [
                    {
                        resolve: 'gatsby-remark-blocks',
                        options: {
                            classNames: {
                                heading: 'custom-heading',
                                list: 'custom-list',
                                orderedList: 'custom-ordered-list',
                                unorderedList: 'custom-unordered-list',
                                blockquote: 'custom-blockquote',
                                paragraph: 'custom-paragraph',
                            },
                        },
                    },
                    ...
                ]
            }
        }
    ]
}

Copyright 2020 Patrick Burtchaell

Keywords

FAQs

Package last updated on 18 Mar 2020

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