Skip to content

Commit 66d20a9

Browse files
authored
Merge pull request #32 from eLod/html-anchors
add html anchors, fixes #31
2 parents 0ac75aa + 06bb30f commit 66d20a9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

bin/moxygen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ program.version(pjson.version)
1515
.option('-p, --pages', 'output doxygen pages into separate files', false)
1616
.option('-n, --noindex', 'disable generation of the index (no effect with `groups` option', false)
1717
.option('-a, --anchors', 'add anchors to internal links', false)
18+
.option('-h, --html-anchors', 'add html anchors to internal links', false)
1819
.option('-l, --language <lang>', 'programming language', String, 'cpp')
1920
.option('-t, --templates <dir>', 'custom templates directory', String, 'templates')
2021
.option('-q, --quiet', 'quiet mode', false)
@@ -33,6 +34,7 @@ if (program.args.length) {
3334
classes: program.classes,
3435
noindex: program.noindex,
3536
anchors: program.anchors,
37+
htmlAnchors: program.htmlAnchors,
3638
language: program.language,
3739
templates: program.templates
3840
}));

src/templates.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ module.exports = {
9090
if (options.anchors) {
9191
return '{#' + name + '}';
9292
}
93+
else if (options.htmlAnchors) {
94+
return '<a id="' + name + '"></a>';
95+
}
9396
else {
9497
return '';
9598
}

0 commit comments

Comments
 (0)