Files
gitea-pages/mydoc/mydoc_alerts.md

5.5 KiB

title, tags, keywords, last_updated, summary, sidebar, permalink
title tags keywords last_updated summary sidebar permalink
Alerts
formatting
notes, tips, cautions, warnings, admonitions March 20, 2016 You can insert notes, tips, warnings, and important alerts in your content. These notes make use of Bootstrap styling and are available through data references such as site.data.alerts.note. mydoc_sidebar /mydoc_alerts/

About alerts

Alerts are little warnings, info, or other messages that you have called out in special formatting. In order to use these alerts or callouts, just reference the appropriate value stored in the alerts.yml file as described in the following sections.

Alerts

You can insert an alert by using any of the following code.

{%raw%}

alert code
note {{site.data.alerts.note}} your note {{site.data.alerts.end}}
tip {{site.data.alerts.tip}} your tip {{site.data.alerts.end}}
warning {{site.data.alerts.warning}} your warning {{site.data.alerts.end}}
important {{site.data.alerts.important}} your important info {{site.data.alerts.end}}
{%endraw%}

The following demonstrate the formatting associated with each alert.

{{site.data.alerts.tip}} Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. {{site.data.alerts.end}}

{{site.data.alerts.note}} Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. {{site.data.alerts.end}}

{{site.data.alerts.important}} Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. {{site.data.alerts.end}}

{{site.data.alerts.warning}} Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. {{site.data.alerts.end}}

Callouts

In contrast to the alerts, the callouts don't have a pre-coded bold-formatted preface such as note or tip. You just add one (if desired) in the callout text itself.

{%raw%}

callout code
callout_default {{site.data.alerts.callout_default}} your callout_default content {{site.data.alerts.end}}
callout_primary {{site.data.alerts.callout_primary}} your callout_primary content {{site.data.alerts.end}}
callout_success {{site.data.alerts.callout_success}} your callout_success content {{site.data.alerts.end}}
callout_warning {{site.data.alerts.callout_warning}} your callout_warning content {{site.data.alerts.end}}
callout_info {{site.data.alerts.callout_info}} your callout_info content {{site.data.alerts.end}}
{%endraw%}

The following demonstrate the formatting for each callout.

{{site.data.alerts.callout_danger}}callout_danger: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

{{site.data.alerts.callout_default}} callout_default: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

{{site.data.alerts.callout_primary}} calloutprimary: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

{{site.data.alerts.callout_success}} calloutsuccess: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

{{site.data.alerts.callout_info}} calloutinfo: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

{{site.data.alerts.callout_warning}} calloutwarning: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{{site.data.alerts.end}}

Blast a warning to users

If you want to blast a warning to users on every page, add the alert or callout to the layouts/page.html page right below the frontmatter. Every page using the page layout (all, by defaut) will show this message.

Using Markdown inside of notes

You can't use Markdown formatting inside alerts. This is because the alerts leverage HTML, and you can't use Markdown inside of HTML tags. It's very easy to forget this, which is why I recommend using HTML formatting for links in every case. This way you're less likely to forget to switch into HTML mode when you're writing content in a tip. You must remember, however, to avoid Markdown with code and bold formatting inside of notes.