Skip to content

Code blocks

Pierre Guceski edited this page Oct 30, 2019 · 2 revisions

When displaying a code blocks within the documentation you can use the Markdown native triple back quotes enclosing: ```

or you can use the dedicated code-block partial to benefit from line wrapping or not and copy functionality:

{{< code-block lang="<LANG>" filename="<FILENAME>" disable_copy="false" wrap="false">}}

Some incredible code

{{< /code-block >}}

Available parameters are:

  • lang - [Optional]: Language highlight to apply to your code blocks
  • filename - [Optional - default: None]: Displays a name of file in the code block header
  • disable_copy- [Optional - default: false]: If set to true the copy functionality is not active over the code block
  • wrap - [Optional - default: false]: If set to true then the code blocks wraps too long code lines instead of allowing for an horizontal scroll.