# Preprocessor / additions to markdown's syntax

**URL:** <https://discourse.gohugo.io/t/preprocessor-additions-to-markdowns-syntax/5230>\
**Category:** support\
**Created:** [January 23, 2017, 1:17pm UTC](https://discourse.gohugo.io/t/preprocessor-additions-to-markdowns-syntax/5230 "2017-01-23T13:17:23Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [January 23, 2017, 11:15pm UTC](https://discourse.gohugo.io/t/preprocessor-additions-to-markdowns-syntax/5230/5 "2017-01-23T23:15:16Z")

</div>

@markand to give you an idea of how shortcodes _might_ help with your use case:

Create the following at `layouts/shortcodes/alert.html`:

```auto
<div class="alert alert-{{.Get 0}}" role="alert">{{.Get 1}}</div>

```

Then in your markdown files you can call this shortcode anywhere you want within the content/body copy for the file:

```markdown
{{< alert "info" "This is a notice." >}}

```

This should then render as follows:

```auto
<div class="alert alert-info">This is a notice.</div>

```

If you want the added ability to write the copy for the alert in markdown, you can use the alternate shortcode syntax at `layouts/shortcodes/alert.html`

```auto
<div class="alert alert-{{.Get 0}}" role="alert">{{- .Inner -}}</div>

```

But you would then have to call the shortcode using the `%`:

```markdown
{{% alert "info" %}}
This is a **notice**.
{{% /alert %}}

```

Which would render as…

```auto
<div class="alert alert-info" role="alert">This is a <strong>notice</strong>.</div>

```

---

_[View the full topic](https://discourse.gohugo.io/t/preprocessor-additions-to-markdowns-syntax/5230)._
