22title : Diagrams and Formulae
33weight : 11
44description : Add generated diagrams and scientific formulae to your site.
5+ cSpell:ignore : goldmark linenos mhchem
56---
67
78Docsy has built-in support for a number of diagram creation and typesetting
@@ -94,43 +95,44 @@ additional
9495have to be created by adding the lines below to your
9596` hugo.toml ` /` hugo.yaml ` /` hugo.json ` configuration file:
9697
97- <!-- prettier-ignore-start -->
98- {{< tabpane >}}
98+ {{< tabpane text=true persist=lang >}}
9999{{< tab header="Site configuration file:" disabled=true />}}
100- {{< tab header="hugo.toml" lang="toml" >}}
100+ {{% tab header="hugo.toml" lang="toml" %}}
101+
102+ ``` toml
101103[mediaTypes ]
102104 [mediaTypes .'font/woff' ]
103105 suffixes = [' woff' ]
104106 [mediaTypes .'font/woff2' ]
105107 suffixes = [' woff2' ]
106- {{< /tab >}}
107- {{< tab header="hugo.yaml" lang="yaml" >}}
108+ ```
109+
110+ {{% /tab %}} {{% tab header="hugo.yaml" lang="yaml" %}}
111+
112+ ``` yaml
108113mediaTypes :
109114 font/woff :
110- suffixes:
111- - woff
115+ suffixes : [woff]
112116 font/woff2 :
113- suffixes:
114- - woff2
115- {{< /tab >}}
116- {{< tab header="hugo.json" lang="json" >}}
117+ suffixes : [woff2]
118+ ` ` `
119+
120+ {{% /tab %}} {{% tab header="hugo.json" lang="json" %}}
121+
122+ ` ` ` json
117123{
118- "mediaTypes": {
119- "font/woff": {
120- "suffixes": [
121- "woff"
122- ]
123- },
124- "font/woff2": {
125- "suffixes": [
126- "woff2"
127- ]
128- }
129- }
124+ " mediaTypes " : {
125+ " font/woff " : {
126+ " suffixes " : ["woff"]
127+ },
128+ " font/woff2 " : {
129+ " suffixes " : ["woff2"]
130+ }
131+ }
130132}
131- {{< /tab >}}
132- {{< /tabpane >}}
133- <!-- prettier-ignore-end -->
133+ ```
134+
135+ {{% /tab %}} {{< /tabpane >}}
134136
135137#### Enable ` passthrough ` extension
136138
@@ -139,10 +141,11 @@ inside your `hugo.toml`/`hugo.yaml`/`hugo.json`. You can edit this definition to
139141meet your own needs. For details, see the official
140142[ Hugo docs] ( https://gohugo.io/content-management/mathematics/#step-1 ) .
141143
142- <!-- prettier-ignore-start -->
143- {{< tabpane >}}
144+ {{< tabpane text=true persist=lang >}}
144145{{< tab header="Site configuration file:" disabled=true />}}
145- {{< tab header="hugo.toml" lang="toml" >}}
146+ {{% tab header="hugo.toml" lang="toml" %}}
147+
148+ ``` toml
146149[markup ]
147150 [markup .goldmark ]
148151 [markup .goldmark .extensions ]
@@ -151,8 +154,11 @@ meet your own needs. For details, see the official
151154 [markup .goldmark .extensions .passthrough .delimiters ]
152155 block = [[' \[' , ' \]' ], [' $$' , ' $$' ]]
153156 inline = [[' \(' , ' \)' ]]
154- {{< /tab >}}
155- {{< tab header="hugo.yaml" lang="yaml" >}}
157+ ```
158+
159+ {{% /tab %}} {{% tab header="hugo.yaml" lang="yaml" %}}
160+
161+ ``` yaml
156162markup :
157163 goldmark :
158164 extensions :
@@ -161,40 +167,32 @@ markup:
161167 delimiters :
162168 block : [['\[', '\]'], ['$$', '$$']]
163169 inline : [['\(', '\)']]
164- {{< /tab >}}
165- {{< tab header="hugo.json" lang="json" >}}
170+ ` ` `
171+
172+ {{% /tab %}} {{% tab header="hugo.json" lang="json" %}}
173+
174+ ` ` ` json
166175{
167- "markup": {
168- "goldmark": {
169- "extensions": {
170- "passthrough": {
171- "delimiters": {
172- "block": [
173- [
174- "\\ [ ",
175- "\\ ] "
176- ] ,
177- [
178- "$$",
179- "$$"
180- ]
181- ] ,
182- "inline": [
183- [
184- "\\ (",
185- "\\ )"
186- ]
187- ]
188- },
189- "enable": true
190- }
191- }
176+ " markup " : {
177+ " goldmark " : {
178+ " extensions " : {
179+ " passthrough " : {
180+ " delimiters " : {
181+ " block " : [
182+ ["\\[", "\\]"],
183+ ["$$", "$$"]
184+ ],
185+ " inline " : [["\\(", "\\)"]]
186+ },
187+ " enable " : true
188+ }
192189 }
193- }
190+ }
191+ }
194192}
195- {{< /tab >}}
196- {{< /tabpane >}}
197- <!-- prettier-ignore-end -->
193+ ```
194+
195+ {{% /tab %}} {{< /tabpane >}}
198196
199197#### Add ` passthrough ` render hook
200198
@@ -235,6 +233,7 @@ _Precipitation of barium sulfate:_ \(\ce{SO4^2- + Ba^2+ -> BaSO4 v}\)
235233More complex equations can be displayed on their own line using the block
236234delimiters defined:
237235
236+ <!-- cSpell:ignore tetrahydroxozincate mchem -->
238237<!-- prettier-ignore-start -->
239238```` markdown
240239\[
@@ -261,7 +260,7 @@ Both standard syntax and `chem` block renders to the same equation:
261260<!-- prettier-ignore-end -->
262261
263262{{% alert title="Note" %}} The
264- [ manual] ( https://mhchem.github.io/MathJax-mhchem/ ) for mchem’ s input syntax
263+ [ manual] ( https://mhchem.github.io/MathJax-mhchem/ ) for mchem' s input syntax
265264provides in-depth information about typesetting chemical formulae and physical
266265units using the ` mhchem ` tool. {{% /alert %}}
267266
@@ -304,6 +303,8 @@ diagram - no more hunting for the original tools and version to make a new edit.
304303
305304For example, the following defines a sequence diagram:
306305
306+ <!-- cSpell:ignore autonumber -->
307+
307308````
308309```mermaid
309310sequenceDiagram
0 commit comments