Skip to content

Commit c460abb

Browse files
committed
docs: website panels use single page
1 parent 1028983 commit c460abb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/website/render.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ target_compile_features(${sourceBasename} PRIVATE cxx_std_23)
6767
// Run mrdocs to generate documentation
6868
const mrdocsConfig = path.join(absSnippetsDir, 'mrdocs.yml')
6969
const mrdocsInput = cmakeListsPath
70-
const mrdocsOutput = path.join(absSnippetsDir, 'output')
70+
const mrdocsOutput = path.join(absSnippetsDir, 'output', 'reference.html')
7171
const args = [
7272
mrdocsExecutable,
7373
`--config=${mrdocsConfig}`,
7474
mrdocsInput,
7575
`--output=${mrdocsOutput}`,
76-
'--multipage=true',
76+
'--multipage=false',
7777
'--generator=html',
7878
'--embedded=true',
79+
'--show-namespaces=false',
7980
];
8081
const command = args.join(' ');
8182
console.log(`Running command: ${command}`)
@@ -87,22 +88,19 @@ target_compile_features(${sourceBasename} PRIVATE cxx_std_23)
8788
}
8889

8990
// Look load symbol page in the output directory
90-
const documentationFilename = `${sourceBasename}.html`
91-
const documentationPath = path.join(mrdocsOutput, documentationFilename)
92-
if (!fs.existsSync(documentationPath)) {
93-
console.log(`Documentation file ${documentationFilename} not found in ${mrdocsOutput}`)
91+
if (!fs.existsSync(mrdocsOutput)) {
92+
console.log(`Documentation file not found in ${mrdocsOutput}`)
9493
console.log('Failed to generate website panel documentation')
9594
process.exit(1)
9695
}
97-
panel.documentation = fs.readFileSync(documentationPath, 'utf8');
96+
panel.documentation = fs.readFileSync(mrdocsOutput, 'utf8');
9897

9998
// Also inject the contents of the source file as highlighted C++
10099
const snippetContents = fs.readFileSync(sourcePath, 'utf8');
101-
const highlightedSnippet = hljs.highlight(snippetContents, {language: 'cpp'}).value;
102-
panel.snippet = highlightedSnippet;
100+
panel.snippet = hljs.highlight(snippetContents, {language: 'cpp'}).value;
103101

104102
// Delete these temporary files
105-
fs.rmSync(mrdocsOutput, {recursive: true});
103+
fs.unlinkSync(mrdocsOutput);
106104
fs.unlinkSync(cmakeListsPath);
107105

108106
console.log(`Documentation generated successfully for panel ${panel.source}`)

docs/website/snippets/mrdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
source-root: .
22
input:
33
- .
4+
show-namespaces: false
5+
multipage: false

0 commit comments

Comments
 (0)