mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-08 05:42:47 +02:00
update script and apply
This commit is contained in:
parent
2fecb4e583
commit
91d4d22156
9 changed files with 191 additions and 169 deletions
|
@ -6,14 +6,24 @@ const yaml = require('js-yaml');
|
|||
|
||||
// Functions
|
||||
const writePage = (setting) => {
|
||||
console.log('Generating ', setting.name, ".md")
|
||||
console.log('Generating ', setting.name, " page")
|
||||
let frontmatter = `---
|
||||
title: ${setting.name}
|
||||
lang: en-US
|
||||
sidebarDepth: 2
|
||||
meta:
|
||||
- name: keywords
|
||||
content: configuration options settings Pomerium enterprise console
|
||||
---
|
||||
|
||||
`
|
||||
let path = './docs/enterprise/reference/' + setting.name.replace(/\s/g, '-').toLowerCase() + ".md"
|
||||
console.log("path=", path) //For Debugging
|
||||
let header = '# ' + setting.name + '\n'
|
||||
let header = '# ' + setting.name + '\n' + '\n'
|
||||
let body = setting.doc ? setting.doc.toString() + '\n' : ''
|
||||
let moreBody = setting.settings ? setting.settings.map(subsection => writeSubsection(subsection, 2)).join('') : ''
|
||||
|
||||
let content = header + body + moreBody
|
||||
let content = frontmatter + header + body + moreBody
|
||||
fs.writeFileSync(path, content)
|
||||
|
||||
}
|
||||
|
@ -22,7 +32,7 @@ const writeSubsection = (subsection, depth) => {
|
|||
if (!subsection.name) {
|
||||
return
|
||||
}
|
||||
let header = '#'.repeat(depth) + ' ' + subsection.name + '\n'
|
||||
let header = '#'.repeat(depth) + ' ' + subsection.name + '\n' + '\n'
|
||||
let subContent = subsection.doc ? subsection.doc.toString() + '\n' : ''
|
||||
subsection.attributes ? subContent = subContent + subsection.attributes.toString() : null
|
||||
subsection.settings ? subContent = subContent + subsection.settings.map(turtles => writeSubsection(turtles, depth + 1)).join('') : ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue