0.0.1 • Published 2 years ago

vitepress-plugin-callout v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vitepress-plugin-callout (WIP)

NPM version

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

Some examples

examples

Installation

Install the plugin with npm.

npm install vitepress-plugin-callout

Then import it into vitepress

// .vitepress/config.ts
import callout from 'vitepress-plugin-callout'
export default {
  markdown: {
    config: (md: markdownit) => {
      md.use(callout)
    }
  }
}

Import styles (I have no idea how to build css files into dist, so try to download it from github and import mannually ¯\_(ツ)_/¯)

// .vitepress/theme/index.ts
import 'path/to/styles.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.

TypeAliases
notenote, seealso
abstractabstract, summary, tldr
infoinfo, todo
tiptip, hint, important
successsuccess, check, done
questionquestion, help, faq
warningwarning, caution, attention
failurefailure, fail, missing
dangerdanger, error
bugbug
exampleexample
quotequote, cite

Repo template

antfu/starter-ts

License

MIT License © 2022 widcardw