addSection

fun addSection(resource: Resource, path: String, pathSeparator: String = DEFAULT_PATH_SEPARATOR): TOCReference?(source)

Calls addTOCReferenceAtLocation after splitting the path using the DEFAULT_PATH_SEPARATOR.

Return

the new TOCReference


fun addSection(resource: Resource, pathElements: List<String>): TOCReference?(source)

Adds the given Resources to the TableOfContents at the location specified by the pathElements.

Example: Calling this method with a Resource and new String[] {"chapter1", "paragraph1"} will result in the following:

  • a TOCReference with the title "chapter1" at the root level.

    If this TOCReference did not yet exist it will have been created and does not point to any resource

  • A TOCReference that has the title "paragraph1". This TOCReference will be the child of TOCReference "chapter1" and will point to the given Resource

Return

the new TOCReference

Parameters

resource
pathElements

fun addSection(resource: Resource, pathElements: IntArray, sectionTitlePrefix: String, sectionNumberSeparator: String): TOCReference?(source)

Adds the given Resources to the TableOfContents at the location specified by the pathElements.

Example: Calling this method with a Resource and new int[] {0, 0} will result in the following:

  • a TOCReference at the root level.

    If this TOCReference did not yet exist it will have been created with a title of "" and does not point to any resource

  • A TOCReference that points to the given resource and is a child of the previously created TOCReference.

    If this TOCReference didn't exist yet it will be created and have a title of ""

Return

the new TOCReference

Parameters

resource
pathElements