Add self links for headings. default tip
authorDirk Schulze <dschulze@adobe.com>
Thu, 22 May 2014 13:12:13 +0200
changeset 87 82a60b68a131
parent 86 13b058f3c042
Add self links for headings.
publish/processing.js
--- a/publish/processing.js	Fri Apr 11 05:46:58 2014 +1000
+++ b/publish/processing.js	Thu May 22 13:12:13 2014 +0200
@@ -272,6 +272,8 @@
                                    { number: conf.isSingleChapter ? '' : (conf.pages[page].formattedNumber + '.'),
                                      section: conf.pages[page].sections[id].number }),
                        n.firstChild);
+        n.setAttribute('class', 'heading');
+        n.appendChild(utils.parse('<a class="self-link" href="#' + id + '"></a>'));
       }
     }
   });