From ea246342b60123e6727063b75619da9a52e1708f Mon Sep 17 00:00:00 2001 From: Meik Hellmund Date: Mon, 26 Sep 2022 19:06:26 +0200 Subject: [PATCH] debug prints removed --- Notes.txt | 2 +- ansi2html.lua | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Notes.txt b/Notes.txt index f6fabc8..7f6399a 100644 --- a/Notes.txt +++ b/Notes.txt @@ -1,4 +1,4 @@ -pandoc -t native --ipynb-output=best 2_NumTypes.ipynb |jq +pandoc -t json --ipynb-output=best 2_NumTypes.ipynb |jq pandoc -t html --ipynb-output=all --lua-filter=ansi2html.lua -s --katex 2_NumTypes.ipynb > aaa.html diff --git a/ansi2html.lua b/ansi2html.lua index f7efe27..70b8c4c 100644 --- a/ansi2html.lua +++ b/ansi2html.lua @@ -264,9 +264,6 @@ local function codeBlockTrans(e) elseif FORMAT:match 'html' then converter = HTMLconverter fmt = 'html' - elseif FORMAT:match 'native' then - converter = HTMLconverter - fmt = 'html' else return end @@ -363,6 +360,7 @@ local function codeBlockTrans(e) end -- algo from https://github.com/jgm/pandoc/commit/77faccb505992c944cd1b92f50e4e00d2927682b +-- simulate --ipynb-outbut=best, but w/o removing ANSI colors -- consider only formats html and latex local function divTrans(e) local fmt @@ -370,8 +368,6 @@ local function divTrans(e) fmt = 'latex' elseif FORMAT:match 'html' then fmt = 'html' - elseif FORMAT:match 'native' then - fmt = 'html' else return end @@ -381,13 +377,10 @@ local function divTrans(e) end if e.classes[1] == "output" then - io.stderr:write("\noutput div entered\n") - local c = e.content -- enhanced pandoc.List table + local c = e.content local ranks = {} for i, el in pairs(c) do - io.stderr:write(i .. el.t) if el.t == "RawBlock" then - io.stderr:write(el.format) if el.format == fmt then table.insert(ranks, {rank = 1, el}) else