2021-06-20 00:51:55 +00:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
const parse_sections = require("./lib/parse_sections.js");
|
|
|
|
|
2021-10-05 01:02:53 +00:00
|
|
|
let { sections, categories } = parse_sections(fs.readFileSync(
|
|
|
|
path.resolve(
|
|
|
|
__dirname,
|
|
|
|
`../Chat-Command-Reference.md`
|
|
|
|
),
|
|
|
|
"utf-8"
|
|
|
|
))
|
2021-06-20 00:51:55 +00:00
|
|
|
|
2021-10-05 01:02:53 +00:00
|
|
|
sections = sections.slice(1).sort((a, b) => a.title.replace(/^\/+/g, "").localeCompare(
|
|
|
|
b.title.replace(/^\/+/g, "")));
|
2021-06-20 00:51:55 +00:00
|
|
|
|
2021-10-05 01:02:53 +00:00
|
|
|
|
|
|
|
console.log(`REFERENCE SECTION TITLES`)
|
|
|
|
console.log(sections
|
|
|
|
.map(s => [s.category, s.title].join(`\t`)).join(`\n`));
|
|
|
|
console.log(`************************`);
|
|
|
|
|
|
|
|
console.log(`REFERENCE SECTION COLOURS`, categories);
|
2021-06-20 00:51:55 +00:00
|
|
|
module.exports = {
|
|
|
|
layout: "theme.njk",
|
|
|
|
title: "Reference",
|
|
|
|
tags: "navigable",
|
|
|
|
date: "2001-01-01",
|
|
|
|
section_intro: sections[0],
|
2021-10-05 01:02:53 +00:00
|
|
|
sections_help: sections, // Remove the very beginning bit
|
|
|
|
categories: [...categories.keys()].join("|")
|
2021-06-20 00:51:55 +00:00
|
|
|
}
|