Guides and Sample Code

Developer

Apple News Format Reference

On This Page

Markdown for Apple News Format

This appendix describes how Apple News Format uses Markdown syntax. To learn more about Markdown, visit this Markdown website.

Apple News Format supports a subset of Markdown syntax. To use Markdown, set the format property on the following components to markdown:

Text-Level Markdown

These markdown features can be used within text paragraphs.

Emphasis (Italics)

To add italics, surround the text with single asterisks (*) or single underscores (_).

Markdown:

A sentence with _emphasis_ and two different types of *emphasis notation*.

Result:

A sentence with emphasis and two different types of emphasis notation.

Markdown:

This _sentence_'s Markdown formatting is (_more_) in_volved_.

Result:

This sentence’s Markdown formatting is (more) involved.

Strong (Bold)

To add bold, surround the text with double asterisks (**) or double underscores (__).

Markdown:

A sentence containing something **really important**.

Result:

A sentence containing something really important.

Markdown:

This __sentence__'s Markdown formatting is (__more__) in__volved__.

Result:

This sentence’s Markdown formatting is (more) involved.

Combined Emphasis (Italics) and Strong (Bold)

You can nest emphasis and strong emphasis to use bold-italic font faces by using underscores and double asterisks or by using double underscores and single asterisks.

Markdown:

A _**sentence**_ containing **_four_** ways to __*combine*__ strong and *__emphasis__*.

_An emphasized sentence containing a **strong phrase**._

Result:

In the first example, the words “sentence”, “four”, “combine”, and “emphasis” would be both in italics and bold.

In the second example, the entire sentence would be displayed in italics with “strong phrase” being italics and bold.

Markdown:

This _**sentence**_'s Markdown formatting is (__*more*__) *in__volved__*.

Result:

In this example, the word “sentence” (and not the “apostrophe s”) would be italics and bold, as is the word “more” (but not the parenthesis). The “volved” bit of the word “involved” would also be italics and bold (the “in” part of the word is italics only).

Links

To add a link to a website or another article, use brackets and parentheses. There must be at least one character inside the brackets. Empty brackets are invalid.

Markdown:

This text contains [a link to another page](http://www.apple.com).

_This emphasized sentence contains [a link to another page](http://www.apple.com)_.

This text contains an emphasized [_link to another page_](http://www.apple.com).

Result:

The first example contains a simple link: “This text contains a link to another page.”

The second example italicizes the entire sentence, including the link text.

The third example italicizes just the link.

Block-Level Markdown

Headings

To indicate that text is a heading, use the # character.

# Heading 1

## Heading 2

### Heading 3

#### Heading 4

##### Heading 5

###### Heading 6

Inline Text Style

To apply a predefined text style to text, use square brackets ([]) to surround the text you want to apply the style to, and use curly brackets ({}) to enclose the name of the text style you want to apply. The text style you refer to must be defined in the textStyles property at the top level of the document.

Markdown:

The trail passes the [Big Sur waterfall]{specialTextStyle} before ending in the valley.

Result:

The trail passes the Big Sur waterfall before ending in the valley.

Defining Paragraphs

To separate text into paragraphs, use two new lines between the end of one paragraph and the beginning of the next paragraph. In JSON, new lines are encoded as \n. Use two markdown tags (\n\n) as shown below.

Markdown:

Last line of paragraph 1\n\nFirst line of paragraph 2

Result:

Last line of paragraph 1

First line of paragraph 2

Lists

To create a bulleted list item, start a new line, then type either a hyphen (-), an asterisk (*), or a plus sign (+) followed by a space.

Markdown:

- First item

- Second item

Result:

• First item

• Second item

To create an ordered list, use numbers and periods followed by a space instead (1.).

Markdown:

1. First numbered item

2. Second numbered item

Result:

1. First numbered item

2. Second numbered item

Divider

To create a divider line or horizontal rule, type at least 3 hyphens (---) or 3 asterisks (***) on a new, empty line.

Dividers can separate portions of text.

---

Here's the epilogue to my story.

Map

To add a map that renders within your article, begin your URL with https://maps.apple.com/.

Markdown:

Apple's main campus occupies 32 acres in six buildings on [Infinite Loop](https://maps.apple.com?sll=37.3303991,-122.03233&t=standard&spn=0.009,0.009&q=Apple%20Inc).

Result:

Apple's main campus occupies 32 acres in six buildings on Infinite Loop.

image: ../Art/simulator-screen_2x.png

Escaping Markdown

To escape markdown, use backslashes as shown in the following examples.

Markdown:

This is an asterisk: \*\n\nThis is an underscore: \_

Result:

This is an asterisk: *

This is an underscore: _

Markdown:

1. First list item\n1. Second list item\n\n1\\. Not a list item

Result:

1. First list item

2. Second list item

1. Not a list item