我们必须玩
details
,summary
,还有......空格!
空格??是的:
details
标签的位置空间决定了它是否有效。
这是一个 2 级列表,其中包含可折叠元素和子元素,以及一些其他常规 Markdown 项目。
示例 在 github 中渲染。也适用于 VS-Code。不确定其他哪个引擎支持它。
代码:
- <details open>
<summary><a href="#">Section 1 with a link</a></summary>
- <details>
<summary><a href="../src/actions/">subsection 2 with a link</a></summary>
- a list
- with some stuff
> and other things
- [x] like
- [ ] a task list
</details>
- <details>
<summary><b>another subsection</a></summary>
a. with another list
b. and some other stuff
d. [and](),
[more](),
[classic](),
[md]
e. _no need_ __of html__
</details>
- <details>
<summary>last sub-section</a></summary>
blablabla
```rb
def some_code
puts "Rails is so cool"
end
```
</details>
- a random not collapsable section
> legacy. Should be restructured.
```js
console.log("look what I found, a new js framework. Still no real alternative to rails though")
```
- <details>
<summary>and another collapsable section</summary>
...
</details>
- <details>
<summary>section 2</summary>
some parent content
and another list
- <details>
<summary>section 2.1</summary>
and some content
</details>
- <details>
<summary>section 2.2</summary>
and some content
</details>
- section 2.3
and some no collapsed content
</details>
如您所见,并非所有引擎都支持它......就像这样一个:
还有其他事情
a.与另一个列表 b.和其他一些东西 d.和, 更多的, 经典的, [MD] e. 不需要 html
布拉布拉布拉
def some_code
puts "Rails is so cool"
end
随机不可折叠部分
遗产。应该重组。
console.log("look what I found, a new js framework. Still no real alternative to rails though")
...
一些家长内容
还有另一个列表
以及一些内容
以及一些内容
第 2.3 节 还有一些没有折叠的内容