Contents

Chapter

Organizes related tutorial pages into a chapter on a table of contents page.

Declaration

@Chapter(name: String) {
    ...

    @Image(source: ResourceReference, alt: String?) { ... }
    @TutorialReference(tutorial: TopicReference)
}

Parameters

  • name:

    The name of the chapter. (required)

Mentioned in

Overview

Chapters appear on a table of contents page and help provide a sense of context and accomplishment as readers move through your tutorial content.

[Image]

Use Chapter directives to organize related tutorial pages into groupings. For each chapter, use the name parameter to specify a chapter name, and provide some descriptive text. Then, insert TutorialReference directives for the tutorial pages each chapter contains. Optionally, use Image directives to show images that illustrate the chapters’ content.

@Tutorials(name: "SlothCreator") {
    
    ...
    
    @Chapter(name: "SlothCreator Essentials") {
        @Image(source: chapter1-slothcreatorEssentials, alt: "A wireframe of an app interface that has an outline of a sloth and four buttons below the sloth. The buttons display the following symbols, from left to right: snowflake, fire, wind, and lightning.")
        
        Create custom sloths and edit their attributes and powers using SlothCreator.
        
        @TutorialReference(tutorial: "doc:Creating-Custom-Sloths")
    }

    ...
    
}

If you need a second level of organization on a table of contents page, use Volume directives to organize related chapters into volume groupings.

@Tutorials(name: "SlothCreator") {
    @Intro(title: "Meet SlothCreator") {
        
        ...
    }
    
    @Volume(name: "Getting Started") {
        Building sloths, caring for them, and interacting with them.
        
        @Chapter(name: "SlothCreator Essentials") {
            ...
        }
        
        @Chapter(name: "Basic Sloth Care") {
            ...
        }
        
        @Chapter(name: "Basic Sloth Interaction") {
            ...
        }
    }
    
    @Volume(name: "Climbing Higher") {
        Taking your sloths to the next level.
        
        @Chapter(name: "Powering Up") {
            ...
        }
    
        ...
    }
    
   ...
}

Contained Elements

A chapter can contain the following items:

Image

An image that represents the chapter’s content. (optional)

TutorialReference

A reference to a tutorial page. A chapter must contain at least one tutorial page reference. (optional)

Containing Elements

The following items can contain chapters:

Topics

Referencing Tutorials

Displaying an Image

See Also

Organizing Content