You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Premonition is a higly customizable [Jekyll](https://jekyllrb.com/) plugin that can convert Markdown block-quotes into beautiful block styled content.
5
+
Premonition is a higly customizable [Jekyll](https://jekyllrb.com/) plugin that can convert Markdown block-quotes into beautiful block styled content.
8
6
9
7
By simply adding a custom header to the first line of a [block quote](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#blockquotes), Premonition will transform it into a markup block of your choice.
10
8
@@ -14,46 +12,46 @@ By simply adding a custom header to the first line of a [block quote](https://gi
14
12
15
13
## Features
16
14
17
-
* Highly customizable (Create your own styles and templates easily)
18
-
* Non-intrusive - Its just Markdown!
19
-
* Easy to install
20
-
* Comes with a default stylesheet (Sass/Css) and templates for beautiful messages boxes and citation.
21
-
* Font Awesome 5 support
22
-
23
-
## Version 4 Highlights
24
-
25
-
* Jekyll [Post Excerpts](https://jekyllrb.com/docs/posts/#post-excerpts) support
26
-
* New install command for the default stylesheet.
27
-
*[Kramdown reference links](https://kramdown.gettalong.org/quickref.html#links-and-images) support
28
-
* Jekyll 4 support (3.7 still supported)
29
-
* Added support for block attributes (See documentation further down)
30
-
* Added new citation block type.
31
-
* Minor fixes to the Premonition stylesheet.
32
-
* Removed the need Font Awesome css in default stylesheet, but
33
-
Font Awesome is still supported.
34
-
* Other bug fixes. See HISTORY.md.
35
-
36
-
See UPGRADE.md for help on how to upgrade from 2.x to 4.0.
37
-
15
+
- Highly customizable (Create your own styles and templates easily)
16
+
- Non-intrusive - Its just Markdown!
17
+
- Easy to install
18
+
- Comes with a default stylesheet (Sass/Css) and templates for beautiful messages boxes and citation.
19
+
- Font Awesome 5 support
20
+
21
+
## Version 4 Highlights
22
+
23
+
- Jekyll [Post Excerpts](https://jekyllrb.com/docs/posts/#post-excerpts) support
24
+
- New install command for the default stylesheet.
25
+
-[Kramdown reference links](https://kramdown.gettalong.org/quickref.html#links-and-images) support
26
+
- Jekyll 4 support (3.7 still supported)
27
+
- Added support for block attributes (See documentation further down)
28
+
- Added new citation block type.
29
+
- Minor fixes to the Premonition stylesheet.
30
+
- Removed the need Font Awesome css in default stylesheet, but
31
+
Font Awesome is still supported.
32
+
- Other bug fixes. See HISTORY.md.
33
+
34
+
See UPGRADE.md for help on how to upgrade from 2.x to 4.0.
35
+
38
36
## Requirements
39
37
40
-
* Jekyll 3.7.x or higher (We recommend the new Jekyll 4)
41
-
38
+
- Jekyll 3.7.x or higher (We recommend the new Jekyll 4)
39
+
42
40
## Installation
43
41
44
42
Add the following line to your `Gemfile` inside your Jekyll project folder:
45
43
46
44
```
47
45
group :jekyll_plugins do
48
-
gem "premonition", "4.0.0.pre3"
46
+
gem "premonition", "4.0.0"
49
47
end
50
48
```
51
49
52
50
Then add the the plugin to your `_config.yml`:
53
51
54
52
```yaml
55
53
plugins:
56
-
- premonition
54
+
- premonition
57
55
```
58
56
59
57
Now make sure to download the Premonition bundle:
@@ -89,54 +87,60 @@ defined by you in `_config.yml`.
89
87
90
88
The default types are:
91
89
92
-
* note
93
-
* info
94
-
* warning
95
-
* error
96
-
* citation
90
+
- note
91
+
- info
92
+
- warning
93
+
- error
94
+
- citation
97
95
98
-
The *Title* will normally be the block header. Leave it empty to disable
96
+
The _Title_ will normally be the block header. Leave it empty to disable
99
97
the header.
100
98
101
-
*attributes* are in use by the Citation type, but can be skipped for the other default types. See section about custom types for more info.
99
+
_attributes_ are in use by the Citation type, but can be skipped for the other default types. See section about custom types for more info.
102
100
103
101
### Examples
104
102
105
103
Simple note with no header
106
-
~~~markdown
104
+
105
+
```markdown
107
106
> note ""
108
107
> No headers in here
109
-
~~~
108
+
```
110
109
111
110
Note
112
-
~~~markdown
111
+
112
+
```markdown
113
113
> note "I am a not"
114
114
> The body of the note goes here. Premonition allows you to write any `Markdown` inside the block.
115
-
~~~
115
+
```
116
116
117
117
Info
118
-
~~~markdown
118
+
119
+
```markdown
119
120
> info "I am some info"
120
121
> The body of the info box goes here. Premonition allows you to write any `Markdown` inside the block.
121
-
~~~
122
+
```
122
123
123
124
Warning
124
-
~~~markdown
125
+
126
+
```markdown
125
127
> warning "I am a warning"
126
128
> The body of the warning box goes here. Premonition allows you to write any `Markdown` inside the block.
127
-
~~~
129
+
```
128
130
129
131
Error
130
-
~~~markdown
132
+
133
+
```markdown
131
134
> error "I am an error"
132
135
> The body of the error box goes here. Premonition allows you to write any `Markdown` inside the block.
133
-
~~~
136
+
```
134
137
135
138
Citation (Note the use of attributes here)
136
-
~~~markdown
139
+
140
+
```markdown
137
141
> citations "Mark Twain" [ cite = "mt" ]
138
142
> I will be a beautiful citation quote
139
-
~~~
143
+
```
140
144
141
145
## Configuration
142
146
@@ -150,12 +154,12 @@ Like Jekyll itself, Premonition uses the [Liquid Markup Language](https://github
150
154
151
155
Six variables are available to the template engine:
152
156
153
-
**header* Boolean that tells you if a title exists and that a header should be added.
154
-
**content* The rendered content for your block.
155
-
**title* The block title.
156
-
**type* The type name (eg: note).
157
-
**meta* This is a hash that can contain any properties you would like to make available to your template. It is configured in `_config.yml`
158
-
**attrs* These are the attributes set in the block header. Like we did in the Citation example above.
157
+
-_header_ Boolean that tells you if a title exists and that a header should be added.
158
+
-_content_ The rendered content for your block.
159
+
-_title_ The block title.
160
+
-_type_ The type name (eg: note).
161
+
-_meta_ This is a hash that can contain any properties you would like to make available to your template. It is configured in `_config.yml`
162
+
-_attrs_ These are the attributes set in the block header. Like we did in the Citation example above.
159
163
160
164
Take a look at our default template inside `lib/premonition/resources.rb` to
161
165
get an idea of how this is done.
@@ -167,7 +171,7 @@ You can override the default template like this in your `_config.yml`:
167
171
```yaml
168
172
premonition:
169
173
default:
170
-
template: 'Liquid template goes here'
174
+
template: "Liquid template goes here"
171
175
```
172
176
173
177
#### Overriding the template for a default type
@@ -178,7 +182,7 @@ If you want to override the template for one of the default types (like note), d
178
182
premonition:
179
183
types:
180
184
note:
181
-
template: 'Liquid template goes here'
185
+
template: "Liquid template goes here"
182
186
```
183
187
184
188
### Adding custom types
@@ -188,24 +192,24 @@ of the defaults, or add a new one.
188
192
189
193
For each type you can
190
194
191
-
* Add a custom template (template)
192
-
* Set a default title (default_title)
193
-
* Set meta data that can be used inside the template
195
+
-Add a custom template (template)
196
+
-Set a default title (default_title)
197
+
-Set meta data that can be used inside the template
194
198
195
199
Each type must have unique id (lowercase letters).
196
200
197
-
~~~yaml
201
+
```yaml
198
202
premonition:
199
203
types:
200
204
custombox:
201
205
meta:
202
-
my-meta: 'By myself'
206
+
my-meta: "By myself"
203
207
advanced:
204
-
template: 'Liquid template goes here'
205
-
default_title: 'MY BLOCK'
208
+
template: "Liquid template goes here"
209
+
default_title: "MY BLOCK"
206
210
meta:
207
-
my-meta: 'By myself'
208
-
~~~
211
+
my-meta: "By myself"
212
+
```
209
213
210
214
## More on styling
211
215
@@ -241,7 +245,7 @@ Then just add this to your `_config.yml`:
0 commit comments