Skip to content

Commit 2516257

Browse files
authored
Replaced FontAwesome with integrated SVG icons. (#18)
* Removed dependency to FontAwesome and embedded icons as SVG directly. * Support dark mode for callout alert style. * Moved alert type naming from 'danger' to 'attention'. Introduced type mappings to support mapping further alert type keys to existing definitions, e.g. map legacy alert type 'danger' to new type definition 'attention'.
1 parent c9df57d commit 2516257

8 files changed

Lines changed: 3455 additions & 1462 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ insert_final_newline = true
1010
trim_trailing_whitespace = true
1111
indent_size = 2
1212

13+
[{*.css,*.scss}]
14+
trim_trailing_whitespace = true
15+
indent_size = 2
16+
1317
[*.md]
1418
max_line_length = off
1519
trim_trailing_whitespace = false

README.md

Lines changed: 28 additions & 25 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 a 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/50688702-ea774f00-1026-11e9-9281-ca615cb466f5.jpg)
9+
![Sample alerts created with plugin 'flexible-alerts'](https://user-images.githubusercontent.com/44210522/93708131-10fb5780-fb34-11ea-85ae-e18b3e239f83.jpg)
1010

1111
## Installation and Usage
1212

@@ -21,16 +21,7 @@ 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 `DANGER` are supported. Following mappings between type and heading is used:
25-
26-
| Type | Heading |
27-
|------|---------|
28-
| NOTE | Note |
29-
| TIP | Tip |
30-
| WARNING | Warning |
31-
| DANGER | Attention |
32-
33-
**Be aware of different meaning between alert type and heading used for a specific type.**
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.
3425

3526
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)
3627

@@ -61,7 +52,7 @@ Assuming you have a working [docsify](https://docsify.js.org) app set up, it is
6152
warning: {
6253
label: "Warnung"
6354
},
64-
danger: {
55+
attention: {
6556
label: "Achtung"
6657
}
6758
}
@@ -93,7 +84,7 @@ Assuming you have a working [docsify](https://docsify.js.org) app set up, it is
9384
'/': 'Warning'
9485
}
9586
},
96-
danger: {
87+
attention: {
9788
label: {
9889
'/de-DE/': 'Achtung',
9990
'/': 'Attention'
@@ -129,11 +120,11 @@ Modify or add a new blockquote so it matches required syntax like shown in follo
129120
> An alert of type 'warning' using global style 'callout'.
130121
```
131122

132-
* Sample alert using type `DANGER`
123+
* Sample alert using type `ATTENTION`
133124

134125
```markdown
135-
> [!DANGER]
136-
> An alert of type 'danger' using global style 'callout'.
126+
> [!ATTENTION]
127+
> An alert of type 'attention' using global style 'callout'.
137128
```
138129

139130
### Step #3 - docsify commands
@@ -142,7 +133,7 @@ Serve your documentation (`docsify serve`) as usual.
142133

143134
## Customizations
144135

145-
To use the plugin just modify an existing blockquote and prepend a line matching pattern `[!type]`. By default types `NOTE`, `TIP`, `WARNING` and `DANGER` are supported. You can extend the available types by providing a valid configuration (see below for an example).
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).
146137

147138
```markdown
148139
> [!NOTE]
@@ -182,7 +173,7 @@ As mentioned above you can provide your own alert types. Therefore, you have to
182173
window.$docsify = {
183174
'flexible-alerts': {
184175
comment: {
185-
label: "Comment",
176+
label: 'Comment',
186177

187178
// localization
188179
label: {
@@ -191,14 +182,16 @@ As mentioned above you can provide your own alert types. Therefore, you have to
191182
},
192183

193184
// Assuming that we use Font Awesome
194-
icon: "fas fa-comment",
195-
className: "info"
185+
icon: 'fas fa-comment',
186+
className: 'note'
196187
}
197188
}
198189
};
199190
</script>
200191
```
201192

193+
**Since we are using FontAwesome in previous example we have to include the library via `index.html`, e.g. using a CDN.**
194+
202195
In Markdown just use the alert according to the types provided by default.
203196

204197
```markdown
@@ -226,12 +219,22 @@ If alerts do no look as expected, check if your `index.html` as well as alerts i
226219

227220
## Changelog
228221

229-
09/23/2019 - Fixed issue concerning custom Font Awesome icons when using on alert based level.
222+
09/20/2020
223+
* Removed dependency to FontAwesome and embedded icons as SVG directly.
224+
* Support dark mode for callout alert style.
225+
* Moved alert type naming from 'danger' to 'attention'. Introduced type mappings to support mapping further alert type keys to existing definitions, e.g. map legacy alert type 'danger' to new type definition 'attention'.
226+
227+
09/23/2019
228+
* Fixed issue concerning custom Font Awesome icons when using on alert based level.
230229

231-
04/14/2019 - Added camel case support for plugin configuration key.
230+
04/14/2019
231+
* Added camel case support for plugin configuration key.
232232

233-
03/03/2019 - Fixed issue concerning languages using characters others than [a-z,A-Z,0-9] like Chinese or Russian.
233+
03/03/2019
234+
* Fixed issue concerning languages using characters others than [a-z,A-Z,0-9] like Chinese or Russian.
234235

235-
01/19/2019 - Fixed issue when using plugin along with themeable plugin.
236+
01/19/2019
237+
* Fixed issue when using plugin along with themeable plugin.
236238

237-
01/06/2019 - Initial release.
239+
01/06/2019
240+
* Initial release.

0 commit comments

Comments
 (0)