first commit

This commit is contained in:
Meik Hellmund 2022-09-21 13:26:09 +02:00
commit 6088fe9a22
3 changed files with 73 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
*.ipynb

33
Notes.txt Normal file
View File

@ -0,0 +1,33 @@
pandoc -t native --ipynb-output=best 2_NumTypes.ipynb |jq
quarto commit:
https://github.com/quarto-dev/quarto-cli/commit/2bd7b8719ecf8916f5754c0f3ac63ba5d7597c31
quarto discussion:
https://github.com/quarto-dev/quarto-cli/discussions/2488
pandoc discussion:
https://groups.google.com/g/pandoc-discuss/c/kFqvcZ1M8dw
nbconvert filter:
https://github.com/jupyter/nbconvert/blob/main/nbconvert/filters/ansi.py
ansi2html lib:
https://github.com/pycontribs/ansi2html/blob/main/ansi2html/converter.py
https://pandoc.org/lua-filters.html
pandoc commit ipynb-output-option
https://github.com/jgm/pandoc/commit/77faccb505992c944cd1b92f50e4e00d2927682b
pandoc commit remove ansi escapes
https://github.com/jgm/pandoc/commit/5454aad32474472a8f977c941e6f7d70e925bcc5
https://github.com/jgm/pandoc/issues/5633
A filter example:
https://github.com/jgm/pandoc/issues/6643
pandoc -t native --ipynb-output=all --lua-filter=ansi2html.lua 2_NumTypes.ipynb -o kkk
http://lua-users.org/wiki/AnsiTerminalColors

38
ansi2html.lua Normal file
View File

@ -0,0 +1,38 @@
local codes = {
-- attributes
reset = 0,
bright = 1,
dim = 2,
underscore = 4,
-- blink = 5,
reverse = 7,
-- hidden = 8,
-- foreground
black = 30,
red = 31,
green = 32,
yellow = 33,
blue = 34,
magenta = 35,
cyan = 36,
white = 37,
-- background
onblack = 40,
onred = 41,
ongreen = 42,
onyellow = 43,
onblue = 44,
onmagenta = 45,
oncyan = 46,
onwhite = 47,
}
function CodeBlock(e)
if string.find(e.text, "\u{001b}\u{005b}", 1, true) then
print(e.text)
end
end