MCPcopy
hub / github.com/github/docs / getAutomatedPageMiniTocItems

Function getAutomatedPageMiniTocItems

lib/get-mini-toc-items.js:138–158  ·  view source on GitHub ↗
(
  items,
  context,
  depth = 2,
  markdownHeading = ''
)

Source from the content-addressed store, hash-verified

136}
137
138export 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}

Callers 7

getServerSidePropsFunction · 0.90
getServerSidePropsFunction · 0.90
getServerSidePropsFunction · 0.90
getServerSidePropsFunction · 0.90
getRestMiniTocItemsFunction · 0.90
getMiniTocFunction · 0.90
getChangelogMiniTocsFunction · 0.90

Calls 2

renderContentFunction · 0.85
getMiniTocItemsFunction · 0.85

Tested by

no test coverage detected