diff --git a/share/mrdocs/addons/generator/common/partials/location/source.hbs b/share/mrdocs/addons/generator/common/partials/location/source.hbs index 094c4fbadf..617eaac5b8 100644 --- a/share/mrdocs/addons/generator/common/partials/location/source.hbs +++ b/share/mrdocs/addons/generator/common/partials/location/source.hbs @@ -12,7 +12,7 @@ --}} Declared in {{#>markup/code~}} {{ str "<" }}{{#if (and @root.config.base-url dcl.shortPath dcl.sourcePath)~}} - {{#>markup/a href=(concat @root.config.base-url dcl.sourcePath '#L' dcl.line)}}{{dcl.shortPath}}{{/markup/a}} + {{#>markup/a href=(concat @root.config.base-url dcl.sourcePath '#L' dcl.lineNumber)}}{{dcl.shortPath}}{{/markup/a}} {{~else~}} {{dcl.shortPath}} {{~/if~}}{{ str ">" }} diff --git a/test-files/golden-tests/config/base-url/base-url.adoc b/test-files/golden-tests/config/base-url/base-url.adoc new file mode 100644 index 0000000000..cf5329c2ae --- /dev/null +++ b/test-files/golden-tests/config/base-url/base-url.adoc @@ -0,0 +1,29 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + +=== Functions + +[cols=1] +|=== +| Name +| link:#f[`f`] +|=== + +[#f] +== f + +=== Synopsis + +Declared in `<https://example.com/src/base-url.cpp#L6[base‐url.cpp]>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(); +---- + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/base-url/base-url.cpp b/test-files/golden-tests/config/base-url/base-url.cpp new file mode 100644 index 0000000000..a4308e4781 --- /dev/null +++ b/test-files/golden-tests/config/base-url/base-url.cpp @@ -0,0 +1,6 @@ +// When the `base-url` config option is set, the generated +// documentation's Synopsis section carries a link to the source +// file, with an anchor pointing at the line where the symbol is +// declared. + +void f(); diff --git a/test-files/golden-tests/config/base-url/base-url.html b/test-files/golden-tests/config/base-url/base-url.html new file mode 100644 index 0000000000..905f871f0d --- /dev/null +++ b/test-files/golden-tests/config/base-url/base-url.html @@ -0,0 +1,49 @@ + +
+