Coder Social home page Coder Social logo

dhakan-k / gatsby-remark-embed-markdown Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtstodola/gatsby-remark-embed-markdown

0.0 0.0 1.0 84 KB

Gatsby plugin to embed markdown fragments within markdown

License: Apache License 2.0

JavaScript 100.00%

gatsby-remark-embed-markdown's Introduction

gatsby-remark-embed-markdown

Embeds the content of a specified markdown file as HTML within another markdown file.

Overview

Embedding Files

For example, given the following project directory structure:

./examples/
├── sample-markdown-file.md

Example of contents in /examples/sample-markdown-file.md:

## This is an example of an embedded markdown fragment.

The following markdown syntax is used to embed the contents of these files:

# Sample Markdown

`markdown:sample-markdown-file.md`

The resulting HTML for the above markdown would look something like this:

<h1>Sample Markdown</h1>
<div class="markdown-fragment">
  <h2>This is an example of an embedded markdown fragment.</h2>
</div>

Installation

npm install --save gatsby-remark-embed-markdown

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: "gatsby-remark-embed-markdown",
            options: {
              // Example code links are relative to this dir.
              // eg examples/path/to/file.js
              directory: `${__dirname}/examples/`,
            }
          }
        ]
      }
    }
  ]
}

If you are looking to embed markdown in a code block, look into the gatsby-remark-embed-snippet plugin.

gatsby-remark-embed-markdown's People

Contributors

dhakan-k avatar

Forkers

ziadsawalha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.