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

mdit-plugin-callouts

v1.2.0

Published

[![NPM version](https://img.shields.io/npm/v/mdit-plugin-callouts?color=a1b858&label=)](https://www.npmjs.com/package/mdit-plugin-callouts)

Downloads

146

Readme

mdit plugin callouts

NPM version

This is a plugin for vite that support callout blocks. The callout block is inspired by Obsidian.

Example

For more examples, view them on my personal blog.

Installation

Step 1. Install the plugin

Install the plugin with npm/yarn/pnpm.

npm install mdit-plugin-callouts

Import it into vite.config.ts

// vite.config.ts
import CalloutPlugin from 'mdit-plugin-callouts'
export default defineConfig({
  plugins: [
    Markdown({
      // ...
      markdownItSetup(md) {
        md.use(CalloutPlugin)
      }
    })
  ]
})

Step 2. Import css

Import css into the entry file main.ts

// main.ts
import 'mdit-plugin-callouts/index.css'

If you are using vitepress, you should notice the docs. You are supposed to import the css file in docs/.vitepress/theme/index.ts, not in docs/.vitepress/config.ts.

// docs/.vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme'
import 'mdit-plugin-callouts/index.css' // <-- css files should be imported here

export default {
  ...DefaultTheme,
  enhanceApp({ app }) {
    // ...
  },
}

If you prefer the style of vitepress, you can change it into

import 'mdit-plugin-callouts/vp.css'

Usage

Basic usage.

> [!note] This is a note
> This is the body of callout block.
>
> You can write more lines.

If you do not want the callout body, just write the title, and the fold icon will be hidden.

> [!tip] Callout without body

All of the callout blocks are expanded by default, except the example block. However, you can change it mannually. If you want to fold the block by default, you can write open or closed in the options.

> [!info|closed] The block will be folded by default.
> You can click the header to expand it.

The following callout types are supported.

|Type |Aliases| |-------|-------| |note |note, seealso| |abstract |abstract, summary, tldr| |info |info, todo| |tip |tip, hint, important| |success |success, check, done| |question |question, help, faq| |warning |warning, caution, attention| |failure |failure, fail, missing| |danger |danger, error| |bug |bug| |example |example| |quote |quote, cite|

License

MIT License © 2022 widcardw