Skip to content

Commit

Permalink
added contents section to functions page
Browse files Browse the repository at this point in the history
  • Loading branch information
JackStouffer committed Nov 25, 2015
1 parent c1da655 commit de02fa4
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 36 deletions.
2 changes: 1 addition & 1 deletion css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pre
font-size: 100%;
}

#search-box, #header, #navigation, #lastupdate, div#tools, #footernav, #copyright, #github-ribbon, div#top
#search-box, #header, #navigation, #lastupdate, div#tools, #footernav, #copyright, #github-ribbon, div#top, .page-contents
{
display: none;
}
Expand Down
44 changes: 42 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1335,16 +1335,56 @@ div#mobile-top, div#mobile-search, img#mobile-hamburger
display: none;
}

@media only screen and (max-width: 64em) { /* 1024px for default font-size 16 */
.page-contents
{
width: 300px;
padding-right: 10px;
border: solid black;
border-width: 2px 0;
font-size: 12px;
text-align: left;
margin: 0 0 2em 2em;
}

.page-contents-header
{
text-align: center;
}

.page-contents-header h3
{
display: inline;
color: #444;
font-weight: bold;
margin-top: 0;
}

div#content .page-contents li
{
line-height: 1.3;
padding-bottom: 0;
}

@media only screen and (min-width: 64em) { /* 1024px for default font-size 16 */
pre
{
overflow: auto;
}

.page-contents
{
float: right;
}
}

@media only screen and (max-width: 64em) { /* 1024px for default font-size 16 */
div#news{
display: none;
}

div#content{
margin-right: 1em !important;
}

}

@media only screen and (max-width: 50em) { /* 800px for default font-size 16 */
Expand Down
17 changes: 17 additions & 0 deletions js/dlang.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@
if (n)
$('#your-code-here-default > pre').replaceWith($examples[n-1]);
}

// Insert the show/hide button if the contents section exists
$('.page-contents-header').append('<span><a href="javascript:void(0);">[hide]</a></span>');

// Event to hide or show the "contents" section when the hide button
// is clicked
$(".page-contents-header a").click(function () {
var elem = $('.page-contents > ol');

if (elem.is(':visible')) {
$(this).text("[show]");
elem.hide();
} else {
$(this).text("[hide]");
elem.show();
}
});
});
})(jQuery);

Expand Down
81 changes: 48 additions & 33 deletions spec/function.dd
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,55 @@ Ddoc

$(SPEC_S Functions,

$(P
$(RELATIVE_LINK2 contracts, Contracts)
$(RELATIVE_LINK2 function-return-values, Function Return Values)
$(RELATIVE_LINK2 function-declarations, Functions Without Bodies)
$(RELATIVE_LINK2 pure-functions, Pure Functions)
$(RELATIVE_LINK2 nothrow-functions, Nothrow Functions)
$(RELATIVE_LINK2 ref-functions, Ref Functions)
$(RELATIVE_LINK2 auto-functions, Auto Functions)
$(RELATIVE_LINK2 auto-ref-functions, Auto Ref Functions)
$(RELATIVE_LINK2 inout-functions, Inout Functions)
$(RELATIVE_LINK2 optional-parenthesis, Optional Parentheses)
$(RELATIVE_LINK2 property-functions, Property Functions)
$(RELATIVE_LINK2 virtual-functions, Virtual Functions)
$(RELATIVE_LINK2 function-inheritance, Function Inheritance and Overriding)
$(RELATIVE_LINK2 inline-functions, Inline Functions)
$(RELATIVE_LINK2 function-overloading, Function Overloading)
$(RELATIVE_LINK2 overload-sets, Overload Sets)
$(RELATIVE_LINK2 parameters, Function Parameters)
$(RELATIVE_LINK2 function-default-args, Function Default Arguments)
$(RELATIVE_LINK2 variadic, Variadic Functions)
$(RELATIVE_LINK2 variadicnested, Nested Functions)
$(RELATIVE_LINK2 closures, Delegates, Function Pointers, and Closures)
$(RELATIVE_LINK2 anonymous, Anonymous Functions and Anonymous Delegates)
$(RELATIVE_LINK2 main, $(D main()) Function)
$(RELATIVE_LINK2 function-templates, Function Templates)
$(RELATIVE_LINK2 interpretation, Compile Time Function Execution (CTFE))
$(RELATIVE_LINK2 string-mixins, String Mixins and Compile Time Function Execution)
$(RELATIVE_LINK2 function-safety, Function Safety)
$(RELATIVE_LINK2 safe-functions, Safe Functions)
$(RELATIVE_LINK2 trusted-functions, Trusted Functions)
$(RELATIVE_LINK2 system-functions, System Functions)
$(RELATIVE_LINK2 function-attribute-inference, Function Attribute Inference)
$(RELATIVE_LINK2 pseudo-member, Uniform Function Call Syntax (UFCS))
$(NOT_EBOOK
$(DIVC page-contents quickindex,
$(DIVC page-contents-header,
$(H3 Contents)
)
$(OL
$(LI $(RELATIVE_LINK2 grammar, Grammar))
$(LI $(RELATIVE_LINK2 contracts, Contracts))
$(LI $(RELATIVE_LINK2 function-return-values, Function Return Values))
$(LI $(RELATIVE_LINK2 function-declarations, Functions Without Bodies))
$(LI $(RELATIVE_LINK2 pure-functions, Pure Functions))
$(LI $(RELATIVE_LINK2 nothrow-functions, Nothrow Functions))
$(LI $(RELATIVE_LINK2 ref-functions, Ref Functions))
$(LI $(RELATIVE_LINK2 auto-functions, Auto Functions))
$(LI $(RELATIVE_LINK2 auto-ref-functions, Auto Ref Functions))
$(LI $(RELATIVE_LINK2 inout-functions, Inout Functions))
$(LI $(RELATIVE_LINK2 optional-parenthesis, Optional Parentheses))
$(LI $(RELATIVE_LINK2 property-functions, Property Functions))
$(LI $(RELATIVE_LINK2 virtual-functions, Virtual Functions))
$(LI $(RELATIVE_LINK2 function-inheritance, Function Inheritance and Overriding))
$(LI $(RELATIVE_LINK2 inline-functions, Inline Functions))
$(LI $(RELATIVE_LINK2 function-overloading, Function Overloading)$(OL
$(LI $(RELATIVE_LINK2 overload-sets, Overload Sets))
))
$(LI $(RELATIVE_LINK2 parameters, Function Parameters)$(OL
$(LI $(RELATIVE_LINK2 function-default-args, Function Default Arguments))
$(LI $(RELATIVE_LINK2 variadic, Variadic Functions))
))
$(LI $(RELATIVE_LINK2 nested, Nested Functions)$(OL
$(LI $(RELATIVE_LINK2 closures, Delegates, Function Pointers, and Closures))
$(LI $(RELATIVE_LINK2 anonymous, Anonymous Functions and Anonymous Delegates))
))
$(LI $(RELATIVE_LINK2 main, main() Function))
$(LI $(RELATIVE_LINK2 function-templates, Function Templates))
$(LI $(RELATIVE_LINK2 interpretation, Compile Time Function Execution (CTFE))$(OL
$(LI $(RELATIVE_LINK2 string-mixins, String Mixins and Compile Time Function Execution))
))
$(LI $(RELATIVE_LINK2 function-safety, Function Safety)$(OL
$(LI $(RELATIVE_LINK2 safe-functions, Safe Functions))
$(LI $(RELATIVE_LINK2 trusted-functions, Trusted Functions))
$(LI $(RELATIVE_LINK2 system-functions, System Functions))
))
$(LI $(RELATIVE_LINK2 function-attribute-inference, Function Attribute Inference))
$(LI $(RELATIVE_LINK2 pseudo-member, Uniform Function Call Syntax (UFCS)))
)
)
)

$(H4 $(LNAME2 grammar, Grammar))

$(GRAMMAR
$(GNAME FuncDeclaration):
Expand Down

0 comments on commit de02fa4

Please sign in to comment.