Skip to content

Commit 812818f

Browse files
authored
Update docs theme (#4317)
Signed-off-by: Ian Maddaus <[email protected]>
1 parent 783dbb8 commit 812818f

File tree

5 files changed

+81
-11
lines changed

5 files changed

+81
-11
lines changed

_vendor/github.com/chef/chef-docs-theme/layouts/shortcodes/readfile.html

Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20240910135619-26c9a5bfa34f
1515
# github.com/chef/compliance-remediation-2022/docs-chef-io v0.0.0-20240313054833-ebbc45209efa
1616
# github.com/chef/license-service/docs-chef-io v0.0.0-20231117105514-d3f3d53ba2dd
17-
# github.com/chef/chef-docs-theme v0.0.0-20240702130936-2a15b495f5df
17+
# github.com/chef/chef-docs-theme v0.0.0-20241009145630-3872059a00a5
1818
# github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536
1919
# github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90
2020
# github.com/twitter/hogan.js v3.0.2+incompatible

content/style/test.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,74 @@ culpa qui officia deserunt mollit anim id est laborum.
7373

7474
## `readfile` shortcode
7575

76-
Use the `readfile` shortcode to add files to a page. This could be Markdown text or a code sample.
76+
Use the `readfile` shortcode to add file text to a page. This could be Markdown text or a code sample.
77+
78+
### Markdown
79+
80+
It's default is to add a Markdown file to a page:
81+
82+
```md
83+
{{</* readfile file="path/to/markdown.md" */>}}
84+
```
85+
86+
### Code highlighting
87+
88+
It handles code highlighting. See the [Hugo documentation](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) for a full list of syntaxes that it can highlight.
7789

7890
You can add a JSON file like this:
7991

8092
```md
8193
{{</* readfile file="data/test/test.json" highlight="json" */>}}
8294
```
8395

84-
which will produce this:
96+
which produces this:
8597

8698
{{< readfile file="data/test/test.json" highlight="json" >}}
8799

100+
It also converts data between XML, JSON, YAML, and TOML if the highlight value is different from the file type. For example:
101+
102+
```md
103+
{{</* readfile file="data/test/test.json" highlight="yaml" */>}}
104+
```
105+
106+
Which produces this:
107+
108+
{{< readfile file="data/test/test.json" highlight="yaml" >}}
109+
110+
It converts the data to alphabetical order, there's no way to change this behavior.
111+
112+
### Ordered list
113+
114+
If adding file text to an ordered list, you have to format and indent it correctly or it won't display data correctly. Note the three spaces and Markdown shortcode style.
115+
116+
```md
117+
1. A data file:
118+
119+
{{%/* readfile file="data/test/test.json" highlight="json" */%}}
120+
121+
1. The same data file:
122+
123+
{{%/* readfile file="data/test/test.json" highlight="json" */%}}
124+
```
125+
126+
Which produces the following:
127+
128+
1. A data file:
129+
130+
{{% readfile file="data/test/test.json" highlight="json" %}}
131+
132+
1. The same data file:
133+
134+
{{% readfile file="data/test/test.json" highlight="json" %}}
135+
136+
### HTML
137+
138+
You can use `html="true"` to add an HTML file:
139+
140+
```md
141+
{{</* readfile file="path/to/html_file.html" html="true" */>}}
142+
```
143+
88144
## Lists
89145

90146
Markdown doesn't have strict rules about how to process lists. These are things to keep in

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22
44

55
require (
66
github.com/chef/automate/components/docs-chef-io v0.0.0-20240926130942-4b98d9cf92f6 // indirect
7-
github.com/chef/chef-docs-theme v0.0.0-20240702130936-2a15b495f5df // indirect
7+
github.com/chef/chef-docs-theme v0.0.0-20241009145630-3872059a00a5 // indirect
88
github.com/chef/chef-server/docs-chef-io v0.0.0-20240920053744-03b58ff14f46 // indirect
99
github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240809064339-878cb76b2b66 // indirect
1010
github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20240910135619-26c9a5bfa34f // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/chef/automate/components/docs-chef-io v0.0.0-20240926130942-4b98d9cf92f6 h1:scrWEAK18Peqbtc3CxwxVaFp595kr+r8eYvYxW7qjQU=
22
github.com/chef/automate/components/docs-chef-io v0.0.0-20240926130942-4b98d9cf92f6/go.mod h1:juvLC7Rt33YOCgJ5nnfl4rWZRAbSwqjTbWmcAoA0LtU=
3-
github.com/chef/chef-docs-theme v0.0.0-20240702130936-2a15b495f5df h1:R4S5OrcKY2CJHMShYHHeTqIzrAdPvX6bfDyho69Rll0=
4-
github.com/chef/chef-docs-theme v0.0.0-20240702130936-2a15b495f5df/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ=
3+
github.com/chef/chef-docs-theme v0.0.0-20241009145630-3872059a00a5 h1:LtZdS+QMAfZuGTWWBDSox5xvtvJTKTR6cuZLMfJm5x8=
4+
github.com/chef/chef-docs-theme v0.0.0-20241009145630-3872059a00a5/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ=
55
github.com/chef/chef-server/docs-chef-io v0.0.0-20240920053744-03b58ff14f46 h1:KKSufg3MDKPPzXN2Nv6vUGhx8LIYmYMo9ByQMFbj8Rk=
66
github.com/chef/chef-server/docs-chef-io v0.0.0-20240920053744-03b58ff14f46/go.mod h1:gMSa25GUHmLimA0gjvRd3hs1buOBqkKPrdHzHvaJauY=
77
github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240809064339-878cb76b2b66 h1:mGSa2uVyyi8bHyluwmmd83UReZR9gqF/roi5v7lnv0s=

0 commit comments

Comments
 (0)