Un traducteur md -> html minimal en awk - retour accueil
git clone git://bebou.netlib.re/katdown
Log | Files | Refs | README |
commit 622a94f0e927a7087b6710c640ab6720bb6a1d48 parent 794b3be04ebbfbbc969ab39358a89dab69ea4a19 Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Mon, 3 Mar 2025 16:47:39 +0100 Retrait des blocs BEGIN et END Pas besoin de générer un document HTML complet pour nous Diffstat:
M | katdown | | | 15 | --------------- |
1 file changed, 0 insertions(+), 15 deletions(-)
diff --git a/katdown b/katdown @@ -3,16 +3,6 @@ # fork d'un script de Graham Marlow # https://mgmarlow.com/ -BEGIN { - print "<!doctype html><html>" - print "<head>" - print " <meta charset=\"utf-8\">" - print " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" - if (head) print head - print "</head>" - print "<body>" -} - /^# / { print "<h1>" substr($0, 3) "</h1>"; next } /^## / { print "<h2>" substr($0, 4) "</h2>"; next } /^### / { print "<h3>" substr($0, 5) "</h3>"; next } @@ -30,11 +20,6 @@ inquote && !/^> / { print "</blockquote>"; inquote = 0; next } /^$/ { flushp() } END { flushp(); flushtags() } -END { - print "</body>" - print "</html>" -} - function collect(v) { line = line sep v sep = " "