File tree 4 files changed +73
-14
lines changed
4 files changed +73
-14
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ module.exports = (options, ctx) => {
48
48
'/zh/' : '警告'
49
49
}
50
50
} ] ,
51
+ [ 'container' , {
52
+ type : 'details' ,
53
+ before : info => `<details class="custom-block details">${ info ? `<summary>${ info } </summary>` : '' } \n` ,
54
+ after : ( ) => '</details>\n'
55
+ } ] ,
51
56
[ 'smooth-scroll' , enableSmoothScroll ]
52
57
]
53
58
}
Original file line number Diff line number Diff line change 26
26
color darken (red , 40% )
27
27
a
28
28
color $textColor
29
-
30
-
29
+ & .details
30
+ display block
31
+ position relative
32
+ border-radius 2px
33
+ margin 1.6em 0
34
+ padding 1.6em
35
+ background-color #e e e
36
+ h4
37
+ margin-top 0
38
+ figure , p
39
+ & :last-child
40
+ margin-bottom 0
41
+ padding-bottom 0
42
+ summary
43
+ outline none
44
+ cursor pointer
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ Rendering of TOC can be configured using the [`markdown.toc`](../config/README.m
123
123
124
124
** Input**
125
125
126
- ```
126
+ ``` md
127
127
::: tip
128
128
This is a tip
129
129
:::
@@ -135,6 +135,10 @@ This is a warning
135
135
::: danger
136
136
This is a dangerous warning
137
137
:::
138
+
139
+ ::: details
140
+ This is a details block, which does not work in IE / Edge
141
+ :::
138
142
```
139
143
140
144
** Output**
@@ -151,18 +155,34 @@ This is a warning
151
155
This is a dangerous warning
152
156
:::
153
157
158
+ ::: details
159
+ This is a details block, which does not work in IE / Edge
160
+ :::
161
+
154
162
You can also customize the title of the block:
155
163
156
- ```
164
+ ```` md
157
165
::: danger STOP
158
166
Danger zone, do not proceed
159
167
:::
168
+
169
+ ::: details Click me to view the code
170
+ ```js
171
+ console.log('Hello, VuePress!')
160
172
```
173
+ :::
174
+ ````
161
175
162
176
::: danger STOP
163
177
Danger zone, do not proceed
164
178
:::
165
179
180
+ ::: details Click me to view the code
181
+ ``` js
182
+ console .log (' Hello, VuePress!' )
183
+ ```
184
+ :::
185
+
166
186
** Also see:**
167
187
168
188
- [ vuepress-plugin-container] ( https://vuepress.github.io/plugins/container/ )
Original file line number Diff line number Diff line change @@ -123,44 +123,64 @@ lang: en-US
123
123
124
124
** 输入**
125
125
126
- ```
126
+ ``` md
127
127
::: tip
128
- This is a tip
128
+ 这是一个提示
129
129
:::
130
130
131
131
::: warning
132
- This is a warning
132
+ 这是一个警告
133
133
:::
134
134
135
135
::: danger
136
- This is a dangerous warning
136
+ 这是一个危险警告
137
+ :::
138
+
139
+ ::: details
140
+ 这是一个详情块,在 IE / Edge 中不生效
137
141
:::
138
142
```
139
143
140
144
** 输出**
141
145
142
146
::: tip
143
- This is a tip
147
+ 这是一个提示
144
148
:::
145
149
146
150
::: warning
147
- This is a warning
151
+ 这是一个警告
148
152
:::
149
153
150
154
::: danger
151
- This is a dangerous thing
155
+ 这是一个危险警告
156
+ :::
157
+
158
+ ::: details
159
+ 这是一个详情块,在 IE / Edge 中不生效
152
160
:::
153
161
154
162
你也可以自定义块中的标题:
155
163
156
- ```
164
+ ```` md
157
165
::: danger STOP
158
- Danger zone, do not proceed
166
+ 危险区域,禁止通行
159
167
:::
168
+
169
+ ::: details 点击查看代码
170
+ ```js
171
+ console.log('你好,VuePress!')
160
172
```
173
+ :::
174
+ ````
161
175
162
176
::: danger STOP
163
- Danger zone, do not proceed
177
+ 危险区域,禁止通行
178
+ :::
179
+
180
+ ::: details 点击查看代码
181
+ ``` js
182
+ console .log (' 你好,VuePress!' )
183
+ ```
164
184
:::
165
185
166
186
** 参考:**
You can’t perform that action at this time.
0 commit comments