docsify-admonition-plugin

1.0.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i docsify-admonition-plugin

Weekly Downloads

6

Version

1.0.2

License

ISC

Unpacked Size

244 kB

Total Files

10

Last publish

Collaborators

  • rayyh