From 1d4a2ebdf7f5f539a634ce0868a8ac636a4ba5b0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 10 May 2023 23:06:34 +0200 Subject: [PATCH] reduce header levels in README to allow for TOC navigation on the docs site --- Docs/overrides/conceptual.extension.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Docs/overrides/conceptual.extension.js b/Docs/overrides/conceptual.extension.js index 7b45100..62e881d 100644 --- a/Docs/overrides/conceptual.extension.js +++ b/Docs/overrides/conceptual.extension.js @@ -1,6 +1,11 @@ exports.preTransform = function (model) { - // point to the release branch in the readme when on the website - if (model._path.includes("index")) + if (model._path.includes("index")) { + // point to the release branch in the readme model.conceptual = model.conceptual.replaceAll(/\/MLEM(\/[^/]+)?\/main\//g, "/MLEM$1/release/"); + + // reduce header levels by 1 to allow for TOC navigation + for (let i = 5; i >= 1; i--) + model.conceptual = model.conceptual.replaceAll(`