The docs shortcode captures a code snippet from a supported input file.
docs shortcode captures a code snippet from a
scss input file. It scans for named markers in a local file. The snippet between the two markers is then rendered using syntax highlighting.
idfield fails when embedding (multiple)
docsshortcodes in an example. Provide an explicit, unique
idto prevent cross-interference.
The shortcode supports the following arguments:
|name||Yes||Name of the code snippet, used to identify the relevant section of the input file.|
|file||Yes||Path of the input file. The path is relative to the |
|show||No||If unset, shows the panel with the code snippet in collapsed state. By default, the panel is expanded.|
|full||No||If unset, shows the filename only. By default, the full relative path is shown.|
|id||No||Optional id of the collapse panel, defaults to “docs-collapse-n” with a sequential number n starting at 1.|
|class||No||Optional class argument of the tab control.|
docs shortcode supports
.scss file formats. Use a marker to denote the start and end of a code snippet:
# toml-docs-endfollowed by the snippet name
// scss-docs-endfollowed by the snippet name
Click on one the tabs to see a full example of an input file.
Change the style and language of your code snippet with shortcode arguments.
file arguments to refer to a code snippet of a file. By default, the shortcode uses the site’s
basePath (see page layout for more information).
Provide a path that starts with
./ to use the path of the repository as base path instead.
false to hide the code snippet on page load. The code is reveiled when clicking the tab control.
false to show the filename only.