-
Notifications
You must be signed in to change notification settings - Fork 7
Macros
A DDoc macro is a text processing function that uses the following syntax: $(MACRONAME arg1, ..., argN)
. bootDoc includes a number of standard macros, documented below.
-
$(LPAREN) and $(RPAREN)
- Insert an opening and closing parenthesis, respectively. Useful when parentheses are needed in macro argument lists.
-
$(LESS) and $(GREATER)
- Insert a less-than (<) and greater-than (>) symbol, respectively. Useful when the target output format is HTML, which is the case with bootDoc.
-
$(D code)
- Insert D code inline. Inline code is rendered in a monospace font.
-
$(BIGOH expression)
- Insert complexity expression in big-O notation.
-
$(HTTP address, text) and $(HTTPS address, text)
- Insert web link with custom text, using the HTTP and HTTPS protocols, respectively. Do not include the protocol prefix in address.
-
$(LUCKY searchTerm)
- Insert link to a I'm feeling lucky Google search for the term searchTerm. The text for the link is also searchTerm.
-
$(BUGREF ticket) and $(ISSUEREF ticket)
- Insert link to the project bug/issue tracker opened on ticket. Configured by
ISSUETRACKER
in settings.ddoc. The difference between them is the text used in the link; useISSUEREF
for issues that aren't bugs, such as enhancement requests.
- Insert link to the project bug/issue tracker opened on ticket. Configured by
The *REF[2-6]
macros are used to insert references to specific symbol declarations. The prefix in the name of the macro is the root of the reference. The number suffix denotes how many sub-packages are needed to reach the reference from the root. MREF
and UPREF
do not have suffix versions.
-
$(MREF symbol)
- Module reference. Insert reference to symbol from the current module.
-
$(DPREF module, symbol)
- Default package reference. Insert reference to $(DEFAULTPACKAGE).module.symbol.
DEFAULTPACKAGE
is defined in settings.ddoc. This is the preferred way to insert cross references.
- Default package reference. Insert reference to $(DEFAULTPACKAGE).module.symbol.
-
$(RREF package, module, symbol)
- Root reference. Insert reference to package.module.symbol.
-
$(PREF module, symbol)
- Package reference. Insert reference to $(THISPACKAGE).module.symbol.
THISPACKAGE
is automatically defined to be the current package when the documentation is generated using the included generation tool. Otherwise,THISPACKAGE
must be defined manually.
- Package reference. Insert reference to $(THISPACKAGE).module.symbol.
-
$(RPREF module, symbol)
- Root package reference. Insert reference to $(THISROOTPACKAGE).module.symbol.
THISROOTPACKAGE
is automatically defined to be the parent package of the current package when the documentation is generated using the included generation tool. Otherwise,THISROOTPACKAGE
must be defined manually.
- Root package reference. Insert reference to $(THISROOTPACKAGE).module.symbol.
-
$(UPREF module, symbol)
- Unpackaged module reference. Insert reference to module.symbol.
The *MODULE[2-6]
macros are used to insert references to other modules in the project. The prefix in the name of the macro is the root of the reference. The number suffix denotes how many sub-packages are needed to reach the reference from the root. UPMODULE
does not have suffix versions.
-
$(DPMODULE module)
- Default package reference. Insert reference to $(DEFAULTPACKAGE).module.
DEFAULTPACKAGE
is defined in settings.ddoc.
- Default package reference. Insert reference to $(DEFAULTPACKAGE).module.
-
$(RMODULE package, module)
- Root reference. Insert reference to package.module.
-
$(PMODULE module)
- Package reference. Insert reference to $(THISPACKAGE).module.
THISPACKAGE
is automatically defined to be the current package when the documentation is generated using the included generation tool. Otherwise,THISPACKAGE
must be defined manually.
- Package reference. Insert reference to $(THISPACKAGE).module.
-
$(RPMODULE module)
- Root package reference. Insert reference to $(THISROOTPACKAGE).module.
THISROOTPACKAGE
is automatically defined to be the parent package of the current package when the documentation is generated using the included generation tool. Otherwise,THISROOTPACKAGE
must be defined manually.
- Root package reference. Insert reference to $(THISROOTPACKAGE).module.
-
$(UPMODULE module)
- Unpackaged module reference. Insert reference to module.
The STD*
macros can be used to reference the standard library documentation at dlang.org.
-
$(STDREF module, symbol)
- Symbol reference.
-
$(STDMODULE module)
- Module reference.