@@ -36,7 +36,6 @@ const cleanDirectory = (dir) => {
36
36
}
37
37
}
38
38
39
-
40
39
// Get version from package.json without using require
41
40
const version = JSON . parse ( fs . readFileSync ( 'package.json' ) ) . version ;
42
41
@@ -47,9 +46,8 @@ program
47
46
. usage ( '[options] <sourc folder> <target folder>' )
48
47
49
48
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/*")' )
53
51
program . option ( '-c, --include-cpp' , 'Include .cpp files' )
54
52
program . parse ( process . argv ) ;
55
53
@@ -63,9 +61,9 @@ const outputFile = commandArguments[1]
63
61
const commandOptions = program . opts ( )
64
62
const includeCppFiles = commandOptions . includeCpp
65
63
66
- let fileExtensions = [ ".h" ]
64
+ let fileExtensions = [ "* .h" ]
67
65
if ( includeCppFiles ) {
68
- fileExtensions . push ( ".cpp" )
66
+ fileExtensions . push ( "* .cpp" )
69
67
}
70
68
71
69
cleanDirectory ( "./build" )
@@ -88,8 +86,8 @@ const doxyFileOptions = {
88
86
GENERATE_LATEX : "NO" ,
89
87
GENERATE_XML : "YES" ,
90
88
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 : " ",
93
91
EXTRACT_PRIVATE : "NO" ,
94
92
EXTRACT_STATIC : "NO" ,
95
93
QUIET : DEBUG ? "NO" : "YES" ,
@@ -102,6 +100,7 @@ doxygen.run(DOXYGEN_FILE_PATH)
102
100
103
101
const moxygenOptions = {
104
102
quiet : true , /** Do not output anything to the console **/
103
+ anchors : false , /** Don't generate markdown anchors for internal links **/
105
104
htmlAnchors : true , /** Generate HTML anchors for output **/
106
105
directory : XML_FOLDER , /** Location of the doxygen files **/
107
106
output : outputFile , /** Output file **/
@@ -115,6 +114,7 @@ const moxygenOptions = {
115
114
const finalMoxygenOptions = assign ( { } , moxygen . defaultOptions , {
116
115
directory : moxygenOptions . directory ,
117
116
output : moxygenOptions . output ,
117
+ anchors : moxygenOptions . anchors ,
118
118
htmlAnchors : moxygenOptions . htmlAnchors ,
119
119
language : moxygenOptions . language ,
120
120
relativePaths : moxygenOptions . relativePaths ,
0 commit comments