feat(code): add support for code block folding (#259)

This commit is contained in:
Dillon
2020-04-26 03:25:10 +08:00
committed by GitHub
parent 41a92c6166
commit bcbc4268ea
32 changed files with 351 additions and 270 deletions

View File

@@ -678,6 +678,9 @@ enableEmoji = true
# whether to show the copy button of the code block
# 是否显示代码块的复制按钮
copy = true
# the maximum number of lines of displayed code by default
# 默认展开显示的代码行数
maxShownLines = 10
# KaTeX mathematical formulas config (KaTeX https://katex.org/)
# KaTeX 数学公式配置 (KaTeX https://katex.org/)
[params.page.math]

View File

@@ -46,7 +46,7 @@ John Gruber, the author of Markdown, puts it like this:
> While Markdowns syntax has been influenced by several existing text-to-HTML filters,
> the single biggest source of inspiration for Markdowns syntax is the format of plain text email.
>
> -- _John Gruber_
> {{< style "text-align: right;" >}}-- _John Gruber_{{< /style >}}
Without further delay, let us go over the main elements of Markdown and what the resulting HTML looks like!

View File

@@ -51,7 +51,7 @@ John Gruber, the author of Markdown, puts it like this:
> While Markdowns syntax has been influenced by several existing text-to-HTML filters,
> the single biggest source of inspiration for Markdowns syntax is the format of plain text email.
>
> -- _John Gruber_
> {{< style "text-align: right;" >}}-- _John Gruber_{{< /style >}}
Without further delay, let us go over the main elements of Markdown and what the resulting HTML looks like!

View File

@@ -46,7 +46,7 @@ John Gruber, Markdown 的作者如是说:
> 虽然 Markdown 的语法受到几种现有的文本到 HTML 转换工具的影响,
> 但 Markdown 语法的最大灵感来源是纯文本电子邮件的格式.
>
> -- _John Gruber_
> {{< style "text-align: right;" >}}-- _John Gruber_{{< /style >}}
话不多说, 我们来回顾一下 Markdown 的主要语法以及生成的 HTML 样式!

View File

@@ -393,6 +393,8 @@ Note that some of these parameters are explained in details in other sections of
[params.page.code]
# whether to show the copy button of the code block
copy = true
# the maximum number of lines of displayed code by default
maxShownLines = 10
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
[params.page.mapbox]
# access token of Mapbox GL JS

View File

@@ -398,6 +398,8 @@ Note that some of these parameters are explained in details in other sections of
[params.page.code]
# whether to show the copy button of the code block
copy = true
# the maximum number of lines of displayed code by default
maxShownLines = 10
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
[params.page.mapbox]
# access token of Mapbox GL JS

View File

@@ -383,6 +383,8 @@ hugo
[params.page.code]
# 是否显示代码块的复制按钮
copy = true
# 默认展开显示的代码行数
maxShownLines = 10
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} 数学公式
[params.page.math]
enable = true

View File

@@ -37,7 +37,7 @@ math:
**Hugo** 允许你在文章内容前面添加 `yaml`, `toml` 或者 `json` 格式的前置参数.
{{< admonition >}}
**不是所有**的上述前置参数都必须在你的每篇文章中设置.
**不是所有**的以下前置参数都必须在你的每篇文章中设置.
只有在文章的参数和你的 [网站设置](../theme-documentation-basics/#site-configuration) 中的 `page` 部分不一致时才有必要这么做.
{{< /admonition >}}

View File

@@ -28,7 +28,7 @@ The `style` shortcode has two positional parameters.
The **first** one is the custom style content.
And the **second** one is the HTML tag around the content you want to change style, and whose default value is `p`.
And the **second** one is the HTML tag around the content you want to change style, and whose default value is `div`.
Example `style` input:

View File

@@ -33,7 +33,7 @@ The `style` shortcode has two positional parameters.
The **first** one is the custom style content.
And the **second** one is the HTML tag around the content you want to change style, and whose default value is `p`.
And the **second** one is the HTML tag around the content you want to change style, and whose default value is `div`.
Example `style` input:

View File

@@ -31,7 +31,7 @@ mapbox:
第一个参数是自定义样式的内容.
第二个参数是包裹你要更改样式的内容的 HTML 标签, 默认值是 `p`.
第二个参数是包裹你要更改样式的内容的 HTML 标签, 默认值是 `div`.
一个 `style` 示例: