Skip to content

Commit

Permalink
Fix title adjustment code.
Browse files Browse the repository at this point in the history
- Failed for multi-word symbol kinds ("enum member").
- Now uses the actual part of the title instead of node.name, which is necessary for fixing dlang/ddox#82 completely.
  • Loading branch information
s-ludwig committed Oct 20, 2015
1 parent 0e75d9e commit 8694aae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dpl-docs/views/layout.dt
Expand Up @@ -108,11 +108,12 @@ html(lang='en-US')
span
| View or edit the community-maintained wiki page associated with this page.

- auto hidx = std.string.indexOf(title, ' ');
- if (title.endsWith(" - multiple declarations"))
h1 <code><a href="#{info.linkTo(info.mod)}">#{info.mod.qualifiedName}</a>.#{title[0 .. $-24]}</code> #{title[$-24 ..$]}
- else if (hidx > 0 && !title.startsWith("Module ") && info.mod)
h1 #{title[0 .. hidx]} <code><a href="#{info.linkTo(info.mod)}">#{info.mod.qualifiedName}</a>.#{title[hidx+1 .. $]}</code>
- auto hidx = std.string.lastIndexOf(title, ' ');
- auto node = info.docGroups.length ? info.docGroups[0].members[0] : null;
- if (title.endsWith(" - multiple declarations") && node)
h1 <code><a href="#{info.linkTo(node.parent)}">#{node.parent.qualifiedName}</a>.#{title[0 .. $-24]}</code> #{title[$-24 ..$]}
- else if (hidx > 0 && !title.startsWith("Module ") && node)
h1 #{title[0 .. hidx]} <code><a href="#{info.linkTo(node.parent)}">#{node.parent.qualifiedName}</a>.#{node.name}</code>
- else if (hidx > 0 && title.startsWith("Module ") && info.mod)
h1 Module <code>#{info.mod.qualifiedName}</code>
- else
Expand Down

0 comments on commit 8694aae

Please sign in to comment.