X Tutup
Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 20 additions & 1 deletion docs/plugins/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,26 @@ Hooks is a method of augmenting or altering the behavior of the process, with cu
// Content of the page
// Markdown/Asciidoc in "page:before"
// HTML in "page"
"content": "# Hello"
"content": "<h1>Hello</h1>"

// Level of the page
"level": "1.5.3.1"

// Depth of the page
"depth": "3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that the depth is number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's the distance from the root in the page tree


// Other attributes appear in the .md between two '---' at the beginning of the content
// For example in the front of the markdown:
// ---
// description: This is a description
// ---
"description": "This is a description"

// Previous article
"previous": Article Object

// Next article
"next": Article Object
}
```

Expand Down
8 changes: 8 additions & 0 deletions packages/honkit/src/json/encodePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ function encodePage(page: Page, summary: Summary): EncodedPage {
if (prevArticle) {
result.previous = encodeSummaryArticle(prevArticle);
}

const articles = article
.getArticles()
.map((article) => encodeSummaryArticle(article))
.toJS();
if (articles.length > 0) {
result.articles = articles;
}
}

result.content = page.getContent();
Expand Down
X Tutup