( items, context, depth = 2, markdownHeading = '' )
| 136 | } |
| 137 | |
| 138 | export async function getAutomatedPageMiniTocItems( |
| 139 | items, |
| 140 | context, |
| 141 | depth = 2, |
| 142 | markdownHeading = '' |
| 143 | ) { |
| 144 | const titles = |
| 145 | markdownHeading + |
| 146 | items |
| 147 | .map((item) => { |
| 148 | let title = '' |
| 149 | for (let i = 0; i < depth; i++) { |
| 150 | title += '#' |
| 151 | } |
| 152 | return title + ` ${item}\n` |
| 153 | }) |
| 154 | .join('') |
| 155 | |
| 156 | const toc = await renderContent(titles, context) |
| 157 | return getMiniTocItems(toc, depth, '') |
| 158 | } |
no test coverage detected