diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e6247b40..83206f526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Features - Added `headings` option to control optional headings, #2729. +- Added a folder icon to page navigation elements which are not links, #2741. ### Bug Fixes diff --git a/scripts/build_themes.js b/scripts/build_themes.js index d1b255b72..ca847f1d3 100644 --- a/scripts/build_themes.js +++ b/scripts/build_themes.js @@ -2,7 +2,7 @@ const esbuild = require("esbuild"); const fs = require("fs"); -const watch = process.argv.slice(2).includes("--watch"); +const watch = process.argv.slice(2).some((t) => t == "--watch" || t == "-w"); // It's convenient to be able to build the themes in watch mode without rebuilding the whole docs // to test some change to the frontend JS. diff --git a/src/lib/output/themes/default/assets/typedoc/Navigation.ts b/src/lib/output/themes/default/assets/typedoc/Navigation.ts index 5c6a4f682..a5e15435b 100644 --- a/src/lib/output/themes/default/assets/typedoc/Navigation.ts +++ b/src/lib/output/themes/default/assets/typedoc/Navigation.ts @@ -103,7 +103,8 @@ function addNavText( } a.appendChild(document.createElement("span")).textContent = el.text; } else { - parent.appendChild(document.createElement("span")).textContent = - el.text; + const span = parent.appendChild(document.createElement("span")); + span.innerHTML = ``; + span.appendChild(document.createElement("span")).textContent = el.text; } } diff --git a/src/lib/output/themes/default/partials/icon.tsx b/src/lib/output/themes/default/partials/icon.tsx index b50eddeeb..8c242de37 100644 --- a/src/lib/output/themes/default/partials/icon.tsx +++ b/src/lib/output/themes/default/partials/icon.tsx @@ -47,7 +47,7 @@ export function buildRefIcons JSX.Element>>( } export const icons: Record< - ReflectionKind | "chevronDown" | "checkbox" | "menu" | "search" | "chevronSmall" | "anchor", + ReflectionKind | "chevronDown" | "checkbox" | "menu" | "search" | "chevronSmall" | "anchor" | "folder", () => JSX.Element > = { [ReflectionKind.Accessor]: () => @@ -186,14 +186,21 @@ export const icons: Record< ), [ReflectionKind.Document]: () => kindIcon( - - - + + + , "var(--color-document)", ), + folder: () => + kindIcon( + + + , + "var(--color-document)", + ), chevronDown: () => (