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

index 2e5726747ac9589f627a4348bf3ec24994292304..537d924dc2b8c30a394cb763d3d1fd73dcdb75fd 100755 (executable)
@@ -14,6 +14,6 @@ fi
 
 md |sed -nE '
   1i<ul class="macro toc">
-  s;^<section class="(h[1-6])( [^"]+)?" id="([^"]*)">(([^<]|<[^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>
 '