Wondering what’s next for npm?Check out our public roadmap! »

    @hackclub/markdown

    0.0.1-alpha.0 • Public • Published

    @hackclub/markdown

    Render Markdown to HTML, Hack Club-style. Used primarily on the Hack Club Workshops site.

    Based on the Next.js documentation site.

    yarn add @hackclub/markdown
    # or npm i @hackclub/markdown 

    Usage

    This package does not include any frontend code, such as React or CSS.

    This package is designed for rendering at build or otherwise on a server, not client-side. Always use with await.

    import fs from 'fs'
    import md from '@hackclub/markdown'
     
    const getReadme = async () => (
      const text = fs.readFileSync('./README.md', 'utf8')
      return await md(text, '/README.md', '/static')
    )
    Param Default Description
    input Req’d! String. The Markdown text to transform.
    filePath '/README.md' String. The Markdown’s path (for fixing relative image links).
    imagePrefix '/' String. A prefix for the path to relative images.
    removeTitle false Bool. Remove starting h1 (if titles are rendered separately).

    We recommend using gray-matter alongside @hackclub/markdown for parsing frontmatter, but it’s not included in this package.

    MIT License

    Keywords

    none

    Install

    npm i @hackclub/markdown

    DownloadsWeekly Downloads

    11

    Version

    0.0.1-alpha.0

    License

    MIT

    Unpacked Size

    7.27 MB

    Total Files

    17

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar