| 1 |
!!! 5 |
| 2 |
html(lang='en-US') |
| 3 |
- import std.datetime : Clock; |
| 4 |
- auto year = Clock.currTime.year; |
| 5 |
// |
| 6 |
| Copyright (c) 1999-$#{year} by the D Language Foundation |
| 7 |
| All Rights Reserved. |
| 8 |
| https://dlang.org/foundation_overview.html |
| 9 |
- import std.process : environment; |
| 10 |
- import std.array : replace; |
| 11 |
- static import std.string; |
| 12 |
- string version_id = environment["GIT_TARGET"]; |
| 13 |
- bool noExactSourceCodeLinks = environment["NO_EXACT_SOURCE_CODE_LINKS"] == "1"; |
| 14 |
- bool haveVersion = version_id.startsWith("v"); |
| 15 |
- string version_name = haveVersion ? version_id[1 .. $] : "Prerelease"; |
| 16 |
- string root_dir = info.linkTo(null) ~ (req is null ? "../" : ""); |
| 17 |
- string ddox_dir = haveVersion ? "library/" : "library-prerelease/"; |
| 18 |
|
| 19 |
head |
| 20 |
meta(charset='utf-8') |
| 21 |
- string title; |
| 22 |
meta(name='keywords', content='D programming language') |
| 23 |
meta(name='description', content='D Programming Language') |
| 24 |
block title |
| 25 |
title #{title} - D Programming Language |
| 26 |
link(rel='stylesheet', href='#{root_dir}css/codemirror.css') |
| 27 |
link(rel='stylesheet', href='#{root_dir}css/style.css') |
| 28 |
link(rel='stylesheet', href='#{root_dir}css/print.css', media='print') |
| 29 |
link(rel='stylesheet', href='#{root_dir}css/ddox.css') |
| 30 |
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css') |
| 31 |
link(rel='shortcut icon', href='#{root_dir}favicon.ico') |
| 32 |
script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', type='text/javascript') |
| 33 |
meta(name='viewport', content='width=device-width, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0') |
| 34 |
|
| 35 |
body.std(id='#{info.node.moduleName}') |
| 36 |
script(type='text/javascript'). |
| 37 |
document.body.className += ' have-javascript'; |
| 38 |
#top |
| 39 |
.helper |
| 40 |
.helper.expand-container |
| 41 |
a.logo(href='#{root_dir}') |
| 42 |
img#logo(width='125', height='95', alt='D Logo', src='#{root_dir}images/dlogo.svg') |
| 43 |
a.hamburger.expand-toggle(href="#{root_dir}menu.html", title="Menu") |
| 44 |
span Menu |
| 45 |
#cssmenu |
| 46 |
ul |
| 47 |
li |
| 48 |
a(href="https://tour.dlang.org") |
| 49 |
span Learn |
| 50 |
li.expand-container |
| 51 |
a.expand-toggle(href="#{root_dir}documentation.html") |
| 52 |
span Documentation |
| 53 |
ul |
| 54 |
li |
| 55 |
a(href="#{root_dir}spec/spec.html") Language Reference |
| 56 |
li |
| 57 |
a(href="#{root_dir}phobos/index.html") Library Reference |
| 58 |
li |
| 59 |
a(href="#{root_dir}dmd.html") Command-line Reference |
| 60 |
li.menu-divider |
| 61 |
a(href="#{root_dir}comparison.html") Feature Overview |
| 62 |
li |
| 63 |
a(href="#{root_dir}articles.html") Articles |
| 64 |
li |
| 65 |
a(href="#{root_dir}download.html") |
| 66 |
span Downloads |
| 67 |
li |
| 68 |
a(href="https://code.dlang.org") |
| 69 |
span Packages |
| 70 |
li.expand-container |
| 71 |
a.expand-toggle(href="#{root_dir}community.html") |
| 72 |
span Community |
| 73 |
ul |
| 74 |
li |
| 75 |
a(href="https://dlang.org/blog") Blog |
| 76 |
li |
| 77 |
a(href="#{root_dir}orgs-using-d.html") Orgs using D |
| 78 |
li |
| 79 |
a(href="https://twitter.com/search?q=%23dlang") Twitter |
| 80 |
li |
| 81 |
a(href="#{root_dir}calendar.html") Calendar |
| 82 |
li.menu-divider |
| 83 |
a(href="https://forum.dlang.org") Forums |
| 84 |
li |
| 85 |
a(href="irc://irc.freenode.net/d") IRC |
| 86 |
li |
| 87 |
a(href="https://wiki.dlang.org") Wiki |
| 88 |
li.menu-divider |
| 89 |
a(href="https://github.com/dlang") GitHub |
| 90 |
li |
| 91 |
a(href="#{root_dir}bugstats.html") Issues |
| 92 |
li |
| 93 |
a(href="https://wiki.dlang.org/Get_involved") Get Involved |
| 94 |
li.menu-divider |
| 95 |
a(href="#{root_dir}foundation") Foundation |
| 96 |
li |
| 97 |
a(href="#{root_dir}security.html") Security Team |
| 98 |
li |
| 99 |
a(href="#{root_dir}foundation/donate.html") Donate |
| 100 |
li |
| 101 |
a(href="#{root_dir}foundation/sponsors.html") Sponsors |
| 102 |
li.expand-container |
| 103 |
a.expand-toggle(href="#{root_dir}resources.html") |
| 104 |
span Resources |
| 105 |
ul |
| 106 |
li |
| 107 |
a(href="https://wiki.dlang.org/Books") Books |
| 108 |
li |
| 109 |
a(href="https://wiki.dlang.org/Tutorials") Tutorials |
| 110 |
li.menu-divider |
| 111 |
a(href="https://wiki.dlang.org/Development_tools") Tools |
| 112 |
li |
| 113 |
a(href="https://wiki.dlang.org/Editors") Editors |
| 114 |
li |
| 115 |
a(href="https://wiki.dlang.org/IDEs") IDEs |
| 116 |
li |
| 117 |
a(href="http://rainers.github.io/visuald/visuald/StartPage.html") Visual D |
| 118 |
li.menu-divider |
| 119 |
a(href="#{root_dir}acknowledgements.html") Acknowledgments |
| 120 |
li |
| 121 |
a(href="#{root_dir}dstyle.html") D Style |
| 122 |
li |
| 123 |
a(href="#{root_dir}glossary.html") Glossary |
| 124 |
li |
| 125 |
a(href="#{root_dir}sitemap.html") Sitemap |
| 126 |
.search-container.expand-container |
| 127 |
a.expand-toggle(href="#{root_dir}search.html", title="Search") |
| 128 |
span Search |
| 129 |
#search-box |
| 130 |
form(method='get', action='https://google.com/search', autocomplete='off') |
| 131 |
input#domains(type='hidden', name='domains', value='dlang.org') |
| 132 |
| |
| 133 |
input#sourceid(type='hidden', name='sourceid', value='google-search') |
| 134 |
| |
| 135 |
span#search-query |
| 136 |
input#q(name='q', placeholder='Search') |
| 137 |
input#symbolSearch(style="display: none", type="text", name="symbolSearch", placeholder="API Search", onchange="performSymbolSearch(80);", onkeypress="this.onchange();", onpaste="this.onchange();", oninput="this.onchange();", autofocus) |
| 138 |
span#search-dropdown |
| 139 |
.helper |
| 140 |
select#sitesearch(name='sitesearch', size='1') |
| 141 |
option(value='dlang.org') Entire D Site |
| 142 |
| |
| 143 |
option(selected='', value='dlang.org/spec') Language |
| 144 |
| |
| 145 |
option(selected='', value='dlang.org/library') Library |
| 146 |
| |
| 147 |
option(value='forum.dlang.org') Forums |
| 148 |
span#search-submit |
| 149 |
button(type='submit') |
| 150 |
i.fa.fa-search |
| 151 |
span go |
| 152 |
include ddox.inc.symbol-search.results |
| 153 |
|
| 154 |
.container |
| 155 |
.subnav-helper |
| 156 |
.subnav |
| 157 |
h2 API Documentation |
| 158 |
p |
| 159 |
span.smallprint |
| 160 |
- if( haveVersion ) |
| 161 |
| version #{version_name} |
| 162 |
p |
| 163 |
a(href="#{root_dir}#{ddox_dir}index.html") overview |
| 164 |
ul |
| 165 |
block navigation |
| 166 |
#content.hyphenate |
| 167 |
#tools |
| 168 |
div |
| 169 |
- import ddox.entities : Declaration; |
| 170 |
- auto modname = info.node.moduleName; |
| 171 |
- string project = "dlang.org"; |
| 172 |
- string path_prefix, line_suffix, filename; |
| 173 |
- if( modname ) |
| 174 |
- if( modname.startsWith("core.") || modname.startsWith("object")) |
| 175 |
- project = "druntime", path_prefix = "src/"; |
| 176 |
- else if( modname.startsWith("dmd.") ) |
| 177 |
- project = "dmd", path_prefix = "src/"; |
| 178 |
- else |
| 179 |
- project = "phobos", path_prefix = ""; |
| 180 |
- if (info.docGroups.length >= 1 && !noExactSourceCodeLinks) |
| 181 |
- if (auto decl = cast(Declaration)info.docGroups[0].members[0]) line_suffix = "#L"~to!string(decl.line); |
| 182 |
- if (info.node.module_.isPackageModule) |
| 183 |
- filename = replace(modname, ".", "/") ~ "/package.d"; |
| 184 |
- else |
| 185 |
- filename = replace(modname, ".", "/") ~ ".d"; |
| 186 |
|
| 187 |
- if( modname ) |
| 188 |
.tip.smallprint |
| 189 |
a(href='https://github.com/dlang/#{project}/blob/#{version_id}/#{path_prefix}#{filename}#{line_suffix}') |
| 190 |
| View source code |
| 191 |
div |
| 192 |
| Display the source code in #{filename} from which this |
| 193 |
| page was generated on github. |
| 194 |
|
| 195 |
.tip.smallprint |
| 196 |
- auto pagename = modname ? path_prefix ~ replace(modname, ".", "/") : "index"; |
| 197 |
a(href="https://issues.dlang.org/enter_bug.cgi?bug_file_loc=http%3A%2F%2Fdlang.org/#{ddox_dir}#{pagename}.html&bug_severity=enhancement&component=#{project}&op_sys=All&priority=P3&product=D&rep_platform=All&short_desc=%5B#{title}%5D&version=D2") Report a bug |
| 198 |
div |
| 199 |
| If you spot a problem with this page, click here to create a |
| 200 |
| Bugzilla issue. |
| 201 |
|
| 202 |
- if( modname ) |
| 203 |
.tip.smallprint |
| 204 |
a(href='https://github.com/dlang/#{project}/edit/master/#{path_prefix}#{filename}#{line_suffix}') |
| 205 |
| Improve this page |
| 206 |
div |
| 207 |
| Quickly fork, edit online, and submit a pull request for this page. |
| 208 |
| Requires a signed-in GitHub account. This works well for small changes. |
| 209 |
| If you'd like to make larger changes you may want to consider using |
| 210 |
| local clone. |
| 211 |
|
| 212 |
- auto hidx = std.string.lastIndexOf(title, ' '); |
| 213 |
- auto node = info.docGroups.length ? info.docGroups[0].members[0] : null; |
| 214 |
- if (title.endsWith(" - multiple declarations") && node) |
| 215 |
h1 <code><a href="#{info.linkTo(info.mod)}">#{info.mod.qualifiedName}</a>.#{title[0 .. $-24]}</code> #{title[$-24 ..$]} |
| 216 |
- else if (hidx > 0 && !title.startsWith("Module ") && node) |
| 217 |
h1 #{title[0 .. hidx]} <code><a href="#{info.linkTo(node.parent)}">#{node.parent.qualifiedName}</a>.#{node.name}</code> |
| 218 |
- else if (hidx > 0 && title.startsWith("Module ") && info.mod) |
| 219 |
h1 Module <code>#{info.mod.qualifiedName}</code> |
| 220 |
- else |
| 221 |
h1= title |
| 222 |
block body |
| 223 |
|
| 224 |
| |
| 225 |
#quickindex.quickindex |
| 226 |
|
| 227 |
#copyright.smallprint |
| 228 |
| Copyright © 1999-#{year} by the <a href="#{root_dir}foundation_overview.html">D Language Foundation</a> | Page generated by <a href="https://github.com/rejectedsoftware/ddox">ddox</a>. |
| 229 |
|
| 230 |
script(type='text/javascript', src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js') |
| 231 |
| |
| 232 |
script(type='text/javascript'). |
| 233 |
window.jQuery || document.write('\x3Cscript src="#{root_dir}js/jquery-1.7.2.min.js">\x3C/script>') |
| 234 |
| |
| 235 |
script(type='text/javascript', src='#{root_dir}js/codemirror-compressed.js') |
| 236 |
| |
| 237 |
script(type='text/javascript', src='#{root_dir}js/run.js') |
| 238 |
script(type='text/javascript', src='#{root_dir}js/run_examples.js') |
| 239 |
script(type='text/javascript', src='#{root_dir}js/dlang.js') |
| 240 |
script(type='text/javascript', src='#{root_dir}js/listanchors.js') |
| 241 |
script(type="text/javascript", src="#{root_dir}js/ddox.js") |
| 242 |
script(type='text/javascript'). |
| 243 |
jQuery(document).ready(listanchors); |
| 244 |
setupDdox(); |