]> granicus.if.org Git - clang/commitdiff
Documentation: AutomaticReferenceCounting.rst: use CSS section numbering.
authorDmitri Gribenko <gribozavr@gmail.com>
Sun, 16 Dec 2012 11:25:45 +0000 (11:25 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Sun, 16 Dec 2012 11:25:45 +0000 (11:25 +0000)
This enables us to use the same document structure as in other files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170283 91177308-0d34-0410-b5e6-96231b3b80d8

docs/AutomaticReferenceCounting.rst

index 7996d5c509e59ea3ce0269624f1bc5b87b761780..9babf8f321478274b5524fdae7fd7fa6e6e37b9e 100644 (file)
@@ -1,7 +1,3 @@
-.. sectnum::
-.. contents::
-   :local:
-
 .. FIXME: move to the stylesheet or Sphinx plugin
 
 .. raw:: html
     .arc-term { font-style: italic; font-weight: bold; }
     .revision { font-style: italic; }
     .when-revised { font-weight: bold; font-style: normal; }
+
+    /*
+     * Automatic numbering is described this article:
+     * http://dev.opera.com/articles/view/automatic-numbering-with-css-counters/
+     */
+    /*
+     * Automatic numbering for the TOC.
+     * This is wrong from the semantics point of view, since it is an ordered
+     * list, but uses "ul" tag.
+     */
+    div#contents.contents.local ul {
+      counter-reset: toc-section;
+      list-style-type: none;
+    }
+    div#contents.contents.local ul li {
+      counter-increment: toc-section;
+      background: none; // Remove bullets
+    }
+    div#contents.contents.local ul li a.reference:before {
+      content: counters(toc-section, ".") " ";
+    }
+
+    /* Automatic numbering for the body. */
+    body {
+      counter-reset: section subsection subsubsection;
+    }
+    .section h2 {
+      counter-reset: subsection subsubsection;
+      counter-increment: section;
+    }
+    .section h2 a.toc-backref:before {
+      content: counter(section) " ";
+    }
+    .section h3 {
+      counter-reset: subsubsection;
+      counter-increment: subsection;
+    }
+    .section h3 a.toc-backref:before {
+      content: counter(section) "." counter(subsection) " ";
+    }
+    .section h4 {
+      counter-increment: subsubsection;
+    }
+    .section h4 a.toc-backref:before {
+      content: counter(section) "." counter(subsection) "." counter(subsubsection) " ";
+    }
   </style>
 
 .. role:: arc-term
 .. role:: revision
 .. role:: when-revised
 
-.. title:: Objective-C Automatic Reference Counting (ARC)
+==============================================
+Objective-C Automatic Reference Counting (ARC)
+==============================================
+
+.. contents::
+   :local:
 
 .. _arc.meta: