mirror of
https://github.com/tale/headplane.git
synced 2026-08-22 18:56:38 +00:00
chore: format everything with oxfmt
This commit is contained in:
+23
-23
@@ -1,34 +1,34 @@
|
||||
import fs from "node:fs";
|
||||
|
||||
function renderOptions(options) {
|
||||
const blocks = Object.keys(options).map((key) => {
|
||||
const opt = options[key];
|
||||
const name = key.split(".").slice(2).join(".");
|
||||
const lines = [];
|
||||
lines.push(`## ${name}`);
|
||||
lines.push(`*Description:* ${opt.description}\n`);
|
||||
lines.push(`*Type:* ${opt.type}\n`);
|
||||
if (opt.default) {
|
||||
lines.push(`*Default:* \`${opt.default.text}\`\n`);
|
||||
}
|
||||
if (opt.example) {
|
||||
lines.push(`*Example:* \`${opt.example.text}\`\n`);
|
||||
}
|
||||
return lines.join("\n");
|
||||
});
|
||||
const blocks = Object.keys(options).map((key) => {
|
||||
const opt = options[key];
|
||||
const name = key.split(".").slice(2).join(".");
|
||||
const lines = [];
|
||||
lines.push(`## ${name}`);
|
||||
lines.push(`*Description:* ${opt.description}\n`);
|
||||
lines.push(`*Type:* ${opt.type}\n`);
|
||||
if (opt.default) {
|
||||
lines.push(`*Default:* \`${opt.default.text}\`\n`);
|
||||
}
|
||||
if (opt.example) {
|
||||
lines.push(`*Example:* \`${opt.example.text}\`\n`);
|
||||
}
|
||||
return lines.join("\n");
|
||||
});
|
||||
|
||||
return [
|
||||
`# NixOS module options
|
||||
return [
|
||||
`# NixOS module options
|
||||
|
|
||||
|All options must be under \`services.headplane\`.
|
||||
|
|
||||
|For example: \`settings.headscale.config_path\` becomes \`services.headplane.settings.headscale.config_path\`.`
|
||||
.split("|")
|
||||
.map((s) => s.replace(/\n\s+/g, ""))
|
||||
.join("\n"),
|
||||
]
|
||||
.concat(blocks)
|
||||
.join("\n\n");
|
||||
.split("|")
|
||||
.map((s) => s.replace(/\n\s+/g, ""))
|
||||
.join("\n"),
|
||||
]
|
||||
.concat(blocks)
|
||||
.join("\n\n");
|
||||
}
|
||||
|
||||
const filename = process.argv[2];
|
||||
|
||||
Reference in New Issue
Block a user