Skip to content

Commit 1f382e0

Browse files
authored
codeql markdown prefix content (github#35819)
1 parent 18af299 commit 1f382e0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/codeql-cli/lib/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"product": "{% data reusables.gated-features.codeql %}",
1616
"autogenerated": "codeql-cli"
1717
},
18+
"markdownPrefix": "{% data reusables.codeql-cli.man-pages-version-note %}",
1819
"targetDirectory": "content/code-security/codeql-cli/codeql-cli-manual",
1920
"sourceDirectory": "semmle-code/documentation/restructuredtext/codeql-cli/manual",
2021
"removeKeywords": [],

src/codeql-cli/scripts/sync.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import { toMarkdown } from 'mdast-util-to-markdown'
1717

1818
import { languageKeys } from '../../../lib/languages.js'
1919

20-
const { targetDirectory, sourceDirectory, frontmatterDefaults, removeKeywords } = JSON.parse(
21-
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8')
22-
)
20+
const { targetDirectory, sourceDirectory, frontmatterDefaults, removeKeywords, markdownPrefix } =
21+
JSON.parse(await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'))
2322
const RELATIVE_LINK_PATH = targetDirectory.replace('content', '')
2423
const SOURCE_REPO = sourceDirectory.split('/')[0]
2524
const TEMP_DIRECTORY = path.join(SOURCE_REPO, 'tempCliDocs')
@@ -255,7 +254,7 @@ async function main() {
255254

256255
// write the Markdown file
257256
const targetFilename = path.join(targetDirectory, path.basename(file))
258-
const markdownContent = MARKDOWN_COMMENT + toMarkdown(ast)
257+
const markdownContent = MARKDOWN_COMMENT + `${markdownPrefix}\n\n` + toMarkdown(ast)
259258
await writeFile(targetFilename, matter.stringify(markdownContent, frontmatter))
260259
}
261260

0 commit comments

Comments
 (0)