mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 22:18:34 +01:00
reduce header levels in README to allow for TOC navigation on the docs site
This commit is contained in:
parent
e09484cbe7
commit
1d4a2ebdf7
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,11 @@
|
||||||
exports.preTransform = function (model) {
|
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/");
|
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(`<h${i}`, `<h${i + 1}`).replaceAll(`</h${i}`, `</h${i + 1}`);
|
||||||
|
}
|
||||||
return model;
|
return model;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue