Skip to content

Commit

Permalink
Lints
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Maddaus <[email protected]>
  • Loading branch information
IanMadd committed Mar 26, 2024
1 parent 58ada2c commit 1dd3f72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
18 changes: 13 additions & 5 deletions content/style/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,18 @@ and `panel-id`/`panel-link` values must be unique HTML IDs on the page.

## `highlight` shortcode

You can add code examples using the `highlight` shortcode.
You can add code examples using the `highlight` shortcode.

For example, this:

<!-- markdownlint-disable MD046 -->

{{</* highlight ruby */>}}
puts 'Hello, world!'
{{</* /highlight */>}}

<!-- markdownlint-enable MD046 -->

produces:

{{< highlight ruby >}}
Expand All @@ -304,19 +308,23 @@ You can also add line numbers and highlight specific lines.

This is the code for this example:

<!-- markdownlint-disable MD046 -->

{{</* highlight ruby "linenos=table,hl_lines=3 5-7,linenostart=10" */>}}
require 'chef/config'
require 'chef/log'
require 'chef/rest'

chef_server_url = 'https://chefserver.com'
client_name = 'clientname'
signing_key_filename = '/path/to/pem/for/clientname'
client_name = 'client_name'
signing_key_filename = '/path/to/pem/for/client_name'

rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
puts rest.get_rest('/clients')
{{</* / highlight */>}}

<!-- markdownlint-enable MD046 -->

produces this:

{{< highlight ruby "linenos=table,hl_lines=3 5-7,linenostart=10" >}}
Expand All @@ -325,8 +333,8 @@ require 'chef/log'
require 'chef/rest'

chef_server_url = 'https://chefserver.com'
client_name = 'clientname'
signing_key_filename = '/path/to/pem/for/clientname'
client_name = 'client_name'
signing_key_filename = '/path/to/pem/for/client_name'

rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
puts rest.get_rest('/clients')
Expand Down
13 changes: 8 additions & 5 deletions content/style/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ Checklists are an unordered list with a checkbox.
Eiusmod cupidatat excepteur tempor elit officia ipsum aute nulla ea do minim eu eu.
Commodo adipisicing sunt nisi laborum laboris.
Code block using the [highlight shortcode](https://gohugo.io/content-management/syntax-highlighting/#example-highlight-shortcode):
Expand All @@ -464,8 +463,8 @@ require 'chef/log'
require 'chef/rest'
chef_server_url = 'https://chefserver.com'
client_name = 'clientname'
signing_key_filename = '/path/to/pem/for/clientname'
client_name = 'client_name'
signing_key_filename = '/path/to/pem/for/client_name'
rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
puts rest.get_rest('/clients')
Expand All @@ -475,19 +474,23 @@ Dolore est deserunt pariatur voluptate.
This is the code for this example:
<!-- markdownlint-disable MD046 -->
{{</* highlight ruby "linenos=table,hl_lines=3 5-7,linenostart=10" */>}}
require 'chef/config'
require 'chef/log'
require 'chef/rest'
chef_server_url = 'https://chefserver.com'
client_name = 'clientname'
signing_key_filename = '/path/to/pem/for/clientname'
client_name = 'client_name'
signing_key_filename = '/path/to/pem/for/client_name'
rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
puts rest.get_rest('/clients')
{{</* / highlight */>}}
<!-- markdownlint-enable MD046 -->
Add code using the readfile shortcode:
{{< readfile file="data/test/test.json" highlight="json" >}}
Expand Down

0 comments on commit 1dd3f72

Please sign in to comment.