Creating Content for Apple News

PageFrog
Mobile Publishing
Published in
3 min readNov 18, 2015

--

You create content for News by creating a JSON document that is processed and then rendered in News as a unit of rendered content, known as an article. An article can contain traditional text-based content or it can be a nontextual unit of content, such as a video or gallery. In the News app, these articles are referred to asstories.

JSON Document Building Blocks

You can think of a JSON document as consisting of standard JSON objects, with each object having a set of properties specified as a key-value pair. An object might contain content, or it might provide a definition (such as a particular layout) that’s applied to another object. Some object definitions are abstract, meaning that they are used only as the bases of objects that extend them. You’ll learn more about abstract definitions later.

The main object type in Apple News Format is the component. Most components contain content of some kind, but they can also define the structure or organization of an article. For example, two common component object types are (for structure) Container and (for content) Pullquote.

Each component must fit into the overall structure or purpose of the article it’s in. How it does this is captured by the component’s role. For example, a text component might have the role body to indicate that it appears in the body of the article. For a summary of all the component roles, see the appendix Component Role Summary.

Within a JSON document, components are laid out using a column system. For example, an image might start in column 2 and end in column 5.

Types of Document Information

An Apple News Format document can contain several types of information:

  1. Components that form the main content of the article (Required)
  2. Styling, layout definitions, animations, and behaviors that are applied to other objects (Optional)
  3. Metadata (Optional)

Some objects can be parents or children of other objects; for example, a Container object can have multiple child components.

For a list of required and optional properties for all Apple News Format documents, see Properties. A good way to get familiar with Apple News Format document structure is to review the example articles that illustrate various article types. These examples are found on the Apple Developer website for News Publisher.

Markdown Syntax

Apple News Format supports a subset of Markdown syntax. To use Markdown, set the format property on any of the Text (Abstract) components to markdown.

For infomation on using Markdown with Apple News Format, see the appendix Markdown for Apple News Format. To learn more about Markdown, visit this Markdown website.

Document Definitions

The definitions in Apple News Format documents are applied at several levels:

  • The JSON document in general, such as the version and various definitions that can be referenced by other components within the document
  • The content of the article, such as the title (headline), body, and images
  • A subset of components within the article, by type, such as all the images, all the subheadings, or all the captions
  • A range of specific characters within the article

When defining a component or assigning a value to a property, keep these level distinctions in mind.

Naming and Locating JSON Documents

Every Apple News Format document must have the file name article.json. If you’re using the News Preview app, all resources used in the article (such as images) must be in the same folder as the article.json file. For more information, see Previewing Content.

PageFrog is an free WordPress plugin designed to help publishers easily publish and manage content for mobile formats such as Facebook Instant Articles and Google AMP HTML. Download PageFrog Now

--

--