Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ddoc.dd
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ DDOC_PARAM_ID = $(TD $0)
DDOC_PARAM_DESC = $(TD $0)
DDOC_BLANKLINE = $(BR)$(BR)

DDOC_ANCHOR = <a name=\"$0\"></a>
DDOC_ANCHOR = <a name="$1"></a>
DDOC_PSYMBOL = $(U $0)
DDOC_KEYWORD = $(B $0)
DDOC_PARAM = $(I $0)
Expand Down Expand Up @@ -799,6 +799,8 @@ $(P
$(TR $(TD $(B DDOC_PARAM_ROW)) $(TD Highlighting of a name=value function parameter.))
$(TR $(TD $(B DDOC_PARAM_ID)) $(TD Highlighting of the parameter name.))
$(TR $(TD $(B DDOC_PARAM_DESC)) $(TD Highlighting of the parameter value.))
$(TR $(TD $(B DDOC_ANCHOR)) $(TD Expands to a named anchor used for hyperlinking to a
particular declaration section. Argument $1 expands to the qualified declaration name.))
$(TR $(TD $(B DDOC_PSYMBOL)) $(TD Highlighting of declaration name to which a particular section is referring.))
$(TR $(TD $(B DDOC_KEYWORD)) $(TD Highlighting of D keywords.))
$(TR $(TD $(B DDOC_PARAM)) $(TD Highlighting of function parameters.))
Expand Down
13 changes: 11 additions & 2 deletions std.ddoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,25 @@ function listanchors()
{
var a = document.anchors[i];
var text = a.name;
// ignore anchors from DDOC_PSYMBOL
if (text[0] != '.') continue;
if (hash[text] > 0) continue;
hash[text] = 1;
values[n++] = a.name
}

values.sort();
// we won't display the qualifying names to save space, so sort by last name
var lastName = function(a){
var li = a.lastIndexOf('.');
return a.slice(li + 1);
}
values.sort(function(a,b){return lastName(a) > lastName(b)});

for(var i = 0; i < values.length; i++) {
var a = values[i];
var text = lastName(a);
newText += ' \x3Ca href="\x23' + a +
'"\x3E\x3Cspan class="d_psymbol"\x3E' + a + '\x3C/span\x3E\x3C/a\x3E';
'"\x3E\x3Cspan class="d_psymbol"\x3E' + text + '\x3C/span\x3E\x3C/a\x3E';
}
if (newText != "") newText = "\x3Cp\x3E\x3Cb\x3EJump to:\x3C/b\x3E" + newText + "\x3C/p\x3E";
var a = document.getElementById("quickindex");
Expand Down Expand Up @@ -336,6 +344,7 @@ BIGOH = <b><i>&Omicron;</i>(</b>$(D $0)<b><i>)</i></b>
GLOSSARY = $(LINK2 ../glossary.html#$0, $0)

DDOC_PSYMBOL = <a name="$0"></a><span class="ddoc_psymbol">$0</span>
DDOC_ANCHOR = <a name=".$1"></a>
DDOC_DECL = <dt class="d_decl">$0</dt>
XREF = <a href="std_$1.html#$2">$(D std.$1.$2)</a>
CXREF = <a href="core_$1.html#$2">$(D core.$1.$2)</a>
Expand Down