mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 18:18:37 +00:00
markup/goldmark: Add attributes support for blocks (tables etc.)
E.g.:
```
> foo
> bar
{.myclass}
```
There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.:
```
* Fruit
* Apple
* Orange
* Banana
{.fruits}
* Dairy
* Milk
* Cheese
{.dairies}
{.list}
```
Fixes #7548
This commit is contained in:
1 parent
19dee04ad6
commit
2631df94ea
2 files changed
+40
-3
No files matched your search
@@ -40,6 +40,34 @@ unsafe
|
|||||||
typographer
|
typographer
|
||||||
: This extension substitutes punctuations with typographic entities like [smartypants](https://daringfireball.net/projects/smartypants/).
|
: This extension substitutes punctuations with typographic entities like [smartypants](https://daringfireball.net/projects/smartypants/).
|
||||||
|
|
||||||
|
attribute
|
||||||
|
: Enable custom attribute support for titles and blocks by adding attribute lists inside single curly brackets (`{.myclass class="class1 class2" }`) and placing it _after the Markdown element it decorates_, on the same line for titles and on a new line directly below for blocks.
|
||||||
|
|
||||||
|
{{< new-in "0.81" >}} In Hugo 0.81.0 we added support for adding attributes (e.g. CSS classes) to Markdown blocks, e.g. tables, lists, paragraphs etc.
|
||||||
|
|
||||||
|
A blockquote with a CSS class:
|
||||||
|
|
||||||
|
```md
|
||||||
|
> foo
|
||||||
|
> bar
|
||||||
|
{.myclass}
|
||||||
|
```
|
||||||
|
|
||||||
|
There are some current limitations: For tables you can currently only apply it to the full table, and for lists the `ul`/`ol`-nodes only, e.g.:
|
||||||
|
|
||||||
|
```md
|
||||||
|
* Fruit
|
||||||
|
* Apple
|
||||||
|
* Orange
|
||||||
|
* Banana
|
||||||
|
{.fruits}
|
||||||
|
* Dairy
|
||||||
|
* Milk
|
||||||
|
* Cheese
|
||||||
|
{.dairies}
|
||||||
|
{.list}
|
||||||
|
```
|
||||||
|
|
||||||
autoHeadingIDType ("github") {{< new-in "0.62.2" >}}
|
autoHeadingIDType ("github") {{< new-in "0.62.2" >}}
|
||||||
: The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs work as with [Blackfriday](#blackfriday), the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func.
|
: The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs work as with [Blackfriday](#blackfriday), the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func.
|
||||||
|
|
||||||
|
|||||||
+12
-3
@@ -1509,7 +1509,10 @@
|
|||||||
"parser": {
|
"parser": {
|
||||||
"autoHeadingID": true,
|
"autoHeadingID": true,
|
||||||
"autoHeadingIDType": "github",
|
"autoHeadingIDType": "github",
|
||||||
"attribute": true
|
"attribute": {
|
||||||
|
"title": true,
|
||||||
|
"block": false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"typographer": true,
|
"typographer": true,
|
||||||
@@ -3023,7 +3026,7 @@
|
|||||||
"Examples": []
|
"Examples": []
|
||||||
},
|
},
|
||||||
"Merge": {
|
"Merge": {
|
||||||
"Description": "Merge creates a copy of the final parameter and merges the preceeding\nparameters into it in reverse order.\nCurrently only maps are supported. Key handling is case insensitive.",
|
"Description": "Merge creates a copy of the final parameter and merges the preceding\nparameters into it in reverse order.\nCurrently only maps are supported. Key handling is case insensitive.",
|
||||||
"Args": [
|
"Args": [
|
||||||
"params"
|
"params"
|
||||||
],
|
],
|
||||||
@@ -3526,6 +3529,12 @@
|
|||||||
"Aliases": null,
|
"Aliases": null,
|
||||||
"Examples": null
|
"Examples": null
|
||||||
},
|
},
|
||||||
|
"Overlay": {
|
||||||
|
"Description": "",
|
||||||
|
"Args": null,
|
||||||
|
"Aliases": null,
|
||||||
|
"Examples": null
|
||||||
|
},
|
||||||
"Pixelate": {
|
"Pixelate": {
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"Args": null,
|
"Args": null,
|
||||||
@@ -4371,7 +4380,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"CountRunes": {
|
"CountRunes": {
|
||||||
"Description": "CountRunes returns the number of runes in s, excluding whitepace.",
|
"Description": "CountRunes returns the number of runes in s, excluding whitespace.",
|
||||||
"Args": [
|
"Args": [
|
||||||
"s"
|
"s"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user