How do I format text fields with Shotgun Markdown?

Note: Shotgun also supports limited textile-to-HTML. Please see “How do I format text fields with textile-to-HTML?” for more details.

Shotgun currently supports Markdown rendering in the following places:

  • Note bodies, Note replies, and Note email notifications, and
  • Ticket descriptions, Ticket replies, and Ticket email notifications.

Read “Formatting records and fields (manually and with rules)” to learn more about formatting cells and rows using background colors and font-styling.

The Markdown implementation on Shotgun follows the widely-used "Github Flavored Markdown" (GFM) specification, with the addition of smart typographic quotes and some styling shorthand properties.

Examples

Inline-level styling

Italics and bold

Here, Shotgun differs from GFM by introducing more natural Slack-style shorthands:

Markdown Output
_italics_ italics
*bold* bold

But we have kept to the Markdown standard for longhand bold:

Markdown Output
__bold__ bold
**bold** bold

Strikethrough

Markdown Output
This is ~~bad~~ good! This is bad good!

Links

Shotgun will auto-link URL patterns it recognizes for you, but if you want to specify a link text, use:

Markdown Output
[Example Site](http://example.com) Example Site

Images

Markdown Output
![Title/Alt Text](URL) cat.jpeg

Code

Markdown Output
This is the `source` variable This is the source variable

Block-level styling

Paragraphs

First paragraph

Second paragraph
with manual line-breaks

Third paragraph

Headings

Headings are preceded by # and a space:

# Title

## Subtitle

### 3rd level

#### 4th level

##### 5th level?!

###### All the way up to 6th level!!
Note: You can also format the 1st two levels with any number of = or -:
Title
=

Subtitle
--------

Lists

Lists are simple:

- One
- Two
- Three

Lists can be either ordered or unordered, using either numbers or -, and nested at will (with four spaces):

Markdown Output
1. First item
2. Second item
    with manual line-breaks
    - Item 2.1
    - Item 2.2
3. Third item
    - Item 3.1
        - Item 3.1.1
  1. First item
  2. Second item with manual line-breaks
    • Item 2.1
    • Item 2.2
  3. Third item
    • Item 3.1
    • Item 3.1.1

Task items

You can even write up quick task lists:

Markdown Output
- [x] I've completed this
- [x] ~~I've _really_ completed this!~~
- [ ] Still need to do this
    Remember to also check:
    - [ ] Bits
    - [X] Bobs
- [ ] and this
checkbox

Blockquotes

Markdown Output
A paragraph

> A blockquote with 
manual line-breaks > > A paragraph belonging to the blockquote
A paragraph
A blockquote with
manual line-breaks
Another paragraph

Tables

At the bare minimum, tables are created by defining a header row divided by -, with cells divided by |:

Markdown Output
| Keys | Values |
| ---- | ------ |
| id   | 1234   |
| code | Yoyo   |
Keys Values
id 1234
code Yoyo
Note: Any number of -'s will do, and tables don't have to be bordered by |. This is uglier but faster to write, and syntactically equivalent:
Keys|Values
-|-
id|1234  
code|Yoyo  

Cell alignment

You can specify alignment as follows:

Markdown Output
ID   | active? | description
---: | :-----: | :----------
1234 | Y       | Left-aligned
56   | N       | Text
ID active? description
1234 Y Left-aligned
56 N Text
Note: Any number of -'s will do. This is uglier but faster to write, and syntactically equivalent:
ID | active? | description
-: | :-: | :-
1234 | Y | Left-aligned
56 | N | Text

Code blocks

Code blocks are delimited by triple back-ticks on their own line:

```
['one', 2, THREE].forEach(function(i) {
    console.log("Index '%d'", i);
});
```

Code blocks can also define a language, which will activate syntax highlighting!

Markdown Output
```javascript
['one', 2, THREE].forEach(function(i) {
    console.log("Index '%s'", i);
});
```
['one', 2, THREE].forEach(function(i) {
    console.log("Index '%s'", i);
});
    

Supported languages

Language name Alias
Apache apache, apacheconf
Bash bash, sh, zsh
CoffeeScript coffeescript, coffee, cson, iced
CPP cpp
CS cs
CSS css
Diff diff, patch
Dockerfile dockerfile, docker
Go go, golang
HTTP http, https
INI ini
Java java, jsp
JavaScript javascript, js, jsx
JSON json
Less less
Lua lua
Makefile makefile, mk, mak
Markdwon markdown, md, mkdown, mkd
NGINX nginx, nginxconf
Objective-C onjectivec, mm, objc, obj-c
Perl perl, pl, pm
PHP php, php3, php4, php5, php6
Python python, py, gyp
RIB rib
RSL rsl
Ruby ruby, rb, gemspec, podspec, thor, irb
SCSS scss
SQL sql
XML xml
YAML yml
Note: Let us know if your preferred language is missing!

Horizontal rules

Both --- or *** on their own line will produce a horizontal rule:

Two paragraphs

---

Separated by a line
Follow

0 Comments

Please sign in to leave a comment.