Skip to content

Commit 8eeb8c7

Browse files
committed
Leverage exclude pattern from doxygen
1 parent 3fd6493 commit 8eeb8c7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const cleanDirectory = (dir) => {
3636
}
3737
}
3838

39-
4039
// Get version from package.json without using require
4140
const version = JSON.parse(fs.readFileSync('package.json')).version;
4241

@@ -47,9 +46,8 @@ program
4746
.usage('[options] <sourc folder> <target folder>')
4847

4948
program.argument('<source>', 'Source folder containing the .h files')
50-
program.argument('<target>', 'Target folder or file')
51-
program.option('-I, --include <string>', 'Regex for including files')
52-
program.option('-e, --exclude <string>', 'Regex for excluding files')
49+
program.argument('<target>', 'Target folder or file for the markdown documentation')
50+
program.option('-e, --exclude <string>', 'Pattern for excluding files (e.g. "*/test/*")')
5351
program.option('-c, --include-cpp', 'Include .cpp files')
5452
program.parse(process.argv);
5553

@@ -63,9 +61,9 @@ const outputFile = commandArguments[1]
6361
const commandOptions = program.opts()
6462
const includeCppFiles = commandOptions.includeCpp
6563

66-
let fileExtensions = [".h"]
64+
let fileExtensions = ["*.h"]
6765
if (includeCppFiles) {
68-
fileExtensions.push(".cpp")
66+
fileExtensions.push("*.cpp")
6967
}
7068

7169
cleanDirectory("./build")
@@ -88,8 +86,8 @@ const doxyFileOptions = {
8886
GENERATE_LATEX: "NO",
8987
GENERATE_XML: "YES",
9088
XML_OUTPUT: XML_FOLDER,
91-
INCLUDE_FILE_PATTERNS: "*.h *.cpp",
92-
EXCLUDE_PATTERNS: "*/test/*",
89+
INCLUDE_FILE_PATTERNS: fileExtensions.join(" "),
90+
EXCLUDE_PATTERNS: commandOptions.exclude ? commandOptions.exclude : "",
9391
EXTRACT_PRIVATE: "NO",
9492
EXTRACT_STATIC: "NO",
9593
QUIET: DEBUG ? "NO" : "YES",
@@ -102,6 +100,7 @@ doxygen.run(DOXYGEN_FILE_PATH)
102100

103101
const moxygenOptions = {
104102
quiet: true, /** Do not output anything to the console **/
103+
anchors: false, /** Don't generate markdown anchors for internal links **/
105104
htmlAnchors: true, /** Generate HTML anchors for output **/
106105
directory: XML_FOLDER, /** Location of the doxygen files **/
107106
output: outputFile, /** Output file **/
@@ -115,6 +114,7 @@ const moxygenOptions = {
115114
const finalMoxygenOptions = assign({}, moxygen.defaultOptions, {
116115
directory: moxygenOptions.directory,
117116
output: moxygenOptions.output,
117+
anchors: moxygenOptions.anchors,
118118
htmlAnchors: moxygenOptions.htmlAnchors,
119119
language: moxygenOptions.language,
120120
relativePaths: moxygenOptions.relativePaths,

0 commit comments

Comments
 (0)