Skip to content

Commit e4f7af5

Browse files
committed
Add "since" to method info body
1 parent 29e03f2 commit e4f7af5

File tree

5 files changed

+138
-2
lines changed

5 files changed

+138
-2
lines changed

_data/menu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ Rounding:
9696
-
9797
name: 'truncate<span>(): Decimal</span>'
9898
path: '/#truncate'
99+
-
100+
name: 'trim<span>(): Decimal</span>'
101+
path: '/#trim'
99102
-
100103
name: 'round<span>($places, $mode): Decimal</span>'
101104
path: '/#round'

_data/methods.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ shift:
212212
desc: 'The number of places to shift the decimal point by. A positive shift moves the decimal point to the right, a negative shift moves the decimal point to the left.'
213213
trim:
214214
name: trim
215+
since: 1.1.0
215216
return:
216-
desc: 'A copy of this decimal without trailing zeroes.'
217+
desc: 'a copy of this decimal without trailing zeroes.'
217218
type: Decimal
218219
precision:
219220
name: precision

_includes/method.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<span class="method-info-return-lead">Returns:&nbsp;</span>
4141
<div class="method-info-indent">
4242
{% if include.method.return.hide != false %}
43-
<span class="method-info-return-type">{{ include.method.return.type }},&nbsp;</span>
43+
<span class="method-info-return-type">{{ include.method.return.type }},</span>
4444
{% endif %}
4545
<span class="method-info-return-text">{{ include.method.return.desc }}</span>
4646
</div>
@@ -62,5 +62,14 @@
6262
</div>
6363
</div>
6464
{%- endif -%}
65+
66+
{%- if include.method.since -%}
67+
<div class="method-info-since">
68+
<span class="method-info-since-lead">Since: </span>
69+
<div class="method-info-indent">
70+
<p class="method-info-since-text">{{ include.method.since }}</p>
71+
</div>
72+
</div>
73+
{%- endif -%}
6574
</div>
6675
</div>

_sass/_main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ main {
1111
}
1212

1313
@import "article";
14+
@import "method";
1415
}

_sass/_method.scss

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
2+
.method-info {
3+
background-color: white;
4+
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.1);
5+
padding: 0px;
6+
margin-bottom: 2em;
7+
margin-top: 2em;
8+
border-radius: 3px;
9+
10+
ul {
11+
margin: 0;
12+
padding: 0;
13+
margin-bottom: 10px;
14+
li {
15+
margin: 0;
16+
list-style: none;
17+
}
18+
}
19+
20+
.method-info-header {
21+
font-size: 0.9em;
22+
white-space: nowrap;
23+
text-overflow: ellipsis;
24+
overflow: hidden;
25+
background-color: $clr-grey-50;
26+
font-family: $font-mono !important;
27+
padding: 10px;
28+
border-top: 1px solid $clr-border;
29+
border-right: 1px solid $clr-border;
30+
box-shadow: 0px 1px 0 0 rgba(0, 0, 0, 0.1);
31+
border-radius: 3px;
32+
}
33+
34+
.method-info-body {
35+
padding: 20px;
36+
border-left: 1px solid $clr-border;
37+
38+
strong {
39+
font-weight: 600;
40+
color: $clr-php-black;
41+
}
42+
}
43+
44+
.method-info-name {
45+
font-family: $font-mono !important;
46+
color: $clr-php-black;
47+
font-size: 1em;
48+
padding-right: 2px;
49+
> strong {
50+
font-weight: 500;
51+
}
52+
}
53+
54+
.method-info-param-type {
55+
color: $clr-php-green;
56+
}
57+
58+
.method-info-param-name {
59+
color: $syntax-var;
60+
}
61+
62+
.method-info-param-default {
63+
color: #936;
64+
}
65+
66+
.method-info-punc {
67+
color: $syntax-punc;
68+
}
69+
70+
.method-info-return {
71+
.method-info-return-type {
72+
font-family: $font-mono !important;
73+
font-size: 0.9em;
74+
color: $clr-php-green;
75+
vertical-align: top;
76+
font-weight: 500;
77+
margin-right: 2px;
78+
}
79+
}
80+
81+
.method-info-indent {
82+
padding-left: 64px;
83+
}
84+
85+
.method-info-return-text,
86+
.method-info-since-text,
87+
.method-info-throws-text {
88+
max-width: 540px;
89+
display: inline-block;
90+
vertical-align: top;
91+
}
92+
93+
.method-info-return-lead,
94+
.method-info-since-lead,
95+
.method-info-throws-lead {
96+
float: left;
97+
font-weight: 500;
98+
color: $clr-php-blue;
99+
}
100+
101+
.method-info-since-text {
102+
font-family: $font-mono !important;
103+
font-size: 0.9em;
104+
}
105+
106+
.method-info-throws ul {
107+
padding: 0;
108+
margin: 0;
109+
}
110+
111+
.method-info-throws {
112+
margin-top: 1em;
113+
}
114+
115+
.method-info-body-desc {
116+
margin-bottom: 1em;
117+
}
118+
119+
.method-info-body-params {
120+
display: none;
121+
}
122+
}

0 commit comments

Comments
 (0)