1.0.2 • Published 5 years ago

docsify-admonition-plugin v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

docsify-admonition

docsify-admonition is a plugin for docsify.

Introduction

The docsify-admonition plugin is inspired by docsify-plugin-flexible-alerts and mkdocs-material.

Usage

First, inlcude below essential files:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="http://unpkg.com/docsify-admonition-plugin/build/admonition.css" />
<script src="http://unpkg.com/docsify-admonition-plugin/build/index.js"></script>

You can use it locally if you want, these files are all in build dir.

Then you can use below syntax:

> [!note][Header]
Note Content
>

> [!hint][Header]
Hint Content
>

> [!caution][Header]
Caution Content
>

> [!danger][Header]
Danger Content
>

> [!error][Header]
Error Content
>

> [!Attention][Header]
Attention Content
>

default

Configuration

As you can see, The default configuration will show labels like note, hint. To hidden these labels, you need to do this:

window.$docsify = {
      // ...
      admonition: {
        labelVisibility: 'hidden'
      }
      //, ...
}

After doing that, you'll see:

without-label

Attention

You can use ] in header, since we use ] to check the end of header! If you want to use ] in header you can use &#93; instead of ].

License

MIT.