Skip to content

Adding a custom separator option for replacing the default '::' in filenames #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/moxygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ program.version(pjson.version)
.option('-t, --templates <dir>', 'custom templates directory (default: "built-in templates")', String)
.option('-L, --logfile [file]', 'output log messages to file, (default: console only, default file name: "moxygen.log")')
.option('-q, --quiet', 'quiet mode', false)
.option('-s, --separator <separator sequence>', 'separator sequence (default: "::")', '::')

.parse(process.argv);

logger.init(program, app.defaultOptions);

if (program.args.length) {
app.run(assign({}, app.defaultOptions, {
directory: program.args[0],
directory: program.args.slice(-1).pop(),
output: program.output,
groups: program.groups,
pages: program.pages,
Expand All @@ -35,6 +37,7 @@ if (program.args.length) {
anchors: program.anchors,
htmlAnchors: program.htmlAnchors,
language: program.language,
separator: program.separator,
templates: program.templates,
}));
}
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
classes: false, /** Output doxygen classes separately **/
output_s: 'api_%s.md', /** Output file for groups and classes **/
logfile: 'moxygen.log', /** Log file **/
separator: '::', /** Group separator sequence **/

filters: {
members: [
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
} else if (options.groups) {
return util.format(options.output, compound.groupname);
} else if (options.classes) {
return util.format(options.output, compound.name.replace(/\:/g, '-').replace('<', '(').replace('>', ')'));
return util.format(options.output, compound.name.replace(/\:\:/g, options.separator).replace(/\:/g, '-').replace('<', '(').replace('>', ')'));
} else {
return options.output;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ module.exports = {
case 'typedef':

// set namespace reference
var nsp = compound.name.split('::');
var nsp = compound.name.split("::");
compound.namespace = nsp.splice(0, nsp.length - 1).join('::');
break;

Expand Down