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

index f3a6358fdc40c754e822105736c92da6688e27a1..2e5726747ac9589f627a4348bf3ec24994292304 100755 (executable)
@@ -14,6 +14,6 @@ fi
 
 md |sed -nE '
   1i<ul class="macro toc">
-  s;^<(h[1-6]) id="([^"]*)">(([^<]|<[^aA]|<[aA][^ ])+)(<a class="anchor" href="[^>]*"></a>)?</h[1-6]>$;<li class="toc \1"><a href="#\2">\3</a></li>;p
+  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
   $i</ul>
 '