From f6a9279f4eba386944a2aa1a410a9aea3d02df61 Mon Sep 17 00:00:00 2001 From: Bao Zhiyuan Date: Sat, 11 Jan 2025 16:24:17 +0800 Subject: [PATCH] add toc --- moonbit-tour/build/scan-tour.ts | 16 ++++++++++------ moonbit-tour/index.html | 6 +++--- moonbit-tour/src/main.ts | 7 +------ moonbit-tour/src/toc.ts | 17 +++++++++++++++++ moonbit-tour/tailwind.config.js | 22 +++++++++++----------- 5 files changed, 42 insertions(+), 26 deletions(-) create mode 100644 moonbit-tour/src/toc.ts diff --git a/moonbit-tour/build/scan-tour.ts b/moonbit-tour/build/scan-tour.ts index 2f4fcca9..506b349f 100644 --- a/moonbit-tour/build/scan-tour.ts +++ b/moonbit-tour/build/scan-tour.ts @@ -76,16 +76,20 @@ function generateTOC(chapters: Chapter[]): { markdown: string; code: string } { function renderTOC(chapters: Chapter[]): string { const lines: string[] = []; - lines.push(`