Skip to content

Commit 214097f

Browse files
committed
Move $(ROOT_DIR) inside $(DPL_LINK)
DPL_LINK can work reliably only if it prefixes URLs with a fixed logical location, both when it expands to a relative or absolute URL. As such, ROOT_DIR needs to be part of the DPL_LINK expansion for relative URLs only.
1 parent d3cb555 commit 214097f

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

dlang.org.ddoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ DMDSRC=$(HTTPS github.com/dlang/dmd/blob/master/src/dmd/$0, $0)
159159
DOT_PREFIXED=.$1$(DOT_PREFIXED $+)
160160
DOT_PREFIXED_SKIP=$(DOT_PREFIXED $+)
161161
DRUNTIMESRC=$(HTTPS github.com/dlang/druntime/blob/master/src/$0, $0)
162-
DPLLINK=$(LINK2 $1,$+)
162+
_=
163+
164+
$(COMMENT URL prefix for the site root.
165+
Relative (e.g. "../") for dlang.org pages;
166+
absolute ("https://dlang.org/") for the ebook/pdf.)
167+
DPLLINK=$(LINK2 $(ROOT_DIR)$1,$+)
163168
_=
164169

165170
ELABORATE_HEADER=$(TR <th rowspan="2">D</th><th colspan="2">C</th>)

spec/ddoc.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ $(P
674674
$(OL
675675
$(LI Predefined macros.)
676676
$(LI Definitions from file specified by
677-
$(DPLLINK $(ROOT_DIR)dmd-windows.html, sc.ini)'s
677+
$(DPLLINK dmd-windows.html, sc.ini)'s
678678
or $(DDSUBLINK dmd-linux, dmd_conf, dmd.conf) DDOCFILE setting.)
679679
$(LI Definitions from *.ddoc files specified on the command line.)
680680
$(LI Runtime definitions generated by Ddoc.)

spec/errors.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ $(DL
175175
)
176176

177177
Using exceptions to handle errors leads to another issue - how to write
178-
exception safe programs. $(DPLLINK $(ROOT_DIR)exception-safe.html, Here's how).
178+
exception safe programs. $(DPLLINK exception-safe.html, Here's how).
179179

180180
$(COMMENT
181181
$(OL

spec/expression.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,13 +1747,13 @@ $(GNAME TypeidExpression):
17471747
)
17481748

17491749
$(P If $(I Type), returns an instance of class
1750-
$(DPLLINK $(ROOT_DIR)phobos/object.html, $(D TypeInfo))
1750+
$(DPLLINK phobos/object.html, $(D TypeInfo))
17511751
corresponding
17521752
to $(I Type).
17531753
)
17541754

17551755
$(P If $(I Expression), returns an instance of class
1756-
$(DPLLINK $(ROOT_DIR)phobos/object.html, $(D TypeInfo))
1756+
$(DPLLINK phobos/object.html, $(D TypeInfo))
17571757
corresponding
17581758
to the type of the $(I Expression).
17591759
If the type is a class, it returns the $(D TypeInfo)

spec/interfaceToC.dd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ $(H2 $(LNAME2 storage_allocation, Storage Allocation))
116116

117117
$(LI Registering the pointer with the garbage collector with the
118118

119-
$(DPLLINK $(ROOT_DIR)phobos/core_memory.html#addRoot, std.gc.addRoot())
119+
$(DPLLINK phobos/core_memory.html#addRoot, std.gc.addRoot())
120120
or
121121

122-
$(DPLLINK $(ROOT_DIR)phobos/core_memory.html#addRange, std.gc.addRange())
122+
$(DPLLINK phobos/core_memory.html#addRange, std.gc.addRange())
123123
calls.)
124124

125125
)
@@ -253,7 +253,7 @@ $(H2 $(LNAME2 structs_and_unions, Structs and Unions))
253253
with shift and mask operations,
254254
or use the $(LINK2 $(ROOT_DIR)phobos/std_bitmanip.html#bitfields, std.bitmanip.bitfields)
255255
library type.
256-
$(DPLLINK $(ROOT_DIR)htod.html, htod) will convert bit fields to inline
256+
$(DPLLINK htod.html, htod) will convert bit fields to inline
257257
functions that
258258
do the right shift and masks.
259259
)

spec/objc_interface.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ $(HEADERNAV_TOC)
8989

9090
$(P
9191
The attribute is defined in druntime in
92-
$(LINK2 ../phobos/core_attribute.html, `core.attribute`) and aliased in
93-
$(LINK2 ../phobos/object.html, `object`), meaning it will be implicitly
92+
$(DPLLINK phobos/core_attribute.html, `core.attribute`) and aliased in
93+
$(DPLLINK phobos/object.html, `object`), meaning it will be implicitly
9494
imported. The attribute is only defined when the version identifier
9595
$(LINK2 #objc-version-identifier, `D_ObjectiveC`) is enabled.
9696
)

0 commit comments

Comments
 (0)