Skip to content

Commit af6c954

Browse files
Merge branch 'main' into mdavies888-patch-1
2 parents 57e06e3 + d823df6 commit af6c954

File tree

127 files changed

+490
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+490
-255
lines changed

components/context/ArticleContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type LearningTrack = {
88
}
99

1010
export type MiniTocItem = {
11-
platform: string
11+
platform?: string
1212
contents: {
1313
href: string
1414
title: string

lib/get-mini-toc-items.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import cheerio from 'cheerio'
22
import { range } from 'lodash-es'
33

4-
export default function getMiniTocItems(
5-
html,
6-
maxHeadingLevel = 2,
7-
headingScope = '',
8-
isRestPage = false
9-
) {
4+
export default function getMiniTocItems(html, maxHeadingLevel = 2, headingScope = '') {
105
const $ = cheerio.load(html, { xmlMode: true })
116

127
// eg `h2, h3` or `h2, h3, h4` depending on maxHeadingLevel
@@ -67,7 +62,7 @@ export default function getMiniTocItems(
6762
// convert the flatToc to a nested structure to simplify semantic rendering on the client
6863
const nestedToc = buildNestedToc(flatToc)
6964

70-
return nestedToc
65+
return minimalMiniToc(nestedToc)
7166
}
7267

7368
// Recursively build a tree from the list of allItems
@@ -116,3 +111,15 @@ function buildNestedToc(allItems, startIndex = 0) {
116111

117112
return currentLevel
118113
}
114+
115+
// Strip the bits and pieces from each object in the array that are
116+
// not needed in the React component rendering.
117+
function minimalMiniToc(toc) {
118+
return toc.map(({ platform, contents, items }) => {
119+
const minimal = { contents }
120+
const subItems = minimalMiniToc(items)
121+
if (subItems.length) minimal.items = subItems
122+
if (platform) minimal.platform = platform
123+
return minimal
124+
})
125+
}

lib/rest/static/decorated/api.github.com.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482706,7 +482706,7 @@
482706482706
}
482707482707
],
482708482708
"previews": [],
482709-
"descriptionHTML": "<p>Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see \"<a href=\"https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies\">About security alerts for vulnerable dependencies</a>\".</p>",
482709+
"descriptionHTML": "<p>Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see \"<a href=\"https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies\">About security alerts for vulnerable dependencies</a>\".</p>",
482710482710
"statusCodes": [
482711482711
{
482712482712
"httpStatusCode": "204",

lib/rest/static/dereferenced/api.github.com.deref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454419,7 +454419,7 @@
454419454419
"/repos/{owner}/{repo}/vulnerability-alerts": {
454420454420
"get": {
454421454421
"summary": "Check if vulnerability alerts are enabled for a repository",
454422-
"description": "Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see \"[About security alerts for vulnerable dependencies](https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)\".",
454422+
"description": "Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see \"[About security alerts for vulnerable dependencies](https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)\".",
454423454423
"tags": [
454424454424
"repos"
454425454425
],
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:3bc57d42d97c8e6ab4050ef860e62db918a91140ed4ade9a2c5428243f52a261
3-
size 741056
2+
oid sha256:0ff91e9452ead332260706bad6c6ece601c5cd73a04588ecb60bd7e2f8be818f
3+
size 740986
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:0bb7ffa22392d3b59d9f67a9819d0b96381d8b55aa59d47350db58ce8d0b1b11
3-
size 1564155
2+
oid sha256:bc6ebcdee0f6514e6081bdba170fb579b914eebb9545362e6776ebcb7b190ea6
3+
size 1564538
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:a3a2fdb0249b314f7266b3efba48687be0bc248033435b13290a110998552166
3-
size 998340
2+
oid sha256:2460adf9a6b5114a353cd1d5e6b2033ff5e90ed03c63201688361a88a940ea1b
3+
size 998199
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:e7532e2a4ac438636410f83b86acbc011e879a78d8e54f09666d334d48c0c846
3-
size 4001080
2+
oid sha256:976ae8ad67ffca1cd859edd91b1db89c2882d93158d9b3ae3d9a9d800ded472c
3+
size 4001148
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:8206756b6cc27e37e2388c27f077c4a4b23eac7d7a09e45ba562bc8b27372672
3-
size 684017
2+
oid sha256:e32c9339ccd8dd27b7d3f30668514fdb39195521b849c920c687aeb1f3bab33c
3+
size 684045
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:c5df1bbe2fe6ceb39763e30244a594a6524344e3135af9e896e03acd9f5d16a1
3-
size 2973063
2+
oid sha256:4fd822b12403c4c4f24d53822296b0d9662a0c01bc05095c70b2fe93173755fd
3+
size 2973767

0 commit comments

Comments
 (0)