Skip to content

Commit 03cc134

Browse files
author
Matthew McCullough
committed
Merge pull request #76 from github/update-workbooks
Format advanced workbook with summary and details markers
2 parents c3b7878 + 300574d commit 03cc134

File tree

8 files changed

+723
-302
lines changed

8 files changed

+723
-302
lines changed

_layouts/bare.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<link rel="stylesheet" media="all" href=
1515
{% if page.theme == "home" %}
1616
"_stylesheets/page.css"
17-
{% else page.theme %}
17+
{% else %}
1818
"../_stylesheets/page.css"
1919
{% endif %}
2020
/>
@@ -36,7 +36,11 @@
3636
{% include analytics.html %}
3737

3838
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
39-
<script src="_javascript/page.js"></script>
39+
{% if page.theme == "home" %}
40+
<script src="_javascript/page.js"></script>
41+
{% else %}
42+
<script src="../_javascript/page.js"></script>
43+
{% endif %}
4044
</head>
4145
<body>
4246
{% if page.path != "index.html" %}

_layouts/workbook.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<!-- <span class="octicon octicon-book"></span> -->
99
<h1>{{ page.title }}</h1>
1010
{% include license.html %}
11+
12+
{% if page.description %}
13+
<br/>
14+
<div class="description">{{ page.description }}</div>
15+
{% endif %}
1116
</div>
1217
</section>
1318

_stylesheets/workbook.css

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,42 @@
33
/* Scopes wrapper */
44
.outline h2 + p, .outline h2 + p ~ p, .outline h2 + p ~ blockquote, .outline h2 + p ~ ul, .outline h2 + p ~ pre, .outline h2 + p ~ h3 {
55
display: none; }
6-
.outline h3 + p, .outline h3 + p ~ table {
6+
.outline h3 {
7+
display: none; }
8+
.outline h3 + *, .outline h3 > * {
9+
display: none; }
10+
.outline h4 {
11+
display: none; }
12+
.outline h4 + *, .outline h4 > * {
13+
display: none; }
14+
.outline pre {
15+
display: none; }
16+
.outline p {
17+
display: none; }
18+
.outline ul {
19+
display: none; }
20+
.outline table {
721
display: none; }
822

923
.summary h3 {
1024
display: none; }
11-
.summary h3 + * {
25+
.summary h4 {
26+
display: none; }
27+
.summary h4 + *, .summary h4 > * {
28+
display: none; }
29+
.summary h4 + p + ul {
1230
display: none; }
31+
.summary pre {
32+
display: none; }
33+
.summary p {
34+
display: none; }
35+
.summary table {
36+
display: none; }
1337

1438
.details h3 {
1539
display: none; }
40+
.details h4 {
41+
display: none; }
1642

1743
.hero {
1844
background: #1875c6;
@@ -29,22 +55,65 @@
2955
text-align: center;
3056
float: left; }
3157

32-
.booklink, .githublink {
33-
font: normal normal 32px octicons;
34-
display: inline-block;
35-
height: 1em;
36-
width: 1em;
37-
overflow: hidden;
38-
font-size: 16px;
39-
margin-left: 8px; }
58+
.booklink, .githublink, .weblink, .videolink {
59+
font: normal normal 1em octicons;
60+
text-decoration: none;
61+
color: #1875c6; }
62+
.booklink:hover, .githublink:hover, .weblink:hover, .videolink:hover {
63+
color: #00a5ea; }
4064

4165
.booklink:before {
4266
content: "\f007";
43-
line-height: 1; }
67+
margin-right: 5px; }
4468

4569
.githublink:before {
4670
content: "\f008";
47-
line-height: 1; }
71+
margin-right: 5px; }
72+
73+
.weblink:before {
74+
content: "\f0b6";
75+
margin-right: 5px; }
76+
77+
.videolink:before {
78+
content: "\f0b9";
79+
margin-right: 5px; }
80+
81+
h2 {
82+
padding-top: 15px; }
83+
84+
h2:before {
85+
padding: 5px;
86+
color: #CCCCCC;
87+
content: "\f078";
88+
font: normal normal 40px octicons; }
89+
90+
pre {
91+
padding-top: 10px;
92+
padding-bottom: 10px;
93+
margin-top: 10px;
94+
margin-bottom: 10px;
95+
margin-left: 25px;
96+
/* To ensure scrolling of long code lines */
97+
overflow: auto;
98+
word-wrap: normal;
99+
white-space: pre; }
100+
101+
pre:before {
102+
content: "\f0c8";
103+
font: normal normal 32px octicons;
104+
float: right;
105+
font-size: 50px;
106+
opacity: .4; }
107+
108+
ul {
109+
padding-top: 10px;
110+
padding-bottom: 10px;
111+
margin-left: 40px; }
112+
113+
p {
114+
text-indent: 5px;
115+
margin-left: 30px;
116+
margin-bottom: 20px; }
48117

49118
blockquote {
50119
width: 80%;

_stylesheets/workbook.scss

Lines changed: 122 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,76 @@
2020
}
2121
}
2222
h3{
23-
& + p,
24-
& + p ~ table
23+
display: none;
24+
25+
& + *,
26+
& > *
27+
{
28+
@include hidden;
29+
}
30+
}
31+
h4{
32+
display: none;
33+
34+
& + *,
35+
& > *
2536
{
2637
@include hidden;
2738
}
2839
}
40+
41+
pre{
42+
display: none;
43+
}
44+
p{
45+
display: none;
46+
}
47+
ul{
48+
display: none;
49+
}
50+
table{
51+
display: none;
52+
}
2953
}
3054

3155
.summary{
3256
h3{
33-
@include hidden;
57+
display: none;
58+
}
3459

35-
& + *
60+
h4{
61+
display: none;
62+
63+
& + *,
64+
& > *
3665
{
3766
@include hidden;
3867
}
68+
69+
& + p + ul
70+
{
71+
@include hidden;
72+
}
73+
}
74+
75+
pre{
76+
display: none;
77+
}
78+
p{
79+
display: none;
80+
}
81+
table{
82+
display: none;
3983
}
4084
}
4185

4286
.details{
4387
h3{
4488
display: none;
4589
}
90+
h4{
91+
display: none;
92+
}
4693
}
4794

4895
.hero{
@@ -63,30 +110,90 @@
63110
}
64111
}
65112

66-
.booklink, .githublink{ //a[href*="github.com"]
67-
font: normal normal 32px octicons;
68-
display: inline-block;
69-
height: 1em;
70-
width: 1em;
71-
overflow: hidden;
72-
font-size: 16px;
73-
margin-left: 8px;
113+
.booklink, .githublink, .weblink, .videolink {
114+
font: normal normal 1em octicons;
115+
text-decoration: none;
116+
color: $color-dark;
117+
118+
&:hover {
119+
color: $color-bright;
120+
}
74121
}
75122

76123
.booklink{
77124
&:before{
78125
content: "\f007";
79-
line-height: 1;
126+
margin-right: 5px;
80127
}
81128
}
82129

83-
.githublink{ //a[href*="github.com"],
130+
.githublink{
84131
&:before{
85132
content: "\f008";
86-
line-height: 1;
133+
margin-right: 5px;
134+
}
135+
}
136+
137+
.weblink{
138+
&:before{
139+
content: "\f0b6";
140+
margin-right: 5px;
141+
}
142+
}
143+
144+
.videolink{
145+
&:before{
146+
content: "\f0b9";
147+
margin-right: 5px;
87148
}
88149
}
89150

151+
152+
h2{
153+
padding-top: 15px;
154+
}
155+
h2:before{
156+
padding: 5px;
157+
color: #CCCCCC;
158+
content: "\f078";
159+
font: normal normal 40px octicons;
160+
}
161+
162+
pre{
163+
padding-top: 10px;
164+
padding-bottom: 10px;
165+
margin-top: 10px;
166+
margin-bottom: 10px;
167+
margin-left: 25px;
168+
169+
/* To ensure scrolling of long code lines */
170+
overflow: auto;
171+
word-wrap: normal;
172+
white-space: pre;
173+
}
174+
175+
pre:before {
176+
content: "\f0c8";
177+
font: normal normal 32px octicons;
178+
float: right;
179+
font-size: 50px;
180+
opacity: .4;
181+
}
182+
183+
ul{
184+
padding-top: 10px;
185+
padding-bottom: 10px;
186+
margin-left: 40px;
187+
}
188+
189+
p{
190+
text-indent: 5px;
191+
margin-left: 30px;
192+
margin-bottom: 20px;
193+
}
194+
195+
196+
90197
blockquote{
91198
width: 80%;
92199
line-height: 140%;

0 commit comments

Comments
 (0)