Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: README - Formatting fixes, minor text changes (fixes #12) #13

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 71 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,119 @@
# TOC
# adapt-toc

This extension provides a drawer-based table of contents for Adapt as an alternative to (or complement) a traditional menu (for example `adapt-contrib-boxMenu`).
This extension provides a drawer-based table of contents for Adapt as an alternative to (or to complement) a traditional menu (e.g. `adapt-contrib-boxMenu`).

There are two modes of operation. In the simple case all content objects are listed as links in the drawer. Any content objects that should not appear in the list can be excluded.
There are two modes of operation: simple and custom.

For custom usage, groupings can be defined to create a hierarchy of content objects; for example to reflect a menu/submenu structure. Each group can have a title and there is no limit to the level of group nesting.
- In the *simple* case, all content objects are listed as links in the drawer. Any content objects that should not appear in the list can be excluded.

See example.json for configuration guidance.
- For *custom* usage, groupings can be defined to create a hierarchy of content objects; for example to reflect a menu/submenu structure. Each group can have a title and there is no limit to the level of group nesting.

If `adapt-contrib-pageLevelProgress` is enabled at course level (`course.json`) this extension calculates progress by the same method as `adapt-contrib-pageLevelProgress`. This is to ensure consistency of the progress indicators.
See [*example.json*](https://github.com/cgkineo/adapt-toc/blob/master/example.json) for configuration guidance.

If `adapt-contrib-pageLevelProgress` is enabled at course level (*course.json*), this extension calculates progress by the same method as `adapt-contrib-pageLevelProgress`. This is to ensure consistency of the progress indicators.

## Settings Overview

**ToC** is configured with the attributes that follow.

## Attributes

Add to _course.json_ under _\_globals.\_extensions_.
### *course.json - \_globals.\_extensions*

Add to *course.json* under *\_globals.\_extensions*.

### **\_toc** (object)

The `_toc` object contains the following settings:

#### \_toc_ (object):
The Table of Contents object
#### **navigationToc** (string)

##### \navigationToc (string):
Aria label for the navigation button

##### \toc (string):
#### **toc** (string)

Aria label to indicate the beginning of the table of contents

##### \tocEnd (string):
#### **tocEnd** (string)

Aria label to indicate the end of the table of contents

##### \tocContentObject (string):
#### **tocContentObject** (string)

Aria label to indicate completion

##### \optionalContent (string):
#### **optionalContent** (string)

Label to indicate optional content

##### \_navTooltip (object):
#### **\_navTooltip** (object)

The tooltip object. Used when tooltips are enabled globally

###### \_isEnabled (boolean):
##### **\_isEnabled** (boolean)

Enables tooltips on the button

###### \text (string):
The text of the tooltip
##### **text** (string)

Add the following directly to _course.json_.
The text of the tooltip

### *course.json*
The following attributes, set within *course.json*, configure the defaults for **ToC**.

#### \_toc (object):
The toc object contains the following settings:
The following attributes, set within *course.json*, configure the defaults for **ToC**. Add directly to *course.json*.

### **\_toc** (object)

The `_toc` object contains the following settings:

##### \_drawerPosition (string);
The position that the button appears in the drawer. Position options include 'auto', 'left', and 'right'. Defaults to 'auto'
#### **\_drawerPosition** (string)

##### \_excludeContentObjects (array);
Optional list of content object ids to be excluded from the toc list e.g. ["co-100"] or ["co-100", "co-200"]
The position that the button appears in the drawer. Position options include `auto`, `left`, and `right`. Defaults to `auto`

#### **\_excludeContentObjects** (array)

Optional list of content object `_id` values to be *excluded* from the ToC list. For example, `["co-100"]` or `["co-100", "co-200"]`. To exclude the menu link, use `course`.

#### **\_grouping** (object)

##### \_grouping (object):
The grouping object contains the following settings:

####### title (string):
The title text for the group list.
##### **title** (string)

The title text for the group list

####### \_ariaLevel (number):
Define the group list title aria level. Usually this will be set to `1` but if
##### **\_ariaLevel** (number)

Define the group list title aria level. Usually this will be set to `1` but can be overridden.

##### **\_classes** (string)

###### \_classes (string):
CSS class name(s) to be applied to this groups containing `div`. The class(es) must be predefined in one of the Less files. Separate multiple classes with a space.

###### \_items (array):
##### **\_items** (array)

The items array contains the list of content objects to be included. Can also include the `_grouping` object for nested items.

####### \_classes (string):
###### **\_classes** (string)

CSS class name(s) to be applied to this items containing `div`. The class(es) must be predefined in one of the Less files. Separate multiple classes with a space.

####### \_contentObjects (array):
List of content object ids to be included in the groups item list e.g. ["co-100"] or ["co-100", "co-200"]
###### **\_contentObjects** (array)

List of content object ids to be *included* in the groups item list. For example, `["co-100"]` or `["co-100", "co-200"]`

### Notes

- In most scenarios it is necessary to specify a start page (see `example.json`).
- It may be necessary to remove (or hide) the back button (`.navigation-back-button`) to prevent Adapt attempting to navigate to `course` level.
- In most scenarios it is necessary to specify a start page (see [*example.json*](https://github.com/cgkineo/adapt-toc/blob/master/example.json)).
- It may be necessary to remove (or hide) the back button (`.navigation-back-button`) to prevent Adapt attempting to navigate to `course` level.

## Limitations

No known limitations.

----------------------------

**Author / maintainer:** CGKineo<br>
**Accessibility support:** WAI AA<br>
**RTL support:** Yes<br>
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, Safari for macOS/iOS/iPadOS, Opera<br>