]> git.plutz.net Git - shellwiki/commitdiff
generate toc from new section wrappers
authorPaul Hänsch <paul@plutz.net>
Wed, 21 Jun 2023 18:18:39 +0000 (20:18 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 21 Jun 2023 18:18:39 +0000 (20:18 +0200)
macros/toc

index 537d924dc2b8c30a394cb763d3d1fd73dcdb75fd..0acec760330557044facb1629eecf99dee668b63 100755 (executable)
@@ -14,6 +14,6 @@ fi
 
 md |sed -nE '
   1i<ul class="macro toc">
-  s;^<section class="(h[1-6])( [^"]+)?" id="([^"]*)"><h[1-6]>(([^<]|<[^aA]|<[aA][^ ])+)(<a class="anchor" href="[^>]*"></a>)?</h[1-6]>$;<li class="toc \1"><a href="#\3">\4</a></li>;p
+  s;^.*<section class="(h[1-6])( [^"]+)?" id="([^"]*)"><h[1-6]>(([^<]|<[^aA]|<[aA][^ ])+)(<a class="anchor" href="[^>]*"></a>)?</h[1-6]>$;<li class="toc \1"><a href="#\3">\4</a></li>;p
   $i</ul>
 '