Skip to content
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

document macros REF and REF_ALTTEXT #1226

Merged
merged 1 commit into from Feb 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions dlang.org.ddoc
Expand Up @@ -295,8 +295,46 @@ PHOBOSSRC=$(SPANC phobos_src, $(AHTTPS github.com/D-Programming-Language/phobos/
_=

RED=$(SPANC red, $0)
_=

$(COMMENT
The REF macro generates a link to a phobos symbol.

The first argument is the symbol name inside its module, without any
module/package parts, in usual dotted format.

Arguments 2 and higher form the module name. The segments are passed
as individual arguments.

The weird order is due to the format of the generated link, and Ddoc being
simplistic.

Example:

$(REF Array.back, std,container,array) generates a link to
std.container.array.Array.back

To clarify, std.container.array is a module, Array is a struct in that
module, and back is a method of that struct.

The generated href will be "phobos/std_container_array.html#.Array.back"
(the phobos path can be different, of course).
)
REF=<a href="$(PHOBOS_PATH)$2$(UNDERSCORE_PREFIXED_SKIP $+).html#.$1">$(D $2$(DOT_PREFIXED_SKIP $+, $1))</a>
_=

$(COMMENT
The REF_ALTTEXT macro works the same as the REF macro, but it has another
parameter in front of the others that specifies the link text.

Example:
$(REF_ALTTEXT the 'back' method, Array.back, std,container,array)
generates a link like this:
<a href="phobos/std_container_array.html#.Array.back">the 'back' method</a>
)
REF_ALTTEXT=<a href="$(PHOBOS_PATH)$3$(UNDERSCORE_PREFIXED_SKIP2 $+).html#.$2">$1</a>
_=

RELATIVE_LINK2=$(ALOCAL $1, $+)
_=

Expand Down