Skip to content

Commit fba2889

Browse files
authored
Added new alert type 'IMPORTANT' along with some new aliases. (#44)
* Added new alert type 'IMPORTANT' along with some new aliases. * Updated some README content * Some build improvements
1 parent ef1ddf0 commit fba2889

File tree

12 files changed

+5668
-31
lines changed

12 files changed

+5668
-31
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ charset = utf-8
66
indent_style = space
77
end_of_line = lf
88

9-
[*.js]
9+
[{*.js,*.mjs}]
1010
insert_final_newline = true
1111
trim_trailing_whitespace = true
1212
indent_size = 2

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches:
55
- main
6+
pull_request:
7+
types: [opened, edited, reopened, review_requested]
68
jobs:
79
build:
810
runs-on: ubuntu-latest
@@ -12,7 +14,7 @@ jobs:
1214
- name: Setup Node
1315
uses: actions/setup-node@v2
1416
with:
15-
node-version: '16.x'
17+
node-version: '22.x'
1618
registry-url: 'https://registry.npmjs.org'
1719
- name: Install dependencies and build 🔧
1820
run: npm ci

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Setup Node
1212
uses: actions/setup-node@v2
1313
with:
14-
node-version: '16.x'
14+
node-version: '22.x'
1515
registry-url: 'https://registry.npmjs.org'
1616
- name: Install dependencies and build 🔧
1717
run: npm ci

.npmignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This docsify plugin converts blockquotes into beautiful alerts. Look and feel can be configured on a global as well as on an alert specific level so output does fit your needs (some examples are shown below). In addition, you can provide own alert types.
88

9-
![Sample alerts created with plugin 'flexible-alerts'](https://user-images.githubusercontent.com/44210522/93708131-10fb5780-fb34-11ea-85ae-e18b3e239f83.jpg)
9+
![Sample alerts created with plugin 'flexible-alerts'](./flexible-alerts.png)
1010

1111
## Installation and Usage
1212

@@ -21,9 +21,8 @@ Assuming you have a working [docsify](https://docsify.js.org) app set up, it is
2121
<script src="https://unpkg.com/docsify-plugin-flexible-alerts"></script>
2222
```
2323

24-
2. In docsify setup configure the plugin so it does fit your needs. A custom setup is not mandatory. By default, styles `flat` and `callout` (Default: `callout`) and types `NOTE`, `TIP`, `WARNING` and `ATTENTION` are supported.
25-
26-
You can change it using plugin configuration via `index.html` or for a single alert in your markdown files. (please see section `Customizations` for further details)
24+
2. In docsify setup configure the plugin so it does fit your needs. A custom setup is not mandatory. By default, styles `flat` and `callout` (Default: `callout`) and types `NOTE`, `TIP`, `WARNING`, `IMPORTANT` and `ATTENTION` are supported. For a better compatibility some aliases exists. `INFO`, `DANGER` and `CAUTION` can also be used to define the alerts.
25+
You can change it using plugin configuration via `index.html` or for a single alert in your markdown files. (please see section `Customizations` for further details)
2726

2827
**Sample `index.html` file using style `flat` instead of `callout`**
2928

@@ -52,6 +51,9 @@ Assuming you have a working [docsify](https://docsify.js.org) app set up, it is
5251
warning: {
5352
label: "Warnung"
5453
},
54+
important: {
55+
label: "Wichtig"
56+
},
5557
attention: {
5658
label: "Achtung"
5759
}
@@ -84,6 +86,12 @@ Assuming you have a working [docsify](https://docsify.js.org) app set up, it is
8486
'/': 'Warning'
8587
}
8688
},
89+
important: {
90+
label: {
91+
'/de-DE/': 'Wichtig',
92+
'/': 'Important'
93+
}
94+
},
8795
attention: {
8896
label: {
8997
'/de-DE/': 'Achtung',
@@ -120,6 +128,13 @@ Modify or add a new blockquote so it matches required syntax like shown in follo
120128
> An alert of type 'warning' using global style 'callout'.
121129
```
122130

131+
* Sample alert using type `IMPORTANT`
132+
133+
```markdown
134+
> [!IMPORTANT]
135+
> An alert of type 'important' using global style 'callout'.
136+
```
137+
123138
* Sample alert using type `ATTENTION`
124139

125140
```markdown
@@ -133,7 +148,7 @@ Serve your documentation (`docsify serve`) as usual.
133148

134149
## Customizations
135150

136-
To use the plugin just modify an existing blockquote and prepend a line matching pattern `[!type]`. By default, types `NOTE`, `TIP`, `WARNING` and `ATTENTION` are supported. You can extend the available types by providing a valid configuration (see below for an example).
151+
To use the plugin just modify an existing blockquote and prepend a line matching pattern `[!type]`. By default, types `NOTE`, `TIP`, `WARNING`, `IMPORTANT` and `ATTENTION` along with some aliases are supported. You can extend the available types by providing a valid configuration (see below for an example).
137152

138153
```markdown
139154
> [!NOTE]
@@ -225,6 +240,7 @@ If alerts do not look as expected, check if your `index.html` as well as alerts
225240
## Changelog
226241

227242
09/30/2025
243+
* Added alert type `IMPORTANT` along with some new aliases.
228244
* Added examples to illustrate usage
229245
* Updated development dependencies
230246
* Fixed issue concerning custom label containing U+2024, ONE DOT LEADER

flexible-alerts.png

99.1 KB
Loading

0 commit comments

Comments
 (0)