npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remark-blockquotes

v1.0.0

Published

Add custom blockquotes to your markdown documents on your remark instance

Downloads

2

Readme

remark-blockquotes

Add custom blockquotes to your markdown. This package is intended to work over remark using mdast
It is based on the GFM implementation: https://github.com/orgs/community/discussions/16925

Installation

npm i remark-blockquotes

Usage

Block Types

Note block

This block is intended to be used for notes, tips, etc. If the block type specified does not exist, it will be rendered as a note block.

> **Note** \
> Lorem ipsum

Will be transformed to:

<blockquote class="blockquote blockquote--note" data-type="note" data-original-title="Note">
  <p>
    <span class="blockquote__header">
      <svg class="octicon octicon-info" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
        <path
          d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"
        ></path>
      </svg>
      <strong>Note</strong>
    </span>
    <br />
    Lorem ipsum
  </p>
</blockquote>

Warning block

This block is intended to be used for warnings, alerts, etc.

> **Warning** \
> Lorem ipsum

Will be transformed to:

<blockquote class="blockquote blockquote--warning" data-type="warning" data-original-title="Warning">
  <p>
    <span class="blockquote__header">
      <svg class="octicon octicon-info" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
        <path
          d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
        ></path>
      </svg>
      <strong>Warning</strong>
    </span>
    <br />
    Lorem ipsum
  </p>
</blockquote>

Error block

This block is intended to be used for errors, failures, etc.

> **Error**
> Lorem ipsum \
> Dolor sit amet

Will be transformed to:

<blockquote class="blockquote blockquote--error" data-type="error" data-original-title="Error">
  <p>
    <span class="blockquote__header">
      <svg
        class="octicon octicon-circle-slash"
        xmlns="http://www.w3.org/2000/svg"
        viewBox="0 0 16 16"
        width="16"
        height="16"
      >
        <path
          d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM3.965 13.096a6.5 6.5 0 0 0 9.131-9.131ZM1.5 8a6.474 6.474 0 0 0 1.404 4.035l9.131-9.131A6.499 6.499 0 0 0 1.5 8Z"
        ></path>
      </svg>
      <strong>Error</strong>
    </span>
    <br />
    Lorem ipsum <br />
    Dolor sit amet
  </p>
</blockquote>

Custom Header Message

You can also customize the header message by adding a custom header message after the block type between brackets.

> **Error[Ay mecachis]** \
> Lorem ipsum \
> Dolor sit amet

Adding the script

And our script looks as follows:

const remark = require('remark');

remark()
  .use(require('remark-blockquotes'))
  .use(require('remark-html'))
  .process(src, (err, file) => console.log(String(file)));