Skip to content

Commit

Permalink
Support for readme TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
gsvarovsky committed Aug 1, 2020
1 parent dd9bd2f commit 90b4d34
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"keywords": [
"typescript",
"documentation",
"generator"
"generator",
"typedocplugin"
]
}
6 changes: 6 additions & 0 deletions src/minimal/layouts/default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

<nav class="tsd-navigation secondary">
<ul>
{{#if settings.readmeToc}}
{{#each settings.readmeToc}}
{{> toc}}
{{/each}}
<hr>
{{/if}}
{{#each toc.children}}
{{> toc}}
{{/each}}
Expand Down
7 changes: 7 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = host => {
host.owner.options.addDeclaration({
help: 'Readme TOC',
name: 'readmeToc',
type: 4 // Mixed (no conversion)
});
};

0 comments on commit 90b4d34

Please sign in to comment.