Skip to content

Commit

Permalink
sidebar fix (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
rambleraptor authored Dec 17, 2024
1 parent e80d8a4 commit 7663059
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions scripts/src/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ import type { Sidebar, AEP, ConsolidatedLinterRule } from './types';
function buildLinterSidebar(rules: ConsolidatedLinterRule[], sidebar: Sidebar): Sidebar {
let contents = [
{
label: 'Tooling',
items: [
{
'label': 'Protobuf Linter',
'items': [
'tooling/linter',
{
'label': 'Rules',
'collapsed': true,
'items': rules.map((x) => `tooling/linter/rules/${x.aep}`),
}
]
'label': 'Protobuf Linter',
'items': [
'tooling/linter',
{
'label': 'Rules',
'collapsed': true,
'items': rules.map((x) => `tooling/linter/rules/${x.aep}`),
}
]
}
Expand All @@ -27,10 +22,10 @@ function buildSidebar(aeps: AEP[], groups: any, sidebar: Sidebar): Sidebar {
for (var group of groups.categories) {
response.push({
'label': group.title,
'items': aeps.filter((aep) => aep.category == group.code).sort((a1, a2) => a1.id > a2.id ? 1 : -1).map((aep) => ({label: `${aep.id}. ${aep.title}`, link: aep.id.toString()}))
'items': aeps.filter((aep) => aep.category == group.code).sort((a1, a2) => a1.id > a2.id ? 1 : -1).map((aep) => ({ label: `${aep.id}. ${aep.title}`, link: aep.id.toString() }))
})
}

return addToSidebar(sidebar, "AEPs", response);
}

Expand All @@ -43,7 +38,7 @@ function addToSidebar(sidebar: Sidebar, label: string, items): Sidebar {
sidebar[targetGroupIndex].items = items;
}
} else {
sidebar.push({'label': label, items: items})
sidebar.push({ 'label': label, items: items })
}
return sidebar;
}
Expand Down

0 comments on commit 7663059

Please sign in to comment.