Shortcodes
2. Formatting shortcodes
gn:button
The gn:button
shortcode creates a link which looks like a button.
This shortcode has very specific applications and is intended to be used primarily in site-wide configuration where the use of active user interface elements makes sense. Otherwise you should generally consider using a call to action (gn:cta
) or a regular link instead.
The following parameters are supported:
href
: specifies the url for the button action.title
: specifies a tooltip to be displayed when the user's mouse hovers over the button - usually a longer version of the button text or an explanation of what the button does.icon
: specifies the name of a FontAwesome icon to be displayed before the button, e.g.home
.type
: specifies the type (appearance) of the button - one ofdefault
,primary
, orcancel
.
Callouts
There exists a large number of "callout" shortcodes which can be used to draw attention to a small fact or piece of information which is important. These are:
gn:note
/ gn:info
/ gn:information
, for drawing attention to important considerations.
gn:tip
, intended for information which is useful but could otherwise be omitted.
gn:announce
, for notices or important announcements.
gn:warn
/ gn:warning
gn:danger
If in doubt as to which type should be used, use gn:note
.
I spilled my ice cream.
The effective
and expires
attributes set dates and times at which a callout automatically becomes visible or hidden. These attributes must be valid ISO 8601 date strings of the form YYYY-MM-DD
, YYYY-MM-DDTHH:MM
or YYYY-MM-DDTHH:MM:SS
.
gn:codelisting
The gn:codelisting
shortcode generates a code listing presenting the enclosed content as monospaced text, complete with line numbers. This obviously has limited applications in content creation, but is enormously useful for self-documentation - the content examples on this page are themselves presented as code listings.
gn:cta
The gn:cta
shortcode creates a call to action - a large centered button prompting the user to navigate elsewhere.
gn:include
The gn:include
shortcode can be used to include the content of the named post verbatim in the current page. All WordPress post types including posts, pages, snippets, and custom post types are supported.
gn:tldr
The gn:tldr
shortcode maps directly to the CUE template's TLDR (too long; didn't read)
component, which is used to display a very prominent, concise answer when a visitor might
be disinclined to read the full version.
Within the TLDR content, some formatting elements which would ordinarily be displayed inline such as bold and italics are displayed very prominently on their own line.
The answer is 42