Skip to content

Commit 0239d16

Browse files
committed
[css2] reformatted preformatted examples
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402519
1 parent e972118 commit 0239d16

1 file changed

Lines changed: 34 additions & 32 deletions

File tree

css2/generate.src

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -581,52 +581,54 @@ of the OL will refer to that counter.
581581

582582
<div class="html-example"> <p>If we denote by item[n] the
583583
n<sup>th</sup> instance of the "item"
584-
counter, and by "(" and ")" the beginning and end of a
584+
counter, and by "{" and "}" the beginning and end of a
585585
scope, then the following HTML fragment will use the indicated
586586
counters. (We assume the style sheet as given in the example above).
587587

588588
<pre>
589-
&lt;OL> &lt;!-- (set item[0] to 0 -->
590-
&lt;LI>item&lt;/LI> &lt;!-- increment item[0] (= 1) -->
591-
&lt;LI>item &lt;!-- increment item[0] (= 2) -->
592-
&lt;OL> &lt;!-- (set item[1] to 0 -->
593-
&lt;LI>item&lt;/LI> &lt;!-- increment item[1] (= 1) -->
594-
&lt;LI>item&lt;/LI> &lt;!-- increment item[1] (= 2) -->
595-
&lt;LI>item &lt;!-- increment item[1] (= 3) -->
596-
&lt;OL> &lt;!-- (set item[2] to 0 -->
597-
&lt;LI>item&lt;/LI> &lt;!-- increment item[2] (= 1) -->
598-
&lt;/OL> &lt;!-- -->
599-
&lt;OL> &lt;!-- )(set item[2] to 0 -->
600-
&lt;LI>item&lt;/LI> &lt;!-- increment item[2] (= 1) -->
601-
&lt;/OL> &lt;!-- -->
602-
&lt;/LI> &lt;!-- ) -->
603-
&lt;LI>item&lt;/LI> &lt;!-- increment item[1] (= 4) -->
604-
&lt;/OL> &lt;!-- -->
605-
&lt;/LI> &lt;!-- ) -->
606-
&lt;LI>item&lt;/LI> &lt;!-- increment item[0] (= 3) -->
607-
&lt;LI>item&lt;/LI> &lt;!-- increment item[0] (= 4) -->
608-
&lt;/OL> &lt;!-- -->
609-
&lt;OL> &lt;!-- )(reset item[0] to 0 -->
610-
&lt;LI>item&lt;/LI> &lt;!-- increment item[0] (= 1) -->
611-
&lt;LI>item&lt;/LI> &lt;!-- increment item[0] (= 2) -->
612-
&lt;/OL> &lt;!-- -->
589+
&lt;OL> &lt;!-- {item[0]=0 -->
590+
&lt;LI>item&lt;/LI> &lt;!-- item[0]++ (=1) -->
591+
&lt;LI>item &lt;!-- item[0]++ (=2) -->
592+
&lt;OL> &lt;!-- {item[1]=0 -->
593+
&lt;LI>item&lt;/LI> &lt;!-- item[1]++ (=1) -->
594+
&lt;LI>item&lt;/LI> &lt;!-- item[1]++ (=2) -->
595+
&lt;LI>item &lt;!-- item[1]++ (=3) -->
596+
&lt;OL> &lt;!-- {item[2]=0 -->
597+
&lt;LI>item&lt;/LI> &lt;!-- item[2]++ (=1) -->
598+
&lt;/OL> &lt;!-- -->
599+
&lt;OL> &lt;!-- }{item[2]=0 -->
600+
&lt;LI>item&lt;/LI> &lt;!-- item[2]++ (=1) -->
601+
&lt;/OL> &lt;!-- -->
602+
&lt;/LI> &lt;!-- } -->
603+
&lt;LI>item&lt;/LI> &lt;!-- item[1]++ (=4) -->
604+
&lt;/OL> &lt;!-- -->
605+
&lt;/LI> &lt;!-- } -->
606+
&lt;LI>item&lt;/LI> &lt;!-- item[0]++ (=3) -->
607+
&lt;LI>item&lt;/LI> &lt;!-- item[0]++ (=4) -->
608+
&lt;/OL> &lt;!-- -->
609+
&lt;OL> &lt;!-- }{item[0]=0 -->
610+
&lt;LI>item&lt;/LI> &lt;!-- item[0]++ (=1) -->
611+
&lt;LI>item&lt;/LI> &lt;!-- item[0]++ (=2) -->
612+
&lt;/OL> &lt;!-- -->
613613
</pre>
614614
</div>
615615

616616
<div class="example">
617617
<p>Another example, showing how scope works when counters are used on
618-
elements that are not tested, is the following. This shows how the
618+
elements that are not nested, is the following. This shows how the
619619
style rules given above to number chapters and sections would apply to
620620
the markup given.
621621

622622
<pre>
623-
&lt;body> &lt;!-- (set chapter to 0 | -->
624-
&lt;h1>About the CSS 2.1 Specification&lt;/h1> &lt;!-- increment chapter (=1) | (set section to 0 -->
625-
&lt;h2>CSS 2.1 vs CSS 2&lt;/h2> &lt;!-- | increment section (=1) -->
626-
&lt;h2>Reading the specification&lt;/h 2> &lt;!-- | increment section (=2) -->
627-
&lt;h1>Introduction to CSS 2.1&lt;/h1> &lt;!-- increment chapter (=2) | )(set section to 0 -->
628-
&lt;/body> &lt;!-- | ) -->
623+
&lt;!--"chapter" counter|"section" counter -->
624+
&lt;body> &lt;!-- {chapter=0 | -->
625+
&lt;h1>About CSS&lt;/h1> &lt;!-- chapter++ (=1) | {section=0 -->
626+
&lt;h2>CSS 2&lt;/h2> &lt;!-- | section++ (=1) -->
627+
&lt;h2>CSS 2.1&lt;/h2> &lt;!-- | section++ (=2) -->
628+
&lt;h1>Style&lt;/h1> &lt;!-- chapter++ (=2) |}{ section=0 -->
629+
&lt;/body> &lt;!-- | } -->
629630
</pre>
631+
630632
</div>
631633

632634
<p>The 'counters()' function generates a string composed of all of the

0 commit comments

Comments
 (0)