File tree Expand file tree Collapse file tree 4 files changed +73
-14
lines changed Expand file tree Collapse file tree 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) => {
4848 '/zh/' : '警告'
4949 }
5050 } ] ,
51+ [ 'container' , {
52+ type : 'details' ,
53+ before : info => `<details class="custom-block details">${ info ? `<summary>${ info } </summary>` : '' } \n` ,
54+ after : ( ) => '</details>\n'
55+ } ] ,
5156 [ 'smooth-scroll' , enableSmoothScroll ]
5257 ]
5358 }
Original file line number Diff line number Diff line change 2626 color darken (red , 40% )
2727 a
2828 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
123123
124124** Input**
125125
126- ```
126+ ``` md
127127::: tip
128128This is a tip
129129:::
@@ -135,6 +135,10 @@ This is a warning
135135::: danger
136136This is a dangerous warning
137137:::
138+
139+ ::: details
140+ This is a details block, which does not work in IE / Edge
141+ :::
138142```
139143
140144** Output**
@@ -151,18 +155,34 @@ This is a warning
151155This is a dangerous warning
152156:::
153157
158+ ::: details
159+ This is a details block, which does not work in IE / Edge
160+ :::
161+
154162You can also customize the title of the block:
155163
156- ```
164+ ```` md
157165::: danger STOP
158166Danger zone, do not proceed
159167:::
168+
169+ ::: details Click me to view the code
170+ ```js
171+ console.log('Hello, VuePress!')
160172```
173+ :::
174+ ````
161175
162176::: danger STOP
163177Danger zone, do not proceed
164178:::
165179
180+ ::: details Click me to view the code
181+ ``` js
182+ console .log (' Hello, VuePress!' )
183+ ```
184+ :::
185+
166186** Also see:**
167187
168188- [ 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
123123
124124** 输入**
125125
126- ```
126+ ``` md
127127::: tip
128- This is a tip
128+ 这是一个提示
129129:::
130130
131131::: warning
132- This is a warning
132+ 这是一个警告
133133:::
134134
135135::: danger
136- This is a dangerous warning
136+ 这是一个危险警告
137+ :::
138+
139+ ::: details
140+ 这是一个详情块,在 IE / Edge 中不生效
137141:::
138142```
139143
140144** 输出**
141145
142146::: tip
143- This is a tip
147+ 这是一个提示
144148:::
145149
146150::: warning
147- This is a warning
151+ 这是一个警告
148152:::
149153
150154::: danger
151- This is a dangerous thing
155+ 这是一个危险警告
156+ :::
157+
158+ ::: details
159+ 这是一个详情块,在 IE / Edge 中不生效
152160:::
153161
154162你也可以自定义块中的标题:
155163
156- ```
164+ ```` md
157165::: danger STOP
158- Danger zone, do not proceed
166+ 危险区域,禁止通行
159167:::
168+
169+ ::: details 点击查看代码
170+ ```js
171+ console.log('你好,VuePress!')
160172```
173+ :::
174+ ````
161175
162176::: danger STOP
163- Danger zone, do not proceed
177+ 危险区域,禁止通行
178+ :::
179+
180+ ::: details 点击查看代码
181+ ``` js
182+ console .log (' 你好,VuePress!' )
183+ ```
164184:::
165185
166186** 参考:**
You can’t perform that action at this time.
0 commit comments