Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bin/api2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ program
.option("-t, --theme <themeName>", "theme to use (see https://highlightjs.org/static/demo/ for a list)")
.option("-c, --customLogo <logoPath>", "use custom logo at the respective path")
.option("-C, --customCss", "use custom css")
.option("-P, --customCssPath <cssPath>", "use custom css file")
.option("-i, --includes <includesList>", "comma-separated list of files to include")
.option("-l, --languages <languageList>", "comma-separated list of languages to use for the language tabs (out of " + Object.getOwnPropertyNames(languageMap).join(", ") + ")")
.option("-s, --search", "enable search")
Expand Down Expand Up @@ -124,6 +125,20 @@ if (program.args.length === 0) {
if (program.customCss) {
shinOptions.customCss = true;
}

let customCss = "";
if (program.customCssPath) {
shinOptions.customCss = true;

try {
customCss = fs.readFileSync(path.resolve(program.customCssPath), "utf8");
console.log(chalk.green(icons.ok) + " Read custom css file!");
}
catch (error) {
console.log(chalk.red(icons.fail) + " Error loading custom css file:");
console.log(err.message);
}
}

let api = null;

Expand Down Expand Up @@ -160,6 +175,10 @@ if (program.args.length === 0) {
}

console.log(chalk.green(icons.ok) + " Rendered HTML form markdown!");

if (customCss) {
html = html.replace (/\/\* place your custom CSS overrides here \*\//i, customCss);
}

try {

Expand Down