The primary objective of this specification is to define requirements for the production of Web Publications. In doing so, it also defines a framework for creating packaged publication formats, such as EPUB and audiobooks, where a pathway to the Web is highly desirable but not necessarily the primary method of interchange or consumption.

Many details of this draft are under active consideration within the Publishing Working Group and are subject to change. The most prominent known issues have been identified in this document and links provided to comment on them.

The most significant change to this draft is the splitting of the manifest from the requirements for Web Publications so that it can serve as a model for packaged formats that desire a slimmer set of default requirements.

The Publishing Working Group is actively producing proofs of concept of Web Publications and the technologies required to process them. For a list of these activities, please refer to the experiments page.

Introduction

Scope

This specification defines three key concepts:

  1. a general manifest format to describe publications;
  2. a concrete format using the manifest to represent publications on the Web (Web Publications); and
  3. the rules for using the manifest as the basis for modular extensions that desire a pathway to the Web.

This specification does not attempt to constrain the nature of the publications that can be produced—any type of work that can be represented using Web technologies is in scope. It is also designed to be adaptable to the needs of specific areas of publishing, such as audiobook production, and encourages a modular approach for creating specializations.

As much as possible, this specification leverages existing Open Web Platform technologies to achieve its goal—that being to allow for a measure of boundedness — on and off the Web — without changing the way that the Web itself operates.

Moreover, this specification is designed to adapt automatically to updates to Open Web Platform technologies in order to ensure that conforming publications continue to interoperate seamlessly as the Web evolves (e.g., by referencing the latest published versions instead of specific dated versions).

This specification is also intended to facilitate different user agent architectures for the consumption of Web Publications, or any format derived therefrom. While a primary goal is that traditional Web user agents (browsers) will be able to consume Web Publications, this should not limit the capabilities of any other possible type of user agent (e.g., applications, whether standalone or running within a user agent, or even Web Publications that include their own user interface). As a result, the specification does not attempt to architect required solutions for situations whose expected outcome will vary depending on the nature of the user agent and the expectations of the user (e.g., how to prompt to initiate a Web Publication, or at what point or how much of a Web Publication to cache for offline use).

This specification does not define how user agents are expected to render Web Publications. Details about the types of afforances that user agents can provide to enhance the reading experience for users are instead defined in [[PWP-UCR]].

Organization

This specification organized into three distinct parts, each of which builds on the previous:

Part I — Publication Manifest

The first part of this specification defines a general manifest format for expressing information about a digital publication. It uses [[Schema.org]] metadata augmented to include various structural properties about publications, and is serialized in [[JSON-LD]]. This definition is designed to be the basis for all the specific implementations of digital publications. It allows for interoperability between the formats while accommodating variances in the information that needs to be expressed. The actual manifest requirements for a digital publication format are defined by its respective specification.

Part II — Web Publications

The second part of this specification details the Web Publications format for defining and deploying publications on the Web. It explains the requirements for expressing the Web Publication manifest, as well as various implementation details such as the primary entry page and the table of contents. Web Publications are the Web deployment format for all digital publications based on a Publication Manifest, so all such extensions have to remain compatible with the requirements defined in this section.

Part III — Modular Extensions

The third part of this specification defines how create new packaged digital publication formats using the Publication Manifest model. While such formats are not required to be conforming Web Publications in their native state, it has to be possible to create content that can conform to both requirements.

Terminology

This document uses terminology defined by the W3C Note "Publishing and Linking on the Web" [[publishing-linking]], including, in particular, user, user agent, browser, and address.

Digital Publication

The term digital publication is used to refer to the encoding of a publication in any format that conforms to this specification, whether a Web Publication or a modular extension. All such digital publications share the common manifest format, but differ in their structural and content requirements.

Identifier

An identifier is metadata that can be used to refer to Web Content in a persistent and unambiguous manner. URLs, URNs, DOIs, ISBNs, and PURLs are all examples of persistent identifiers frequently used in publishing.

Manifest

A manifest represents structured information about a publication, such as informative metadata, a list of all resources, and a default reading order.

Non-empty

For the purposes of this specification, non-empty is used to refer to an element, attribute or property whose text content or value consists of one or more characters after whitespace normalization, where whitespace normalization rules are defined per the host format.

URL

The general term URL is defined by the URL Standard [[!url]]. It is used as in other W3C specifications, like HTML [[!html]]. In particular, a URL allows for the usage of characters from Unicode following [[!rfc3987]]. See the note in the HTML5 specification for further details.

Web Publication

A Web Publication is a collection of one or more resources, organized together through a manifest into a single logical work with a default reading order. The Web Publication is uniquely identifiable and presentable using Open Web Platform technologies.

PART I: Publication Manifest

Introduction

A digital publication is described by its manifest, which provides a set of properties expressed using the JSON-LD [[json-ld]] format (a variant of JSON [[ecma-404]] for linked data).

The manifest includes both descriptive properties about the publication, such as its title and author, as well as information about the nature and structure of the publication.

This section describes the construction requirements for manifests, and outlines the general set of properties for use with them.

Authored and Canonical Manifests

Depending on the state of a digital publication, its manifest exists in one of two forms:

Authored Manifest

The Authored Publication Manifest is the serialization of the manifest that the author provides with the digital publication (i.e., prior to be digital publication being processed by a user agent). Note that the author does not have to be human; a machine could automatically produce authored manifests for digital publications.

Canonical Manifest

The Canonical Publication Manifest is a version of the manifest created by user agents when they obtain the authored manifest and remove all possible ambiguities and incorporate any missing values that can be inferred from another source.

It is possible that an authored manifest is the equivalent of the canonical manifest if there are no ambiguities or missing information, but a canonical manifest only exists after a user agent has inspected the authored manifest as part of the process of obtaining it.

This part of the specification describes the requirements for creating an authored manifest, regardless of the format of the digital publication. Rules for constructing a canonical manifest from the authored manifest are defined for each specific implementation (e.g., the process for Web Publications is described in ).

WebIDL

Introduction

Although a digital publication's manifest is authored as [[json-ld]], a user agent processes this information into an internal data structure in order to utilize the properties. The exact manner in which this processing occurs, and how the data is used internally, is user agent-dependent.

To ensure interoperability when exposing the items, this specification defines an abstract representation of the data structures using the Web Interface Definition Language (WebIDL) [[webidl-1]]. The WebIDL definitions express the expected names, datatypes, and possible restrictions for each member of the manifest. (A WebIDL representation can be mapped onto ECMAScript, C, or other programming languages.)

Authors of digital publications are encouraged to review these definitions, but they are not necessary to understand.

The PublicationManifest Dictionary

dictionary PublicationManifest {

};

The PublicationManifest dictionary is the [[!webidl-1]] representation of the collection of manifest properties. WebIDL definitions are also provided at the end of each property that belongs to the dictionary — these represent the members of the PublicationManifest dictionary.

Refer to for a complete listing of the PublicationManifest dictionary.

Manifest Contexts

A digital publication's manifest MUST start by setting the JSON-LD context [[!json-ld]]. The context has the following two major components:

{
    "@context" : ["https://schema.org", "https://www.w3.org/ns/wp-context"],
    …
}

The publication context document adds features to the properties defined in Schema.org (e.g., the requirement for the creator property to be order preserving).

As part of the continuous contacts with Schema.org the additional features defined in the publication context file could migrate to the core Schema.org vocabulary.

Although Schema.org is often referenced using the http URI scheme, the vocabulary is being migrated to use the secure https scheme as its default. This specification requires the use of https when referencing Schema.org in the manifest.

Publication Types

A digital publication's manifest MUST define its Publication Type using the type term [[!json-ld]]. The type MAY be mapped onto CreativeWork [[!schema.org]].

{
    "@context" : ["https://schema.org", "https://www.w3.org/ns/wp-context"],
    "type"     : "CreativeWork"
    …
}

Schema.org also includes a number of more specific subtypes of CreativeWork, such as Article, Book, TechArticle, and Course. These MAY be used instead of, or in addition to, CreativeWork.

{
    "@context" : ["https://schema.org", "https://www.w3.org/ns/wp-context"],
    "type"     : "Book"
    …
}

Each Schema.org type defines a set of properties that are valid for use with it. To ensure that the manifest can be validated and processed by Schema.org aware processors, the manifest SHOULD contain only the properties associated with the selected type.

If properties from more than one type are needed, the manifest MAY include multiple type declarations.

{
    "@context" : ["https://schema.org", "https://www.w3.org/ns/wp-context"],
    "type"     : ["Book", "VisualArtwork"],
    …
}

User agents SHOULD NOT fail to process manifests that are not valid to their declared Schema.org type(s).

Refer to the Schema.org site for the complete list of CreativeWork subtypes.

partial dictionary PublicationManifest {
    required sequence<DOMString> type;
};

Properties

Introduction

A digital publication's manifest is defined by a set of properties that describe the basic information a user agent requires to process and render the publication. These properties are categorized as followed:

descriptive properties

Descriptive properties describe aspects of a digital publication, such as its title, creator, and language. These properties are primarily drawn from Schema.org and its hosted extensions [[schema.org]], so they map to one or several Schema.org properties and inherit their syntax and semantics. (The following property categories typically do not have Schema.org equivalents, so are defined specifically for publications.)

resource categorization

Resource categorization properties describe or identify common sets of resources, such as the resource list and default reading order. These properties refer to one or more resources, such as HTML documents, images, script files, and separate metadata files.

informative properties

Informative properties identify resources that contain additional information about the publication, such as its privacy policy or accessibility report.

structural properties

Structural properties identify key meta structures of the publication, such as the cover image, table of contents, and page list.

The categorization of properties is done to simplify comprehension of their purpose; the groupings have no relevance outside this specification (i.e., the groupings do not exist in the manifest).

Each manifest item drawn from schema.org identifies the property it maps to and includes its defining type in parentheses. Properties are often available in many types, however, as a result of the schema.org inheritance model. Refer to each property definition for more detailed information about where it is valid to use.

Schema.org additionally includes a large number of properties that, though relevant for publishing, are not mentioned in this specification — publication authors can use any of these properties. This document defines only the minimal set of manifest items.

There are discussion on whether a best practices document would be created, referring to more schema.org terms. If so, it should be linked from here.

Quick Reference

The way that properties are expressed in the manifest often differs from how they are referred to using natural language. The following table provides a mapping between property names and the sections where they are explained to help clarify the differing nomenclature:

Property Name Defined In
accessMode Accessibility
accessModeSufficient Accessibility
accessibilityAPI Accessibility
accessibilityControl Accessibility
accessibilityFeature Accessibility
accessibilityHazard Accessibility
accessibilitySummary Accessibility
artist Creators
author Creators
contents Table of Contents
contributor Creators
creator Creators
dateModified Last Modification Date
datePublished Publication Date
editor Creators
https://www.w3.org/ns/wp#accessibility-report Accessibility Report
https://www.w3.org/ns/wp#cover Cover
https://www.w3.org/ns/wp#pagelist Pagelist
illustrator Creators
inDirection Direction
inker Creators
inLanguage Language
letterer Creators
link Links
name Title
penciler Creators
privacy-policy Privacy Policy
publisher Creators
readBy Creators
readingOrder Default Reading Order
readingProgression Reading Progression Direction
resources Resource List
translator Creators

Values

Arrays and Single Values

Various manifest properties can have one or more values. As a general rule, these values can be expressed as [[!json]] arrays. When the property value is an array with a single element, however, the array syntax MAY be omitted.

Text Values or Objects

Various manifest properties are expected to be expressed as [[!json]] objects. Although the use of objects is usually recommended, it is also acceptable to use string values that are interpreted as objects depending on the context. The exact mapping of text values to objects is part of the property or object definitions.

Relative URLs

Relative URL strings MAY be used in the manifest. These URLs are resolved to absolute URL strings using a base URL [[!url]].

The base URL for relative URLs is determined as follows:

By consequence, relative URLs in embedded manifests are resolved against the URL of the primary entry page unless the page declares a base URL (i.e., in a <base> element in its header).

The usage (or not) of the <base> element for embedded manifests is currently the subject of several issues in the JSON-LD Working Group: JSON-LD #22, JSON-LD #57, and, ultimately, TAG #312.

Descriptive Properties

Accessibility

The accessibility properties provides information about the suitability of a digital publication for consumption by users with varying preferred reading modalities. These properties typically supplement an evaluation against established accessibility criteria, such as those provided in [[WCAG20]]. (For linking to a detailed accessibility report, see .)

The following properties are categorized as accessibility properties:

Term Description Required Value [[!schema.org]] Mapping
accessMode The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. One or more text(s). Expected values. accessMode (CreativeWork)
accessModeSufficient A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. One or more ItemList. Expected values. accessModeSufficient (CreativeWork)
accessibilityAPI Indicates that the resource is compatible with the referenced accessibility APIs. One or more text(s).Expected values. accessibilityAPI (CreativeWork)
accessibilityControl Identifies input methods that are sufficient to fully control the described resource. One or more text(s). Expected values. accessibilityControl (CreativeWork)
accessibilityFeature Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. One or more text(s). Expected values. accessibilityFeature (CreativeWork)
accessibilityHazard A characteristic of the described resource that is physiologically dangerous to some users. One or more text(s).Expected values. accessibilityHazard (CreativeWork)
accessibilitySummary A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as “short descriptions are present but long descriptions will be needed for non-visual users” or “short descriptions are present and no long descriptions are needed.” Text. accessibilitySummary (CreativeWork)

Detailed descriptions of these properties are available on the WebSchemas Wiki site.

Values SHOULD be drawn from the preferred vocabulary for each accessibility property, but user agents MUST NOT omit values from that are not included in the lists when generating the canonical manifest.

The author can also provide a reference to a detailed Accessibility Report if more information is needed than can be expressed by these properties.

partial dictionary PublicationManifest {
    sequence<DOMString> accessMode;
    sequence<DOMString> accessModeSufficient;
    sequence<DOMString> accessibilityAPI;
    sequence<DOMString> accessibilityControl;
    sequence<DOMString> accessibilityFeature;
    sequence<DOMString> accessibilityHazard;
    LocalizableString   accessibilitySummary;
};
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "CreativeWork",
    …
    "accessibilityAPI"      : "ARIA",
    "accessMode"            : ["textual", "visual"],
    "accessModeSufficient"  : [
        {
            "type"           : "ItemList",
            "itemListElement": ["textual", "visual"]
        },
        {
            "type"           : "ItemList",
            "itemListElement": ["textual"]
        }
    ],
    …
}
Creators

A creator is an individual or entity responsible for the creation of the digital publication.

The following properties are categorized as creators:

Term Description Required Value [[!schema.org]] Mapping
artist The primary artist for the publication, in a medium other than pencils or digital line art. One or more Person. artist (VisualArtwork)
author The author of the publication. One or more Person and/or Organization. author (CreativeWork)
colorist The individual who adds color to inked drawings. One or more Person. colorist (VisualArtwork)
contributor Contributor whose role does not fit to one of the other roles in this table. One or more Person and/or Organization. contributor (CreativeWork)
creator The creator of the publication. One or more Person and/or Organization. creator (CreativeWork)
editor The editor of the publication. One or more Person. editor (CreativeWork)
illustrator The illustrator of the publication. One or more Person. illustrator (Book)
inker The individual who traces over the pencil drawings in ink. One or more Person. inker (VisualArtwork)
letterer The individual who adds lettering, including speech balloons and sound effects, to artwork. One or more Person. letterer (VisualArtwork)
penciler The individual who draws the primary narrative artwork. One or more Person. penciler (VisualArtwork)
publisher The publisher of the publication. One or more Person and/or Organization. publisher (CreativeWork)
readBy A person who reads (performs) the publication (for audiobooks). One or more Person. readBy (Audiobook)
translator The translator of the publication. One or more Person and/or Organization. translator (CreativeWork)

Creators are represented in one of the following two ways:

  1. as a string encoding the name of a Person [[!schema.org]]; or
  2. as an instance of a Person or Organization [[!schema.org]].

In other words, a single string value is a shorthand for a [[!schema.org]] Person whose name property is set to that string value. (See also .)

When compiling each set of creator information from a [[!schema.org]] Person or Organization type, user agents MUST retain the following information when available:

type
One or more strings that identifies the type of creator. This sequence SHOULD include "Person" or "Organization".
name
One or more localizable strings for the name of the creator.
id
A canonical identifier of the creator as a URL. [[!url]]
url
An address for the creator in the form of a URL. [[!url]]

Note that user agents MAY interpret a wider range of creator properties defined by Schema.org than the ones in the preceding list.

The manifest MAY include more than one of each type of creator.

partial dictionary PublicationManifest {
    sequence<CreatorInfo> artist;
    sequence<CreatorInfo> author;
    sequence<CreatorInfo> colorist;
    sequence<CreatorInfo> contributor;
    sequence<CreatorInfo> creator;
    sequence<CreatorInfo> editor;
    sequence<CreatorInfo> illustrator;
    sequence<CreatorInfo> inker;
    sequence<CreatorInfo> letterer;
    sequence<CreatorInfo> penciler;
    sequence<CreatorInfo> publisher;
    sequence<CreatorInfo> readBy;
    sequence<CreatorInfo> translator;
};


dictionary CreatorInfo {
             sequence<DOMString>         type;
    required sequence<LocalizableString> name;
             DOMString                   id;
             DOMString                   url;
};
{
    "type"     : "Book",
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    …
    "url"      : "https://publisher.example.org/mobydick",
    "author"   : {
        "type"  : "Person",
        "name"  : "Herman Melville"
    }
}
{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "TechArticle",
    …
    "id"         : "http://www.w3.org/TR/tabular-data-model/",
    "url"        : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    "author"     : [
        "Jeni Tennison",
        {
            "type"  : "Person",
            "name" : "Gregg Kellogg",
        },{
            "type"  : "Person",
            "name" : "Ivan Herman",
            "id"   : "https://www.w3.org/People/Ivan/"
        }
    ],
    "editor"    : [
        "Jeni Tennison",
        {
            "type"  : "Person",
            "name" : "Gregg Kellogg",
        }
    ],
    "publisher" : {
        "type"  : "Organization",
        "name" : "World Wide Web Consortium",
        "id"   : "https://www.w3.org/"
    }
    …
}
Language and Base Direction

A digital publication has at least one natural language, which is the language that the content is expressed in (e.g., English, French, Chinese). It also has a natural base direction in which it is written — the display direction, either left-to-right or right-to-left.

The digital publication manifest includes entries to set both these concepts, which can influence, for example, the behavior of a user agent (e.g., it might place a pop-up for a table of contents on the right hand side for publications whose natural base direction is right-to-left).

Similarly, each natural language property value in the publication's manifest (e.g., title, creators) is localizable [[string-meta]], meaning that the same information is available for each.

The natural language and base direction can be set for both the publication and the natural language properties values of the manifest.

If a user agent requires the language and one is not available in the authored manifest (either globally or specifically for that property), or the obtained value is invalid, the user agent MAY attempt to determine the language when generating the canonical manifest. This specification does not mandate how such a language tag is created. The user agent might:

  • use the non-empty language declaration of the manifest;
  • use the first non-empty language declaration found in a resource in the default reading order;
  • calculate the language using its own algorithm.

No default values are specified for the language or the default base direction.

Proposal for handling localizable texts (writeup of the F2F discussions)

Global Language and Direction

The manifest MAY include global language and base direction declarations for the publication using the following properties.

Term Description Required Value [[!schema.org]] Mapping
inLanguage Default language for the publication as well as the textual manifest values language code as defined in [[!bcp47]] inLanguage (Property)
inDirection Default base direction for the publication as well as the textual manifest values ltr, rtl, or auto (None)

The natural language MUST be a tag that conforms to [[!bcp47]], while the base language direction MUST have one of the following values:

  • ltr: indicates that the textual values are explicitly directionally set to left-to-right text;
  • rtl: indicates that the textual values are explicitly directionally set to right-to-left text;
  • auto indicates that the textual values are explicitly directionally set to the direction of the first character with a strong directionality, following the rules of the Unicode Bidirectional Algorithm [[!bidi]].

When specified, these properties are also used as defaults for textual values in the manifest.

It is important to differentiate the language of the publication from the language and the base direction of the individual resources that compose it. If such resources are, for example, in HTML, the language and direction need to be set in those resources, too. The language and base direction of the publication are not inherited.

The global language information MAY be overridden by individual values.

If the manifest is embedded in the primary entry page via a script element, and the manifest does not set the global language and/or the base direction (see ), the lang and the dir attributes of the script element are used as the global language and base direction, respectively (see the details on handling the lang and dir attributes in [[!html]]).

It is to be discussed whether this last paragraph, i.e., inheriting values from script, should be kept.

If authors intend to use a manifest, or a manifest template, both as embedded manifest and as a separate resource, they are strongly encouraged to set these properties explicitly to avoid interference of the containing script element in case of embedding.

partial dictionary PublicationManifest {
    DOMString     inLanguage;
    TextDirection inDirection;
};

enum TextDirection {
    "ltr",
    "rtl",
    "auto"
};
Item-specific Language

It is possible to set the language for any textual value in the manifest. This information MUST be set as a localizable string, i.e., using the value and language terms (instead of a simple string) [[!json-ld]]:

{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "author" : {
        "type"  : "Person",
        "name" : {
            "value"    : "Marcel Proust",
            "language" : "fr"
        }
    }
}

The value of the language MUST be set to a language code as defined in [[!bcp47]].

When used in a context of localizable texts, a simple string value is a shorthand for a localizable string, with the value set to the string value, and the language set to the value of the inLanguage property, if applicable, and unset otherwise. In other words, the previous example is equivalent to:

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    "inLanguage" : "fr",
    …
    "author"     : "Marcel Proust",
}

(See also .)

It is not possible to set the direction explicitly for a value.

Setting the direction for a natural text value is currently not possible in JSON-LD [[json-ld]]. In case the JSON-LD community, as well as the schema.org community, introduces such a feature, future versions of this specification may extend the ability of manifests to include this.

When using manifests with bidirectional text, user agents SHOULD identify the base direction of any given natural language value by scanning the text for the first strong directional character. Once the base direction has been identified, user agents MUST determine the appropriate rendering and display of natural language values according to the Unicode Bidirectional Algorithm [[!bidi]]. This could require wrapping additional control characters or markup around the string prior to display, in order to apply the base direction. (See .)

dictionary LocalizableString {
    required DOMString value;
             DOMString language;
};
Last Modification Date

The last modification date is the date when the digital publication was last updated (i.e., whenever changes were last made to any of the resources of the publication, including the manifest). It is expressed using the dateModified property.

Term Description Required Value [[!schema.org]] Mapping
dateModified Last modification date of the publication. A Date or DateTime value [[!schema.org]], both expressed in ISO 8601 Date, or Date Time formats, respectively [[iso8601]]. dateModified (CreativeWork)

The last modification date does not necessarily reflect all changes to the publication (e.g., third-party content could change without the author being aware). User agents SHOULD check the last modification date of individual resources to determine if they have changed and need updating.

partial dictionary PublicationManifest {
    DOMString dateModified;
};
{
    "@context"     : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"         : "TechArticle",
    …
    "id"           : "http://www.w3.org/TR/tabular-data-model/",
    "url"          : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    "dateModified" : "2015-12-17",
    …
}
Publication Date

The publication date is the date on which the digital publication was originally published. It represents a static event in the lifecycle of a publication and allows subsequent revisions to be identified and compared. It is expressed using the datePublished property.

Term Description Required Value [[!schema.org]] Mapping
datePublished Creation date of the publication. A Date or DateTime, both expressed in ISO 8601 Date, or Date Time formats, respectively [[!iso8601]]. datePublished (CreativeWork)

The exact moment of publication is intentionally left open to interpretation: it could be when the publication is first made available online or could be a point in time before publication when the publication is considered final.

partial dictionary PublicationManifest {
    DOMString datePublished;
};
{
    "@context"      : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"          : "TechArticle",
    …
    "id"            : "http://www.w3.org/TR/tabular-data-model/",
    "url"           : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    "datePublished" : "2015-12-17",
    "dateModified"  : "2016-01-30",
    …
}
Reading Progression Direction

The reading progression establishes the reading direction from one resource to the next within a digital publication. It is expressed using the readingDirection property.

Term Description Required Value [[!schema.org]] Mapping
readingProgression Reading direction from one resource to the other. ltr or rtl (None)

The value of this property MUST be either:

  • ltr: left-to-right;
  • rtl: right-to-left.

The default value is ltr.

This property has no effect on the rendering of the individual primary resources; it is only relevant for the progression direction from one resource to the other.

The reading progression of a publication is used to adapt such publication level interactions as menu position, swap direction, defining tap zones to lead the user to the next and previous pages, touch gestures, etc.

If the readingProgression is not set, user agents MUST use the default value ltr when generating the canonical manifest.

partial dictionary PublicationManifest {
    ProgressionDirection readingProgression = "ltr";
};

enum ProgressionDirection {
	"ltr",
	"rtl"
};
{
    "@context"           : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"               : "Book",
    …
    "url"                : "https://publisher.example.org/mobydick",
    "readingProgression" : "ltr"
}
Title

The title provides the human-readable name of the digital publication. It is expressed using the name property.

Term Description Required Value [[!schema.org]] Mapping
name Human-readable title of the publication. One or more text items for the title. name (Thing)

If a title is not included in the authored manifest, and a digital publication does not define alternative rules for obtaining one, the user agent MUST create one. This specification does not specify what heuristics to use to generate such a title.

A user agent is not expected to produce a meaningful title [[wcag20]] for a publication when one is not specified.

partial dictionary PublicationManifest {
    required sequence<LocalizableString> name;
};
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "url"      : "https://publisher.example.org/mobydick",
    "name"     : "Moby Dick"
}

Resource Categorization Properties

Publication resources are specified via the default reading order, the resource list, and the links, as defined in this section. These lists contain references to informative properties like the privacy policy, and structural properties like the table of contents.

Note that a particular resource's URL MUST NOT appear in more than one of these lists, and a URL MUST NOT be repeated within a list.

The manifest MUST NOT include a reference to itself within any of these lists.

Default Reading Order

The default reading order is a specific progression through a set of digital publication resources. A user might follow alternative pathways through the content, but in the absence of such interaction the default reading order defines the expected progression from one resource to the next.

The default reading order is expressed using the readingOrder property.

Term Description Required Value [[!schema.org]] Mapping
readingOrder

An array of:

  • a string, representing the URL [[url]] of the resource; or
  • an instance of a LinkedResource object

The order in the array is significant. The URLs MUST NOT include fragment identifiers. Non-HTML resources SHOULD be expressed as LinkedResource objects with their encodingFormat values set.

(None)

The default reading order MUST include at least one resource.

partial dictionary PublicationManifest {
   required sequence<LinkedResource> readingOrder;
};
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "url"      : "https://publisher.example.org/mobydick",
    "name"     : "Moby Dick",
    "readingOrder" : [
        "html/title.html",
        "html/copyright.html",
        "html/introduction.html",
        "html/epigraph.html",
        "html/c001.html",
        …
    ]
}
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "url"      : "https://publisher.example.org/mobydick",
    "name"     : "Moby Dick",
    "readingOrder" : [{
        "type"           : "LinkedResource",
        "url"            : "html/title.html",
        "encodingFormat" : "text/html",
        "name"           : "Title page"
    },{
        "type"           : "LinkedResource",
        "url"            : "html/copyright.html",
        "encodingFormat" : "text/html",
        "name"           : "Copyright page"
    },{
        …
    }]
}
Resource List

The resource list enumerates any additional resources used in the processing and rendering of a digital publication that are not already listed in the default reading order. It is expressed using the resources property.

Term Description Required Value [[!schema.org]] Mapping
resources

An array of:

  • a string, representing the URL [[url]] of the resource; or
  • an instance of a LinkedResource object

The order in the array is not significant. The URLs MUST NOT include fragment identifiers. It is RECOMMENDED to use LinkedResource objects with their encodingFormat values set.

(None)

The completeness of the resource list can affect the usability of a digital publication in certain reading scenarios (e.g., the ability to read it offline). For this reason, it is strongly RECOMMENDED to provide a comprehensive list of all of the publication's constituent resources beyond those listed in the default reading order.

In some cases, a comprehensive list of these resources might not be easily achieved (e.g., third-party scripts that reference resources from deep within their source), but a user agent SHOULD still be able to render a publication even if some of these resources are not identified as belonging to the publication (e.g., if it is taken offline without them).

partial dictionary PublicationManifest {
    sequence<LinkedResource> resources = [];
};
{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "TechArticle",
    …
    "id"         : "http://www.w3.org/TR/tabular-data-model/",
    "url"        : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    …
    "resources"  : [
        "datatypes.html",
        "datatypes.svg",
        "datatypes.png",
        "diff.html",
        {
            "type"              : "LinkedResource",
            "url"               : "test-utf8.csv",
            "encodingFormat"    : "text/csv"
        },{
            "type"              : "LinkedResource",
            "url"               : "test-utf8-bom.csv",
            "encodingFormat"    : "text/csv"
        },{
            …
        }
    ],
    …
}

Informative Properties

Accessibility Report

An accessibility report provides information about the suitability of a digital publication for consumption by users with varying preferred reading modalities. These reports typically identify the result of an evaluation against established accessibility criteria, such as those provided in [[WCAG21]], and are an important source of information in determining the usability of a publication.

An accessibility report is identified using the https://www.w3.org/ns/wp#accessibility-report link relationship.

The manifest SHOULD include a link to an accessibility report when one is available for a publication. It is RECOMMENDED that the report be included as a resource of the publication.

It is also RECOMMENDED that the accessibility report be provided in a human-readable format, such as [[!html]]. Augmenting these reports with machine-processable metadata, such as provided in Schema.org [[!schema.org]], is also RECOMMENDED.

The Working Group will attempt to define the accessibility-report term with IANA, to avoid using a URL.

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/mobydick",
    "name"       : "Moby Dick",
    "links"  : [{
        "type"        : "LinkedResource",
        "url"         : "https://www.publisher.example.org/mobydick-accessibility.html",
        "rel"         : "https://www.w3.org/ns/wp#accessibility-report"
    },{
        …
    }],
    …
}
Privacy Policy

Users often have the legal right to know and control what information is collected about them, how such information is stored and for how long, whether it is personally identifiable, and how it can be expunged. Including a statement that addresses such privacy concerns is consequently an important part of publishing digital publications. Even if no information is collected, such a declaration increases the trust users have in the content.

A link to a privacy policy can be included in the manifest for this purposes. It is RECOMMENDED that the privacy policy be included as a resource of the publication.

The privacy policy is identified using the privacy-policy link relationship [[!iana-link-relations]].

It is RECOMMENDED that the privacy policy be provided in a human-readable format, such as HTML [[html]].

Refer to for more information about privacy considerations in publications.

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "TechArticle",
    …
    "id"         : "http://www.w3.org/TR/tabular-data-model/",
    "url"        : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    …
    "links"  : [{
        "type"           : "LinkedResource",
        "url"            : "https://www.w3.org/Consortium/Legal/privacy-statement-20140324",
        "encodingFormat" : "text/html",
        "rel"            : "privacy-policy"
    },{
            …
    }],
    …
}

Structural Properties

Cover

The cover is a resource that user agents can use to present the digital publication (e.g., in a library or bookshelf, or when initially loading the publication).

The cover is identified by the https://www.w3.org/ns/wp#cover link relationship. The URL expressed in the url term MUST NOT include a fragment identifier.

If the cover is in an image format, a title and description SHOULD be provided. User agents can use these properties to provide alternative text and descriptions when necessary for accessibility.

More than one cover MAY be referenced from the manifest (e.g., to provide alternative formats and sizes for different device screens). If multiple covers are specified, each instance MUST define at least one unique property to allow user agents to determine its usability (e.g., a different format, height, width or relationship).

The Working Group will attempt to define the cover term by IANA, to avoid using a URL.

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/donquixote",
    "name"       : "Don Quixote",
    "resources"  : [{
        "type"           : "LinkedResource",
        "url"            : "cover.html",
        "encodingFormat" : "text/html"
        "rel"            : "https://www.w3.org/ns/wp#cover"
    },{
        …
    }],
    …
}
{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/mobydick",
    "name"       : "Moby Dick",
    "resources"  : [{
        "type"           : "LinkedResource",
        "url"            : "whale-image.jpg",
        "encodingFormat" : "image/jpeg",
        "rel"            : "https://www.w3.org/ns/wp#cover",
        "name"           : "Moby Dick attacking hunters",
        "description"    : "A white whale is seen surfacing from the water to attack a small whaling boat"
    },{
        …
    }],
    …
}
{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/donquixote",
    "name"       : "Gulliver's Travels",
    "resources"  : [{
        "type"           : "LinkedResource",
        "url"            : "lilliput.jpg",
        "encodingFormat" : "image/jpeg",
        "rel"            : "https://www.w3.org/ns/wp#cover"
    },{
        "type"           : "LinkedResource",
        "url"            : "lilliput.svg",
        "encodingFormat" : "image/svg+xml",
        "rel"            : "https://www.w3.org/ns/wp#cover"
    },{
        …
    }],
    …
}
Page List

The page list property identifies the digital publication's page list. It MAY be used either to embed a page list within the manifest or to identify a resource that contains the list. How the page list has to be represented is determined by the digital publication format.

When the page list is contained in a separate resource, the resource MUST be identified by the https://www.w3.org/ns/wp#pagelist link relationship. The URL expressed in the url term MUST NOT include a fragment identifier.

The link to the page list MAY be specified in either the default reading order or resource-list, but MUST NOT be specified in both.

{
"@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
"type"       : "Book",
…
"url"        : "https://publisher.example.org/mobydick",
"name"       : "Moby Dick",
"resources"  : [{
	"type"       : "LinkedResource",
	"url"        : "toc_file.html",
	"rel"        : "https://www.w3.org/ns/wp#pagelist"
},{
	…
}],
…
}
Table of Contents

The table of contents property identifies the digital publication's table of contents. It MAY be used either to embed a table of contents within the manifest or to identify a resource that contains the table of contents. How the table of contents has to be represented is determined by the digital publication format.

When the table of contents is contained in a separate resource, the resource MUST be identified by the contents link relationship [[!iana-link-relations]]. The URL expressed in the url term MUST NOT include a fragment identifier.

The link to the table of contents MAY be specified in either the default reading order or resource-list, but MUST NOT be specified in both.

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/mobydick",
    "name"       : "Moby Dick",
    "resources"  : [{
        "type"       : "LinkedResource",
        "url"        : "toc_file.html",
        "rel"        : "contents"
    },{
        …
    }],
    …
}
<head>
    …
    <script type="application/ld+json">
    {
        "@context"        : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "type"            : "TechArticle",
        …
        "id"              : "http://www.w3.org/TR/tabular-data-model/",
        "url"             : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
        …
    }
    </script>
    …
</head>
<body>
    …
    <section role="doc-toc">
        …
    </section>
    …
</body>

Extensibility

The manifest is designed to provide a basic set of properties for use by user agents in presenting and rendering a digital publication, but MAY be extended in the following ways:

  1. by the provision of linked metadata records.
  2. through the inclusion of additional properties in the manifest;

Although both methods are valid, the use of linked records is RECOMMENDED.

This specification does not define how such additional properties are compiled, stored or exposed by user agents in their internal representation of the manifest. A user agent MAY ignore some or all extended properties.

Linked records

Extending the manifest through links to a record, such as an ONIX [[onix]] or BibTeX [[bibtex]] file, MUST be expressed using a LinkedResource object, where:

  • the rel value of the LinkedResource SHOULD include a relevant identifier defined by IANA or by other organizations; if the link record contains descriptive metadata it MUST include the describedby (IANA) identifier;
  • the value of the encodingFormat in the link MUST use the MIME media type [[!rfc2046]] defined for that particular type of record, if applicable.

Linked records MUST be included in the resource list when they are part of the publication (i.e., are needed for more than just manifest extensibility). Otherwise, they MUST be included in the links list.

{
"@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
"type"       : "Book",
…
"url"        : "https://publisher.example.org/mobydick",
"name"       : "Moby Dick",
"links"  : [{
	"type"            : "LinkedResource",
	"url"             : "https://www.publisher.example.org/mobydick-onix.xml",
	"encodingFormat"  : "application/onix+xml",
	"rel"             : "describedby"
},{
	…
}],
…
}

The application/onix+xml MIME type has not yet been registered by IANA at the time of writing this document, and is included in the example for illustrative purposes only.

Additional Properties in the Manifest

Additional properties can be included directly in the manifest. It is RECOMMENDED that these properties be taken from public schemes like [[schema.org]] or [[dcterms]] and use values from controlled vocabularies whenever possible. Proprietary terms MAY be used, but it is RECOMMENDED that such terms be included using Compact IRIs [[!json-ld]], with prefixes defined as part of the context.

{
"@context"        : ["https://schema.org","https://www.w3.org/ns/wp-context"],
"type"            : "TechArticle",
…
"id"              : "http://www.w3.org/TR/tabular-data-model/",
"url"             : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
"copyrightYear"   : "2015",
"copyrightHolder" : "World Wide Web Consortium",
…
}
{
"@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
"type"       : "CreativeWork",
…
"id"         : "http://www.w3.org/TR/tabular-data-model/",
"url"        : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
"dc:subject" : ["Web data description languages","Data integration","Data Exchange"]
…
}

A prefix definition dc for [[dcterms]] is included in the context file of [[schema.org]]. This means that it is not necessary to add the prefix explicitly. The same is true for a number of other public vocabularies; see the schema.org context file for further details.

PART II: Web Publications

Introduction

A Web Publication is a discoverable and identifiable collection of resources. Information about the Web Publication is expressed in its manifest, which is an implementation of the format defined in . The manifest is what enables user agents to understand the bounds of the Web Publication and the connection between its resources.

The manifest includes metadata that describe the Web Publication, as a publication has an identity and nature beyond its constituent resources. The manifest also provides a list of all the resources that belong to the Web Publication and a default reading order, which is how it connects resources into a single contiguous work.

A Web Publication is discoverable via the presence of a link to the manifest in any of its resources (i.e., by the use of an HTTP Link header or an HTML link element [[html]]). The linked manifest is contained either directly within the resource containing the link (in a special case called the primary entry page) or in a separate JSON-LD document.

With the establishment of Web Publications, user agents can build new experiences tailored specifically for their unique reading needs.

Flowchart depicts the resources of a Web Publication and their attachment to a manifest.

Simplified Diagram of the Structure of Web Publications.
A description of the structure diagram is available in the Appendix. Image available in SVG and PNG formats.

Conformance Classes

This specification defines two conformance classes: one for Web Publications and one for user agents that process them.

A Web Publication conforms to this specification if it meets the following criteria:

A user agent conforms to this specification if it meets the following criteria:

Web Publication Construction

Publication Bounds

A Web Publication consists of a finite set of resources that represent its content. This extent is known as its bounds and is defined within its manifest — it is obtained from the union of resources listed in the default reading order and resource list.

To determine whether a resource is within the bounds of a Web Publication, user agents MUST compare the absolute URL of a resource to the absolute URLs of the resources obtained from the union. If the resource is identified in the enumeration, it is within the bounds of the Web Publication. All other resources are external to the Web Publication.

Resources within the bounds of a Web Publication do not have to share the same domain.

Resources

A Web Publication MUST include at least one HTML document [[!html]]—the primary entry page.

Otherwise, a Web Publication MAY references resources of any media type, both in the default reading order and as dependencies of other resources.

When adding resources to a Web Publication, consider support in user agents. The use of progressive enhancement techniques and the provision of fallback content, as appropriate, will ensure a more consistent reading experience for users regardless of their preferred user agent.

Primary Entry Page

The primary entry page represents the preferred starting resource for a Web Publication and enables discovery of its manifest. It is the resource that is returned when accessing the Web Publication's address, and MUST be included in either the default reading order or the resource list.

Although any resource can link to the manifest, the primary entry page typically introduces the Web Publication and provides access to the content. It might contain all the content, in the case of a single-page Web Publication, or provide navigational aids to begin reading a multi-document Web Publication. To facilitate the user ease of consumption, the primary entry page SHOULD contain the table of contents.

It is not required that the primary entry page be included in the default reading order, nor that it be the first document listed when it is included. This specification leaves the exact nature of the document intentionally underspecified to provide flexibility for different approaches. If a default reading order is not provided, however, user agents will create one using the primary entry page.

The primary entry page is the only resource in which a manifest can be embedded.

To ensure discovery of the manifest, the primary entry page MUST provide a link to the manifest. It is RECOMMENDED to embed the manifest in the primary entry page, but the manifest MAY be external to, and linked from, it.

Embedding is the preferred option as search engines might only process schema.org metadata in JSON-LD format when it is embedded in an HTML page.

The address of the primary entry page is also the canonical identifier for the Web Publication (i.e., it serves as its unique identifier).

In certain cases where information has been omitted from the manifest, user agents will sometimes use the primary entry page as a fallback source of information (see language and base direction and title).

Table of Contents

The table of contents provides a hierarchical list of links that reflects the structural outline of the major sections of the Web Publication.

The table of contents is expressed via an [[!html]] element (typically a nav element) in one of the resources. This element MUST be identified by the role attribute [[!html]] value "doc-toc" [[!dpub-aria-1.0]], and MUST be the first element in the document — in document tree order [[!dom]] — with that role value.

If the table of contents is not located in the primary entry page, the manifest SHOULD identify the resource that contains the structure.

When specified, the table of content MUST include a link to at least one resource, and all links SHOULD refer to resources within publication bounds.

Refer to the table of contents property definition for more information on how to identify which resource contains the table of contents.

Page List

The page list is a list of links that provides navigation to static page demarcation points within the content. These locations allow users to coordinate access into the content, but the exact nature of the locations is left to content creators to define. They usually correspond to pages of a print document which is the source of the Web Publication, but might be a purely digital creation added to ease navigation.

The page list is expressed via an [[!html]] element (typically a nav element) in one of the resources. This element MUST be identified by the role attribute [[!html]] value "doc-pagelist" [[!dpub-aria-1.0]], and MUST be the first element in the document — in document tree order [[!dom]] — with that role value.

If the page list is not located in the primary entry page, the manifest SHOULD identify the resource that contains the structure.

There are no requirements on the page list itself, except that, when specified, it MUST include a link to at least one resource.

Refer to the pagelist property definition for more information on how to identify which resource contains the page list.

Manifest

Properties

Requirements

The expression of properties in a Web Publication manifest includes a combination of those defined generally for digital publications as well as two specific to Web Publications: the publication's address and canonical identifier.

The requirements for the expression of these properties are as follows:

REQUIRED:
RECOMMENDED:

These properties do not all have to be serialized in the authored manifest. Refer to each property's definition to determine whether it is required in the manifest or can be compiled into the canonical manifest from other information.

Address

A Web Publication's address is a URL [[!url]] that represents the primary entry page for the Web Publication. It is expressed using the url property.

Term Description Required Value [[!schema.org]] Mapping
url URL of the primary entry page. A URL [[!url]]. url (Thing)

If the address does not resolve to an HTML document [[!html]], user agents SHOULD NOT provide access to the resource to users. A Web Publication MAY have more than one address, but all the addresses MUST resolve to the same document.

The referenced document SHOULD be a resource of the Web Publication. It can be any resource, including one that is not listed in the default reading order. This document MUST include a link to the manifest to ensure a bidirectional linking relationship (i.e., that user agents can also locate the manifest from the document at the address).

If the document is not a publication resource, user agents SHOULD load the first document in the default reading order when initiating the publication.

To improve the usability of publications, particularly in user agents that do not support them, authors are encouraged to include navigation aids in the referenced document that facilitate consumption of the content, (e.g., provide a table of contents or a link to one).

The publication's address can also be used as value for an identifier link relation [[link-relation]].
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "url"      : "https://publisher.example.org/mobydick",
    …
}
Canonical Identifier

A Web Publication's canonical identifier is a unique identifier that resolves to the preferred version of the Web Publication. It is expressed using the id property.

Term Description Required Value [[!schema.org]] Mapping
id Preferred version of the publication. A URL [[!url]]. (None)

Ensuring uniqueness of canonical identifiers is outside the scope of this specification. The actual achievable uniqueness depends on such factors as the conventions of the identifier scheme used and the degree of control over assignment of identifiers.

The canonical identifier is intended to provide a measure of permanence above and beyond the Web Publication's address(es). If a Web Publication is permanently relocated to a new URL, for example, the canonical identifier provides a way of discovering the new location (e.g., a DOI registry could be updated with the new URL, or a redirect could be added to the URL of the canonical identifier). It is also intended to provide a means of identifying instances of the same Web Publication hosted at different URLs.

If a URL is not provided in the manifest, or the value is an invalid URL, the Web Publication does not have a canonical identifier. User agents MUST NOT attempt to construct a canonical identifier from any other identifiers provided in the manifest for the canonical manifest.

The specification of the canonical identifier MAY be complemented by the inclusion of additional types of identifiers for the Web Publication using the identifier property [[!schema.org]] and/or its subtypes.

{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "TechArticle",
    …
    "id"       : "http://www.w3.org/TR/tabular-data-model/",
    "url"      : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
    …
}
{
    "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"     : "Book",
    …
    "isbn"     : "9780123456789",
    "url"      : "https://publisher.example.org/mobydick",
    …
}
Default Reading Order

The Web Publication readingOrder property extends the Publication Manifest readingOrder property in the following ways:

  • The default reading order MAY be omitted when it only consists of the primary entry page. When the default reading order is absent, user agents MUST include an entry for the primary entry page when compiling the canonical manifest.
Page List

The Web Publication pagelist property extends the Publication Manifest pagelist property as described in this section.

The pagelist property MUST identify a resource that contains the page list for the Web Publication. It MUST NOT be used to embed a page list in the manifest.

User agents MUST compute the pagelist as follows:

  1. Identify the page list resource:
  2. If the page list resource contains an HTML element with the role [[!html]] value doc-pagelist [[!dpub-aria-1.0]], the user agent MUST use that element as the page list. If there are several such HTML elements the user agent MUST use the first in document tree order [[!dom]].

If this process does not result in a link to the page list, the publication does not have a page list and this property MUST NOT be included in the canonical manifest.

The Working Group will attempt to define the pagelist term by IANA, to avoid using a URL.

{
"@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
"type"       : "Book",
…
"url"        : "https://publisher.example.org/mobydick",
"name"       : "Moby Dick",
"resources"  : [{
	"type"       : "LinkedResource",
	"url"        : "toc_file.html",
	"rel"        : "https://www.w3.org/ns/wp#pagelist"
},{
	…
}],
…
}
Title

The Web Publication title property extends the Publication Manifest title property in the following ways:

Relying on the title element could be semantically problematic if the Web Publication consists of several HTML resources (e.g., one per chapter of a book), because the HTML definition defines this element as "metadata" for the enclosing HTML document, not for a collection of resources. Using this element is, on the other hand, preferred in the case of a Web Publication consisting of a single HTML document (e.g., a scholarly journal article).

Table of Contents

The Web Publication contents property extends the Publication Manifest contents property as described in this section.

The contents property MUST identify a resource that contains the page list for the Web Publication. It MUST NOT be used to embed a page list in the manifest.

User agents MUST compute the toc as follows:

  1. Identify the table of contents resource:
  2. If the table of contents resource contains an HTML element with the role [[!html]] value doc-toc [[!dpub-aria-1.0]], the user agent MUST use that element as the table of contents. If there are several such HTML elements the user agent MUST use the first in document tree order [[!dom]].

If this process does not result in a link to the table of contents, the publication does not have a table of contents and this property MUST NOT be included in the canonical manifest.

See the separate section for the HTML structure that the table of content SHOULD adhere to.

{
    "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
    "type"       : "Book",
    …
    "url"        : "https://publisher.example.org/mobydick",
    "name"       : "Moby Dick",
    "resources"  : [{
        "type"       : "LinkedResource",
        "url"        : "toc_file.html",
        "rel"        : "contents"
    },{
        …
    }],
    …
}
<head>
    …
    <script type="application/ld+json">
    {
        "@context"        : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "type"            : "TechArticle",
        …
        "id"              : "http://www.w3.org/TR/tabular-data-model/",
        "url"             : "http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/",
        …
    }
    </script>
    …
</head>
<body>
    …
    <section role="doc-toc">
        …
    </section>
    …
</body>

Association

Embedding

A manifest MAY be embedded only in the primary entry page. In this case, the manifest MUST be included in a script element [[!html]] whose type attribute is set to application/ld+json.

Additionally, the script element MUST include a unique identifier in an id attribute [[!html]]. This identifier ensures that the manifest can be referenced.

<script id="example_manifest" type="application/ld+json">
   {
      …
   }
</script>

Linking

With the exception of the primary entry page, linking a resource to its manifest is OPTIONAL. Including a link is encouraged whenever possible, however, as it allows user agents to immediately ascertain that a resource belongs to a Web Publication regardless of how the user reaches the resource.

Links to a Web Publication Manifest MUST take one or both of the following forms:

  • An HTTP Link header field [[!rfc5988]] with its rel parameter set to the value "publication".

    Link: <https://example.com/webpub/manifest>; rel=publication
  • A link element [[!html]] with its rel attribute set to the value "publication".

    <link href="https://example.com/webpub/manifest" rel="publication"/>

When a manifest is embedded within an HTML document, the link MUST include a fragment identifier that references the script element that contains the manifest (see ).

	<link href="#example_manifest" rel="publication">
	…
	<script id="example_manifest" type="application/ld+json">
	{
        "@context" : ["https://schema.org", "https://www.w3.org/ns/wp-context"],
        …
	}
	</script>

The exact value of rel is still to be agreed upon and should be registered by IANA.

The following details might be moved to the lifecycle section in a future draft.

When a resource links to multiple manifests, a user agent MAY choose to present one or more alternatives to the end user, or choose a single alternative on its own. The user agent MAY choose to present any manifest based upon information that it possesses, even one that is not explicitly listed as a parent (e.g., based upon information it calculates or acquires out of band). In the absence of a preference by user agent implementers, selection of the first manifest listed is suggested as a default.

Web Publication Lifecycle

See the diagrams in the appendix for a visual representation of the lifecycle algorithm.

Obtaining a manifest

The steps for obtaining a manifest, starting from the primary entry page, are given by the following algorithm. The algorithm, if successful, returns a processed manifest; otherwise, it terminates prematurely and returns nothing. In the case of nothing being returned, the user agent MUST ignore the manifest declaration.

  1. From the Document of the top-level browsing context of the primary entry page, let origin be the Document's origin, and manifest link be the first link element in tree order in Document whose rel attribute contains the publication token.
  2. If origin is an [[!html]] opaque origin, terminate this algorithm.
  3. If manifest link is null, terminate this algorithm.
  4. If manifest link's href attribute's value is the empty string, terminate this algorithm.
  5. If manifest link's href attribute's value is a relative URL, i.e., it points to origin and it has a non-null fragment identifying an identifier id in Document:
    1. Let embedded manifest script be the first script element in tree order, whose id attribute is equal to id and whose type attribute is equal to application/ld+json.
    2. If embedded manifest script is null, terminate this algorithm.
    3. Let text be the child text content of embedded manifest script
    4. Let base be the value of baseURI of the script element.
    Explanation

    This branch is in use when the manifest is embedded in the primary entry page. The algorithm locates the script element and extract the manifest itself. The document's URL or, if set by the author, the value of a possible base element will be used to turn relative URLs into absolute ones.

  6. Otherwise:
    1. Let manifest URL be the result of parsing the value of the href attribute, relative to the element's base URL. If parsing fails, then abort these steps.
    2. Let request be a new [[!fetch]] request, whose URL is manifest URL, and whose context is the same as the browsing context of the Document.
    3. If the manifest link's crossOrigin attribute's value is 'use-credentials', then set request's credentials to 'include'.
    4. Await the result of performing a fetch with request, letting response be the result.
    5. If response is a network error, terminate this algorithm.
    6. Let text be the result of UTF-8 decoding response's body.
    7. Let base be the value of manifest URL.
    Explanation

    This branch is in use when the manifest is in a separate file. It performs the standard operations to retrieve the manifest from the Web; the URL of the manifest file will be used to turn relative URLs into absolute ones.

  7. Let json be the result of parsing text. If parsing throws an error, terminate this algorithm.
  8. If Type(json) is not Object, terminate this algorithm.
  9. Let canonical manifest be the canonical manifest derived from json, using the values of json, base, and Document as input to the algorithm described in .
  10. Check whether the canonical manifest fulfills the minimal requirements for a Web Publication Manifest, namely:
    • The JSON-LD context is set (see )
    • The Publication type is set (see )
    • The Publication address is set (see )
    If any of these requirements is not fulfilled, terminate the algorithm.
  11. Let processed manifest be the result of running processing a manifest given canonical manifest.
  12. Return processed manifest.

The algorithm does not describes how error and warning messages should be reported. This is implementation dependent.

Generating a Canonical Manifest

The steps to convert a Web Publication Manifest into a Canonical Manifest are given by the following algorithm. The algorithm takes the following arguments:

The steps of the algorithm are described below. As an abuse of notation, P["term"] refers to the value in the object P for the label "term", where P is either manifest, or an object appearing within manifest (e.g., a Person). The algorithm replaces or adds some terms to manifest; the replacement terms are expressed in JSON syntax as {"term":"value"}.

  1. let lang string represent the default language, set to:
    Explanation

    This value is used in the step on language below.

  2. let dir string represents the base direction, set to:
    Explanation

    This value is used in the step on base direction below.

  3. () if manifest["name"] is undefined, then locate the title HTML element using document. If that element exists and is non-empty, let t be its text content, and add to manifest:
    • if the language of title is explicitly set to the value of l, then add
      "name": [{"value": t, "language": l}]
    • or
      "name": [t]
      otherwise
    Explanation

    This step ensures that the title element's content in the primary entry page can be used, as a default, as the title of the Web Publication. For example,

    <html>
    <head>
        <title>Moby Dick</title>
        …
        <script type="application/ld+json">
        {
            "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
            …
        }
        </script>
    			                    

    yields (unless the name is set explicitly in the manifest):

    {
        "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"     : ["Moby Dick"],
        …
    }
    			                    
  4. () if manifest["inLanguage"] is undefined and the value of lang is not undefined, add
    "inLanguage": lang
    to manifest
    Explanation

    This step ensures that the language explicitly set in the primary entry page is valid for an embedded manifest content. For example,

    <html>
    <head>
        …
        <script type="application/ld+json" lang=ur>
        {
            "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
            …
        }
        </script>
    			                

    yields (unless the language and the direction are set explicitly in the manifest):

    {
        "@context"    : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "inLanguage"  : "ur",
        …
    }
    			                
  5. () if manifest["inDirection"] is undefined and the value of dir is not undefined, add
    "inDirection": dir
    to manifest
    Explanation

    This step ensures that the base direction explicitly set in the primary entry page is valid for an embedded manifest content. For example,

    <html>
    <head>
        …
        <script type="application/ld+json" dir=rtl lang=ur>
        {
            "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
            "inLanguage"  : "ur",
            …
        }
        </script>
    			                

    yields (unless the language and the direction are set explicitly in the manifest):

    {
        "@context"    : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "inLanguage"  : "ur",
        "inDirection" : "rtl"
        …
    }
    			                
  6. () if manifest["readingOrder"] is undefined, let u be the value of document.URL, and add
    "readingOrder": [{"type": ["LinkedResource"], "url": u}]
    to the manifest
    Explanation

    If the Web Publication consists only of the primary entry page, the default reading order can be omitted; it will consist, automatically, of that single resource.

  7. () consider P["term"], where P is any object in manifest (including itself) and term is If P["term"] is a single string or object v, then change the relevant term/value to
    "term": [v]
    Repeat this step for all possible values of P["term"].
    Explanation

    A number of terms require their values to be arrays but, for the sake of convenience, authors are allowed to use a single value instead of a one element array. For example,

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : "Moby Dick",
        "author"    : "Herman Melville",
        "resources" : [{
            "type"           : "LinkedResource",
            "rel"            : "https://www.w3.org/ns/wp#cover-page",
            "url"            : "images/cover.jpg"
            "encodingFormat" : "image/jpeg"
        },
            …
        }],
        …
    }
    			                

    yields:

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : ["Moby Dick"],
        "author"    : ["Herman Melville"],
        "resources" : [{
            "type"           : ["LinkedResource"],
            "rel"            : ["https://www.w3.org/ns/wp#cover-page"],
            "url"            : "images/cover.jpg"
            "encodingFormat" : "image/jpeg"
        },
            …
        }],
        …
    }
    			                    
  8. () if the value v in a manifest["term"] array, where term is one of the creator terms, is a simple string or localizable string, exchange that element in the array to
    {"type": ["Person"], "name": [v]}
    Repeat this step for all possible values of v.
    Explanation

    An author, editor, etc., should be explicitly designed as an object of type Person but, for the sake of convenience, authors are allowed to just give their name. For example,

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : ["Moby Dick"],
        "author"    : ["Herman Melville"],
        …
    }
    			                

    yields:

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : ["Moby Dick"],
        "author"    : [{
            "type" : ["Person"],
            "name" : "Herman Melville"
        }],
        …
    }
    			                
  9. () if the value v in a manifest["term"] array, where term is one of the resource categorization properties, is a simple string, exchange that element in the array to
    {"type": ["LinkedResource"], "url": v}
    Repeat this step for all possible values of v.
    Explanation

    Resource links should be explicitly designed as an object of type LinkedResource but, for the sake of convenience, authors are allowed to just give their absolute or relative URL. For example,

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        …
        "resources" : [
            "css/mobydick.css",
            …
        ],
        …
    }
    			                

    yields:

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        …
        "resources" : [{
            "type" : ["LinkedResource"],
            "url"  : "css/mobydick.css"
        },
            …
        ],
        …
    }
    			                
  10. () let v be the value, or one of the values in case of an array, of P["term"], where P is any object in manifest (including itself) and term is:
    • accessibilitySummary; or
    • name; or
    • description.
    If v is a single string, then change the relevant term/value to:
    • if manifest[inLanguage] is set to the value of l then
      "term": {"value": v,"language": l}
    • otherwise
      "term": {"value": v}
    Repeat this step for all possible values of v.
    Explanation

    Natural language text values should be explicitly designed as localizable string objects but, for the sake of convenience, authors are allowed to just use a simple string. I.e., if no language information has been provided (via inLanguage) in the manifest then, for example,

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : ["Moby Dick"],
        "author"    : ["Herman Melville"],
        …
    }
    			                

    yields:

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "name"      : [{
            "value" : "Moby Dick"
        }],
        "author"    : [{
            "value" : "Herman Melville"
        }],
        …
    }
    			                

    If an explicit language has also been provided in the manifest, that language is also added to the localizable string object. For example,

    {
        "@context"   : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "inLanguage" : "en",
        "name"       : ["Moby Dick"],
        "author"     : ["Herman Melville"],
        …
    }
    			                

    yields:

    {
        "@context"  : ["https://schema.org","https://www.w3.org/ns/wp-context"],
        "inLanguage": "en",
        "name"      : [{
            "value"    : "Moby Dick",
            "language" : "en"
        }],
        "author"    : [{
            "value"    : "Herman Melville"
            "language" : "en"
        }],
        …
    }
    			                
  11. () if the value of P["term"], where P is any object in manifest (including itself) and term is:
    • url; or
    • id
    is a single string u which is not an absolute URL string, then resolve this value (considered to be a relative URL) using the value of base, yielding the value of au, and replace the term/value pair by
    "term": au
    Explanation

    All relative URLs in the Web Publication manifest must be resolved against the base value to yield absolute URLs.

  12. Return the (transformed) manifest.

See the diagram in the appendix for a visual representation of the algorithm. Also, to help understanding the result of the algorithm, there is a link to the corresponding canonical manifests for all the examples in .

Processing the manifest

The steps for processing a manifest are given by the following algorithm. The algorithm takes a json object representing a canonical manifest. The output from inputting a JSON object into this algorithm is a processed manifest. The goal of the algorithm is to ensure that the data represented in json abides to the minimal requirements on the data, removing, if applicable, non-conformant data.

  1. Let manifest object be the result of converting json to a PublicationManifest dictionary.
  2. Extension point: process any proprietary and/or other supported members at this point in the algorithm.
  3. Perform data cleanup operations on manifest object, possibly removing data, as well as raising warnings.
    1. Check whether the value of manifest object["url"] is a valid URL [[!url]]. If not, issue a warning.
    2. For all the terms defined in , except for accessModeSufficient and accessibilitySummary, check whether all tokens listed in manifest[term] are defined in the preferred vocabulary (see the list of expected values for each). Issue a warning for each unrecognized value.
    3. For all values in manifest object["accessModeSufficient"], check whether each token in each ItemList [[!schema.org]] is defined in the preferred vocabulary (see the list of expected values). Issue a warning for each unrecognized value.
    4. For all the terms defined in , check whether every object Obj in manifest object[term] has Obj["name"] set. If not, remove Obj from manifest object[term] array and issue a warning.
    5. Check whether the value of manifest object["name"] is not empty. If it is, generate a value (see the separate note for details) and issue a warning.
    6. For all the terms defined in , check whether every object Obj in manifest object[term] has Obj["url"] set. If not, remove Obj from manifest object[term] array and issue a warning. If yes, check whether Obj["url"] is a valid URL [[!url]] and, if not, issue a warning.
    7. Check whether manifest object["datePublished"] is a valid date or date-time, per [[iso8601]]. If the check fails, issue a warning.
    8. Check whether manifest object["dateModified"] is a valid date or date-time, per [[iso8601]]. If the check fails, issue a warning.
  4. Return manifest object.

Security

Placeholder for security issues.

Privacy

Placeholder for privacy issues.

PART III: Modular Extensions

Introduction

The first two parts of this specification define the cornerstones for developing additional digital publication formats that can be deployed to the Web.

Compatibility Requirements

In order for a digital publication format to be compatible with this specification, following conditions MUST be met:

Machine-Processable Table of Contents

Introduction

To facilitate navigation within pages and across sites, HTML uses the nav element [[html]] to express lists of links. Although generic in nature by default, the purpose of a nav element can be more specifically identified by use of the role attribute [[html]]. In particular, the doc-toc role from the [[dpub-aria-1.0]] vocabulary identifies the nav element as the Web Publications's table of contents.

Including an identifiable table of contents is an accessible way to produce any digital publication, but due to the flexibility of HTML markup, it also presents challenges for user agents trying to extract a meaningful hierarchy of links (e.g., to provide a custom view available from any page). To avoid duplicating the tables of contents for different uses, this section defines a syntax that is both human friendly and commonly used while still providing enough structure for user agent extraction.

Authors have a choice of lists (ordered or unordered) to construct their table of contents. By tagging each link within these lists in anchor tags (a elements), user agents can easily differentiate the information they need from any peripheral content (asides) or stylistic tagging that has also been added. The table of contents can consist of both active links (with an href attribute) and inactive links (excluding the href attribute), providing additional flexibility in how the table of contents is constructed (e.g., to omit links to certain headings or only link to certain content in a preview).

HTML Structure

The machine-readable table of contents is defined within an [[html]] nav element. As described in , this nav element has to be both the first element in the document and identifiable by a role attribute with the value doc-toc.

Although the content model of the nav element is not restricted, user agents will only be able to extract a usable table of contents when the following markup guidelines are followed:

Table of Contents Title

Although a title for the table of contents is optional, to avoid having a user agent generate a placeholder title when one is needed, it is advised to add one. Titles are specified using any of the [[html]] h1 through h6 elements. Note that only the first such element is recognized as the title. If a heading element is not found before the list of links, user agents will assume that one has not been specified.

The first [[html]] ol or ul list element encountered in the nav element is assumed to contain the list that defines the links into the content. This list will be found even if it is nested inside of div elements, for example, as the algorithm ignores elements that are not relevant to its processing. The list cannot occur inside of any skipped elements, however, since their internal contents are not evaluated.

If the nav element does not contain one of these elements, then user agents will not register the digital publication as containing a usable table of contents (e.g., a machine-rendered option will not be available).

Branches

If the table of contents is considered as a tree of links, then each list item (li element) inside of the list of links represents one branch. Each of these branches has to have a name and optional destination in order to be presented to users, and this information is obtained from the first a element found within the list item, wherever it is nested (again, excluding any a elements inside of skipped elements.)

The link destination for the branch is obtained from the a element's href attribute, when specified. This attribute can be omitted if a link is not available (e.g., in a preview) or not relevant (e.g., a grouping header). When providing a link into the content, it is also possible to specify the relationship of the linked document (in a rel attribute) and the media type of the linked resource (in a type attribute).

After finding the a element that labels the branch, user agents will continue to inspect the markup for another list element (i.e., sub-branches). If a list is found, it is similarly processed to extract its links, and so on, until there are no more nested branches left to process.

Skipped Elements

A small set of elements are ignored when the parsing table of contents to avoid misinterpretation. These are the [[html]] sectioning content elements and sectioning root elements. The reason they are ignored is because they can defined their own outlines (i.e., they can represent embedded content that is self-contained and not necessarily related to the structure of content links).

Any element that has its hidden attribute set is also skipped, since hidden elements are not intended to be directly accessed by users.

Although these elements can be included in the nav element, care has to be taken not to embed important content within them (e.g., do not wrap a section element around the list item that contains all the links into the content).

Ignored Elements

All elements that are not relevant to extracting the table of contents, and are not skipped, are ignored. Unlike skipped elements, ignoring means that user agents will continue to search inside them for relevant content, allowing greater flexibility in terms of the tagging that can be used.

Examples

User Agent Processing

This section defines an algorithm for extracting a table of contents from a nav element. It is defined in terms of a walk over the nodes of a DOM tree, in tree order, with each node being visited when it is entered and when it is exited during the walk. Each time a node is visited, it can be seen as triggering an enter or exit event.

For illustrative purposes, the examples in this section show the structure of the table of contents as JavaScript objects. User agents can process and internalize the resulting structure in whatever language and form is appropriate.

For the purposes of this algorithm, a list element is defined as either an [[!html]] ol or ul element.

The following algorithm MUST be applied to a walk of a DOM subtree rooted at the first nav element in document order with the role attribute value doc-toc. All explanations are informative.

  1. Let toc be a object that represents the table of contents and initialize it as follows:

    1. Create a name property for toc that represents the title of the table of contents and set to an empty string.
    2. Create an entries property for toc that represents all the branches of the table of contents and set to an empty array.
    Explanation

    This step initializes the toc object that will store the title and the branches of the table of contents.

  2. Initialize a stack.

    Explanation

    The stack is used to hold branches that are not yet complete. As a new sub-branch is encountered, the parent gets pushed onto the stack so it can be retrieved later.

  3. Let current toc branch be a variable set to null.

    Explanation

    current toc branch is used to hold the object that represents the branch of the table of contents that is currently being processed.

  4. Walk over the DOM in tree order, starting with the nav element the table of contents is being built from, and trigger the first relevant step below for each element as the walk enters and exits it.

    1. When entering a heading content element:

      Run these steps:

      1. If the stack is empty, and the name property of toc is an empty string, calculate the accessible name [[!accname-1.1]] of the element. If the resulting value is not an empty string after trimming all leading and trailing whitespace, set the name property of toc to the value. Otherwise, set the name property either to a placeholder value or to null.
      2. Exit the element and continue processing with the next element.
      Explanation

      This step identifies the heading for the table of contents. A heading is only processed if the value of the toc name property is an empty string (i.e., no headings have yet been encountered).

      If the name is not an empty string, or is null, then a previous heading has already been encountered or content has been encountered that indicates the nav element does not have a heading (e.g., a list has already been processed, since the heading would not follow the list of links).

    2. When entering a list element:

      Run these steps:

      1. If the name property of toc is an empty string, set name to null.

      2. If current toc branch is not null:

        1. If the entries property of current toc branch is null or a non-empty array, exit the element and continue processing with the next element.
        2. Otherwise, push the object in current toc branch onto the stack and set current toc branch to null.
      3. Otherwise, if the stack is empty:

        1. If the entries property of toc is null or a non-empty array, exit the element and continue processing with the next element.
        2. Otherwise, do nothing.
      Explanation

      This algorithm does not process multiple lists in a single branch or at the root of the nav element, so if a list has already been encountered (the entries property contains one or more branches or is set to null), this list is skipped.

      If a list is encountered and the table of contents (toc) still does not have a name (i.e., no heading element has been encountered), the table of contents is assumed to not have a heading (i.e., the heading for the table of contents cannot appear after the first list of entries). The value of the name property is changed from an empty string to null as no further headings encountered apply, either.

    3. When exiting a list element:

      If the stack is not empty, pop the top object off the stack and set current toc branch to it.

      Explanation

      This resets current toc branch back to the parent object after all of its child branches have been processed.

    4. When entering a list item element:

      Run these steps:

      1. Set current toc branch to a new object.
      2. Create name, url, type, and rel properties for the object and set them to empty strings.
      3. Create an entries property for the object and set it to an empty array.
      Explanation

      Each list item represents a possible new branch in the table of contents, so whenever one is encountered a new blank object is created in current toc branch.

      This object gets populated with information as a descendant a element and list are encountered.

    5. When exiting a list item element:

      Run these steps:

      1. If entries property of current toc branch contains an empty array, set its value to null.

      2. If the stack contains one or more entries:

        1. If the entries property of current toc branch contains a non-empty array, and its name property is an empty string, set its name to a placeholder value or null;
        2. If the entries property of current toc branch contains an empty array, and its name property is an empty string, set current toc branch to null and exit this processing step.

        Add current toc branch to the array in the entries property of the object at the top of the stack.

      3. Otherwise, add the object in current toc branch to the entries array of toc.

      4. Set current toc branch to null.

      Explanation

      Exiting a list item indicates that processing of the current branch is complete. Before adding this branch to its parent's entries array, the branch needs to be tested to see if it has a name and/or any sub-branches. If it does not have a name but has sub-branches, the branch is kept. The user agent can either supply a placeholder value of its own creation or set the value to null. If it does not have a name or any branches, it is invalid and is discarded.

      To determine where to merge the branch, the stack is checked. If there are no objects in the stack, it is added into the entries property of the root toc object (i.e., it is a top-level branch). Otherwise, it gets added into the entries property of the object immediately preceding it in the stack.

      As a final step, current toc branch is reset back to null.

    6. When entering an anchor element and current toc branch is not null:

      Run these steps:

      1. If the name property of current toc branch is not an empty string, do nothing.

      2. Otherwise:

        1. Calculate the accessible name [[!accname-1.1]] for the element. If the resulting value is a non-empty string after trimming leading and trailing white space, set the name property of current toc branch to the resulting value. Otherwise, set the property to null.
        2. If the element has an href attribute and the IRI in the attribute resolves to a resource in the default reading order or resource list, set the url property of current toc branch to the value. Otherwise, set the property to null.
        3. If the element has a type attribute, and the value of the attribute is not an empty string after trimming leading and trailing white space, set the type property of current toc branch to its value. Otherwise, set the property to null.
        4. If the element has a rel attribute, and the value of the attribute is not an empty string after trimming leading and trailing white space, set the rel property of current toc branch to its value. Otherwise, set the property to null.

        Exit the element and continue processing with the next element.

      Explanation

      This step processes anchor tags to obtain values for the name and url properties of a branch.

      If the name of the current branch is already defined, then processing of this element is terminated (i.e., to avoid processing multiple links for a single branch).

      In addition to having an href attribute specified, it is necessary that it resolve to a resource that belongs to the digital publication to meet the requirements of this specification. If not, the branch is retained but the entry will not be linkable.

      Additional information about the target of the link — the type of resource and its relationship — is also retained.

    7. When entering a sectioning content element, a sectioning root element, or an element with a hidden attribute:

      Exit the element and continue processing with the next element.

      Explanation

      As sectioning and sectioning root elements can define their own outlines, descending into them poses problems for generating the table of contents (i.e., they may contain content that is not directly related). As a result, they are skipped over when encountered to prevent their child content from being processed.

    8. Otherwise: do nothing.

      Explanation

      For all other elements, this steps allows their descendant elements to continue to be processed.

  5. After completing the DOM walk, if the entries property of toc contains a non-empty array, toc represents the machine-processed table of contents.

    Otherwise, the digital publication does not have a table of contents that can be used for machine rendering purposes.

    Explanation

    If the entries array in the root toc object does not contain any branches (either because no list was found in the nav element or the list did not contain any conforming list items), then the algorithm did not produce a usable table of contents.

Manifest Examples

Simple Book

A manifest for a simple book. The canonical version of this manifest is also available.


			

Single-Document Publication

Example for an embedded manifest example. The canonical version of the manifest is, as well as a more elaborate version for the same document are also available.


			

Audiobook

A manifest for an audiobook. The canonical version of this manifest is also available.


			

Examples for bidirectional texts

(These examples were originally published in the Activity Streams Recommendation [[activitystreams-core]].)

Character order in memory Direction Method Expected display
פעילות הבינאום, W3C rtl First strong directional character פעילות הבינאום, W3C
The document is titled, "&#x2067;פעילות הבינאום, W3C&#x2069;" ltr First strong directional character The document is titled, "פעילות הבינאום, W3C"
&#x200F;HTML היא שפת סימון rtl Bidi Control Character HTML היא שפת סימון
&#x200E;'سلام' is hello in Persian ltr Bidi Control Character 'سلام' is hello in Persian

Lifecycle diagrams

These diagrams provide a visual view of the lifecycle steps, as specified in .

Overview of the lifecyle algorithm

Overview of the lifecyle algorithm, depicting the main building blocks

Overview of the lifecyle algorithm, depicting the main building blocks.
See the normative description of the algorithm in . Image available in SVG and PNG formats.

Finding the manifest

First major block in the lifecyle algorithm: find the manifest, either through an HTTP request or as part of a script elements

First major block in the lifecyle algorithm: find the manifest, either through an HTTP request or as part of a script elements.
See the normative description of the algorithm in . Image available in SVG and PNG formats.

Manifest canonicalization

Second major block in the lifecyle algorithm: create a canonical manifest

Second major block in the lifecyle algorithm: create a canonical manifest.
See the normative description of the algorithm in . Image available in SVG and PNG formats.

Converting the manifest into a data structure

Third major block in the lifecyle algorithm: convert the manifest into a programming language dependent data structure that implements the WebIDL specification of the manifest.

Third major block in the lifecyle algorithm: convert the manifest into a programming language dependent data structure that implements the WebIDL specification of the manifest.
See the normative description of the algorithm in . Image available in SVG and PNG formats.

Cleaning up the data

Fourth major block in the lifecyle algorithm: check and clean up data by possibly removing data that cannot be interpreted.

Fourth major block in the lifecyle algorithm: check and clean up data by possibly removing data that cannot be interpreted.
See the normative description of the algorithm in . Image available in SVG and PNG formats.

Image Descriptions

Description for the "Structure of Web Publications" diagram:
A simplified diagram of the structure of a Web Publication. The Web Publication is broken down into two elements. The first element is the actual contents (all the real things listed in the manifest). This element is broken down into the CSS, the actual "things" such as the HTML documents, audio, etc, and the images, fonts etc. The actual "things" have an additional subset of items that includes the entry page to the publication and all of the other documents. The second element is the Manifest (JSON). The manifest is used to generate the canonical manifest, which consists of a list of all the "things" in the publication, the publication metadata, and the default reading order of content. It is noted in the diagram that the entry page has to link to the manifest. (Return to the diagram of Web Publication.)