Writing

Shortcodes

In addition to the standard markdown formatting, shortcodes can be used for 'fancy' elements.


Relref

Use a relref shortcode to link to internal pages or headings.

Example

Style Guide

Style Guide (External Resources)

Features

Syntax

1[Style Guide]({{< relref "style-guide.md" >}})
2
3[Style Guide (External Resources)]({{< relref "style-guide.md#external-resources" >}})
4
5[Features]({{< relref "../general/features.md" >}})

highlight

Use a highlight shortcode to do code highlighting with additional options that aren’t available via the normal fenced code block functionality.

Example

199use Composer\Plugin\Capable;
200use Composer\Plugin\PluginInterface;
201use cweagans\Composer\Capability\Downloader\DownloaderProvider;
202use cweagans\Composer\Capability\Patcher\PatcherProvider;
203use cweagans\Composer\Capability\Resolver\ResolverProvider;
204
205class YourPlugin implements PluginInterface, Capable
206{
207    /**
208     * @inheritDoc
209     */
210    public function getCapabilities(): array
211    {
212        return [
213            ResolverProvider::class => CoreResolverProvider::class,
214            DownloaderProvider::class => CoreDownloaderProvider::class,
215            PatcherProvider::class => CorePatcherProvider::class,
216        ];
217    }
218    
219    [...]
220}

(note that the line numbers start higher than normal and that there are highlighted lines)

Syntax

 1{{< highlight php "hl_lines=15-17,linenostart=199" >}}
 2
 3use Composer\Plugin\Capable;
 4use Composer\Plugin\PluginInterface;
 5use cweagans\Composer\Capability\Downloader\DownloaderProvider;
 6use cweagans\Composer\Capability\Patcher\PatcherProvider;
 7use cweagans\Composer\Capability\Resolver\ResolverProvider;
 8
 9class YourPlugin implements PluginInterface, Capable
10{
11    /**
12     * @inheritDoc
13     */
14    public function getCapabilities(): array
15    {
16        return [
17            ResolverProvider::class => CoreResolverProvider::class,
18            DownloaderProvider::class => CoreDownloaderProvider::class,
19            PatcherProvider::class => CorePatcherProvider::class,
20        ];
21    }
22    
23    [...]
24}
25{{< /highlight >}}

Figure

Use a figure shortcode to display an image with an attached caption.

Example

A cute kitten

Syntax

1{{< figure src="http://placekitten.com/g/200/300" title="A cute kitten" >}}

Details

Use a details shortcode to create a collapsed content section that can be expanded. This is useful for long code samples or other long reference material that doesn’t need to always be visible.

Example

This is the title of the collapsed section This is the content of the collapsed section. Markdown can be used too.

Syntax

1{{< details title="This is the title of the collapsed section" >}}
2This is the content of the collapsed section. **Markdown** can be used too.
3{{< /details >}}

Lead

The lead shortcode can be used for an introductory sentence at the top of a page that gives context or a summary to the page.

Example

This is the text of the lead paragraph

Syntax

1{{< lead text="This is the text of the lead paragraph" >}}

Callout

A callout can be used to draw the reader’s attention to something important that might otherwise be overlooked.

Example

This is the callout title

This is some text for the callout. Markdown can be used here too.

Syntax

1{{< callout title="This is the callout title" >}}
2This is some text for the callout. **Markdown** _can_ be used here too.
3{{< /callout >}}

Warning

A warning should be used when presenting information that might be considered risky (for example, if performing an action incorrectly could lead to data loss).

Example

This is the warning title

This is some text for the warning. Markdown can be used here too.

Syntax

1{{< warning title="This is the warning title" >}}
2This is some text for the warning. **Markdown** _can_ be used here too.
3{{< /warning >}}

quicklinks are primarily used on project pages in this site. While the shortcode itself is simple, there is some other required configuration in the front matter of the page that they will be displayed on.

Example

Example 1

Some text should go here to describe the link to the user who might click on it.

Example 2

Some text should go here to describe the link to the user who might click on it.

Example 3

Some text should go here to describe the link to the user who might click on it.

Example 4

Some text should go here to describe the link to the user who might click on it.

Syntax

The quicklinks shortcode should be inserted into your content wherever you’d like the links to be placed.

1{{< quicklinks >}}

The quicklinks must also be defined in the front matter of the page that they are displayed on.

 1---
 2title: The Page Title
 3quicklinks:
 4- title: "Example 1"
 5  icon: themes
 6  description: "Some text should go here to describe the link to the user who might click on it."
 7  href: "#"
 8- title: "Example 2"
 9  icon: installation
10  description: "Some text should go here to describe the link to the user who might click on it."
11  href: "#"
12- title: "Example 3"
13  icon: plugins
14  description: "Some text should go here to describe the link to the user who might click on it."
15  href: "#"
16- title: "Example 4"
17  icon: architecture
18  description: "Some text should go here to describe the link to the user who might click on it."
19  href: "#"
20---

There are four icons available (an example of each is included above), but if you need a different icon, open a documentation issue using the link at the bottom of this page and include some detail about what you need.