-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/@atjson/offset-annotations/src/annotations/table-of-content.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { BlockAnnotation } from "@atjson/document"; | ||
|
||
/** | ||
* A table of content is designed to enhance the usability and navigation of | ||
* our content. This feature provides users with a structured and accessible | ||
* way to navigate through various sections of a story, especially long-form | ||
* articles, improving the overall user experience and engagement. It will | ||
* make it easier for users to find specific sections or information quickly. | ||
* It also encourages readers to explore more content by providing them easy | ||
* access to different parts of our content. | ||
* | ||
* It is a way of displaying tabular or database-like data. | ||
* Table of Content displays data as a list of links that tag to headers that | ||
* exist in the body of a story. | ||
* | ||
*/ | ||
|
||
export class TableOfContent extends BlockAnnotation<{ | ||
/** | ||
* a header slice to hold header text | ||
*/ | ||
header: string; | ||
/** | ||
* content slice to hold list of links | ||
*/ | ||
content: string; | ||
/** | ||
* A named identifier used to describe toc's initial state | ||
*/ | ||
isCollapsible?: boolean; | ||
/** | ||
* A named identifier used to quickly jump to this item | ||
*/ | ||
anchorName?: string; | ||
/** | ||
* Layout information, used to indicate mutually | ||
* exclusive layouts, for example sizes, floats, etc. | ||
*/ | ||
layout?: string; | ||
}> { | ||
static type = "table-of-content"; | ||
static vendorPrefix = "offset"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters