diff --git a/scripts/src/sidebar.ts b/scripts/src/sidebar.ts index 836822b..cb60b10 100644 --- a/scripts/src/sidebar.ts +++ b/scripts/src/sidebar.ts @@ -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}`), } ] } @@ -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); } @@ -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; }