Skip to content

Commit b769765

Browse files
committed
api docs: code indentation and formatting (next- entries plus nth-of-type-selector)
1 parent a5be400 commit b769765

File tree

3 files changed

+42
-34
lines changed

3 files changed

+42
-34
lines changed

entries/next-adjacent-Selector.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717
</longdesc>
1818
<example>
1919
<desc>Finds all inputs that are next to a label.</desc>
20-
<code><![CDATA[$("label + input").css("color", "blue").val("Labeled!")]]></code>
21-
<html><![CDATA[<form>
22-
20+
<code><![CDATA[
21+
$( "label + input" ).css( "color", "blue" ).val( "Labeled!" );
22+
]]></code>
23+
<html><![CDATA[
24+
<form>
2325
<label>Name:</label>
24-
<input name="name" />
26+
<input name="name">
2527
<fieldset>
2628
<label>Newsletter:</label>
27-
28-
<input name="newsletter" />
29+
<input name="newsletter">
2930
</fieldset>
3031
</form>
31-
<input name="none" />]]></html>
32+
<input name="none">
33+
]]></html>
3234
</example>
3335
<category slug="selectors/hierarchy-selectors"/>
3436
<category slug="version/1.0"/>
35-
</entry>
37+
</entry>

entries/next-siblings-selector.xml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,35 @@
1717
</longdesc>
1818
<example>
1919
<desc>Finds all divs that are siblings after the element with #prev as its id. Notice the span isn't selected since it is not a div and the "niece" isn't selected since it is a child of a sibling, not an actual sibling.</desc>
20-
<code><![CDATA[$("#prev ~ div").css("border", "3px groove blue");]]></code>
20+
<code><![CDATA[
21+
$( "#prev ~ div" ).css( "border", "3px groove blue" );
22+
]]></code>
2123
<css><![CDATA[
22-
23-
div,span {
24-
display:block;
25-
width:80px;
26-
height:80px;
27-
margin:5px;
28-
background:#bbffaa;
29-
float:left;
30-
font-size:14px;
24+
div, span {
25+
display: block;
26+
width: 80px;
27+
height: 80px;
28+
margin: 5px;
29+
background: #bfa;
30+
float: left;
31+
font-size: 14px;
3132
}
3233
div#small {
33-
width:60px;
34-
height:25px;
35-
font-size:12px;
36-
background:#fab;
34+
width: 60px;
35+
height: 25px;
36+
font-size: 12px;
37+
background: #fab;
3738
}
38-
]]></css>
39-
<html><![CDATA[<div>div (doesn't match since before #prev)</div>
40-
<span id="prev">span#prev</span>
41-
<div>div sibling</div>
42-
43-
<div>div sibling <div id="small">div niece</div></div>
44-
<span>span sibling (not div)</span>
45-
<div>div sibling</div>]]></html>
39+
]]></css>
40+
<html><![CDATA[
41+
<div>div (doesn't match since before #prev)</div>
42+
<span id="prev">span#prev</span>
43+
<div>div sibling</div>
44+
<div>div sibling <div id="small">div niece</div></div>
45+
<span>span sibling (not div)</span>
46+
<div>div sibling</div>
47+
]]></html>
4648
</example>
4749
<category slug="selectors/hierarchy-selectors"/>
4850
<category slug="version/1.0"/>
49-
</entry>
51+
</entry>

entries/nth-of-type-selector.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ $( "span:nth-of-type(2)" )
2121
.addClass( "nth" );
2222
]]></code>
2323
<css><![CDATA[
24-
.nth { color: red; }
24+
.nth {
25+
color: red;
26+
}
2527
]]></css>
26-
<html><![CDATA[<div>
28+
<html><![CDATA[
29+
<div>
2730
<span>John</span>,
2831
<b>Kim</b>,
2932
<span>Adam</span>,
@@ -39,7 +42,8 @@ $( "span:nth-of-type(2)" )
3942
<span>Richard</span>,
4043
<span>Ralph</span>,
4144
<span>Jason</span>
42-
</div>]]></html>
45+
</div>
46+
]]></html>
4347
</example>
4448
<category slug="selectors/child-filter-selectors"/>
4549
<category slug="version/1.9"/>

0 commit comments

Comments
 (0)