MCPcopy
hub / github.com/github/docs / getMiniToc

Function getMiniToc

src/graphql/lib/index.js:60–76  ·  view source on GitHub ↗
(context, type, items, depth = 2, markdownHeading = '')

Source from the content-addressed store, hash-verified

58}
59
60export async function getMiniToc(context, type, items, depth = 2, markdownHeading = '') {
61 const { currentLanguage, currentVersion } = context
62 const graphqlVersion = getGraphqlVersion(currentVersion)
63 if (!miniTocs.get(currentLanguage).has(graphqlVersion)) {
64 miniTocs.get(currentLanguage).set(graphqlVersion, new Map())
65 }
66 if (!miniTocs.get(currentLanguage).get(graphqlVersion).has(type)) {
67 const graphqlMiniTocItems = await getAutomatedPageMiniTocItems(
68 items,
69 context,
70 depth,
71 markdownHeading
72 )
73 miniTocs.get(currentLanguage).get(graphqlVersion).set(type, graphqlMiniTocItems)
74 }
75 return miniTocs.get(currentLanguage).get(graphqlVersion).get(type)
76}
77
78export async function getChangelogMiniTocs(items, context, depth = 2, markdownHeading = '') {
79 if (!changelog.has('toc')) {

Callers 1

getServerSidePropsFunction · 0.90

Calls 2

getGraphqlVersionFunction · 0.85

Tested by

no test coverage detected