Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(markdown): add HTML-based table of contents
Elian Dorand4fa608dfeef
diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.tsxindex b758cea301..7f83f22005 100644--- a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx@@ -75,7 +75,7 @@ function useItems(rightPaneVisible: boolean, widgetsByParent: WidgetsByParent) {const definitions: RightPanelWidgetDefinition[] = [{el: <TableOfContents />,- enabled: (noteType === "text" || noteType === "doc" || isPdf),+ enabled: (noteType === "text" || noteType === "doc" || isPdf || !!note?.isMarkdown()),},{el: <PdfPages />,diff --git a/apps/client/src/widgets/sidebar/TableOfContents.tsx b/apps/client/src/widgets/sidebar/TableOfContents.tsxindex d84670128d..10fd150689 100644--- a/apps/client/src/widgets/sidebar/TableOfContents.tsx+++ b/apps/client/src/widgets/sidebar/TableOfContents.tsx@@ -39,6 +39,7 @@ export default function TableOfContents() {{((noteType === "text" && isReadOnly) || (noteType === "doc")) && <ReadOnlyTextTableOfContents />}{noteType === "text" && !isReadOnly && <EditableTextTableOfContents />}{noteType === "file" && noteMime === "application/pdf" && <PdfTableOfContents />}+ {note?.isMarkdown() && <ReadOnlyTextTableOfContents />}</RightPanelWidget>);}