@seanmozeik/markdown-display 0.3.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +41 -20
  2. package/dist/abap-9xbv043v.js +2 -0
  3. package/dist/actionscript-3-ffr5ydrs.js +2 -0
  4. package/dist/ada-jk2gn0pn.js +2 -0
  5. package/dist/andromeeda-24gktw4d.js +2 -0
  6. package/dist/angular-html-xg28445y.js +2 -0
  7. package/dist/angular-ts-1xq6mw7g.js +2 -0
  8. package/dist/apache-4b3b0eyy.js +2 -0
  9. package/dist/apex-a3awgdsm.js +2 -0
  10. package/dist/apl-f630k1vx.js +2 -0
  11. package/dist/applescript-qreypzb3.js +2 -0
  12. package/dist/ara-a0ghw0xy.js +2 -0
  13. package/dist/asciidoc-17amrzcg.js +2 -0
  14. package/dist/asm-1ybpdpc6.js +2 -0
  15. package/dist/astro-2vzy1qg5.js +2 -0
  16. package/dist/aurora-x-pb2h8m75.js +2 -0
  17. package/dist/awk-4g14sdfr.js +2 -0
  18. package/dist/ayu-dark-a6e49das.js +2 -0
  19. package/dist/ayu-light-ac787hyf.js +2 -0
  20. package/dist/ayu-mirage-zjtmb0bg.js +2 -0
  21. package/dist/ballerina-fd1yzyy8.js +2 -0
  22. package/dist/banner-ng06wc8g.js +12 -0
  23. package/dist/bat-x024z34k.js +2 -0
  24. package/dist/beancount-4aa1ce0k.js +2 -0
  25. package/dist/berry-1157ed3y.js +2 -0
  26. package/dist/bibtex-s0jadepe.js +2 -0
  27. package/dist/bicep-gx08m1nz.js +2 -0
  28. package/dist/bird2-3g0vanh0.js +2 -0
  29. package/dist/blade-22gzdntq.js +2 -0
  30. package/dist/bsl-r8cmv6pz.js +2 -0
  31. package/dist/c-g33d1744.js +2 -0
  32. package/dist/c3-02s6n09a.js +2 -0
  33. package/dist/cadence-b5x3mzqg.js +2 -0
  34. package/dist/cairo-4v5k49bw.js +2 -0
  35. package/dist/catppuccin-frappe-zze8rp4c.js +2 -0
  36. package/dist/catppuccin-latte-ebmyxk6e.js +2 -0
  37. package/dist/catppuccin-macchiato-8m9avkeq.js +2 -0
  38. package/dist/catppuccin-mocha-caq0gmr7.js +2 -0
  39. package/dist/clarity-x08cc58e.js +2 -0
  40. package/dist/cli-0y1zeg7v.js +3 -0
  41. package/dist/cli-1hj5h9f9.js +3 -0
  42. package/dist/cli-2h1yfjdw.js +3 -0
  43. package/dist/cli-30n24kzz.js +3 -0
  44. package/dist/cli-3fzyv189.js +3 -0
  45. package/dist/cli-3wvgjq8z.js +3 -0
  46. package/dist/cli-3z230jhh.js +3 -0
  47. package/dist/cli-48yac15g.js +3 -0
  48. package/dist/cli-58p99hkc.js +3 -0
  49. package/dist/cli-5jp9npt1.js +3 -0
  50. package/dist/cli-5v8q61ce.js +3 -0
  51. package/dist/cli-6jzqb50s.js +3 -0
  52. package/dist/cli-79y9hz07.js +3 -0
  53. package/dist/cli-81dmk4ts.js +3 -0
  54. package/dist/cli-81w52zkt.js +3 -0
  55. package/dist/cli-8nneg522.js +3 -0
  56. package/dist/cli-8qe0pqv6.js +3 -0
  57. package/dist/cli-a8250sbe.js +3 -0
  58. package/dist/cli-ac5hc1dt.js +3 -0
  59. package/dist/cli-app-kzae9fnq.js +411 -0
  60. package/dist/cli-ayvxq7qa.js +3 -0
  61. package/dist/cli-banpa4vr.js +7 -0
  62. package/dist/cli-bt5bw9b4.js +3 -0
  63. package/dist/cli-c0mb9wq6.js +3 -0
  64. package/dist/cli-dg73jpjs.js +3 -0
  65. package/dist/cli-e21h859y.js +3 -0
  66. package/dist/cli-g0wwxff6.js +3 -0
  67. package/dist/cli-gtjpq1mb.js +3 -0
  68. package/dist/cli-ha8pqpt8.js +3 -0
  69. package/dist/cli-hsvv3jzh.js +3 -0
  70. package/dist/cli-hxsnf2x8.js +3 -0
  71. package/dist/cli-jewjtf3e.js +3 -0
  72. package/dist/cli-jkvh6m6e.js +3 -0
  73. package/dist/cli-jqdxtesj.js +3 -0
  74. package/dist/cli-k2dtsfh9.js +3 -0
  75. package/dist/cli-m8zynty7.js +3 -0
  76. package/dist/cli-n5czz7gz.js +3 -0
  77. package/dist/cli-r2h3ee8w.js +3 -0
  78. package/dist/cli-rkqs0vcv.js +3 -0
  79. package/dist/cli-ss2qwkcc.js +3 -0
  80. package/dist/cli-tse5g5yz.js +3 -0
  81. package/dist/cli-v04mbmxe.js +3 -0
  82. package/dist/cli-v37wd532.js +3 -0
  83. package/dist/cli-vbncttvd.js +3 -0
  84. package/dist/cli-vt93z537.js +3 -0
  85. package/dist/cli-w37ddf7r.js +3 -0
  86. package/dist/cli-yjt0k8jp.js +3 -0
  87. package/dist/cli-yxfvsvk9.js +3 -0
  88. package/dist/clojure-vzmv55wf.js +2 -0
  89. package/dist/cmake-7y22bc67.js +2 -0
  90. package/dist/cobol-kdnhdmjz.js +2 -0
  91. package/dist/codeowners-x6m7bhdc.js +2 -0
  92. package/dist/codeql-6rz9fzqw.js +2 -0
  93. package/dist/coffee-hdfzr8ps.js +2 -0
  94. package/dist/common-lisp-zmr06g7n.js +2 -0
  95. package/dist/coq-r8j5c36h.js +2 -0
  96. package/dist/cpp-cnh8n6p9.js +2 -0
  97. package/dist/crystal-mrgdvpq4.js +2 -0
  98. package/dist/csharp-q48m96qr.js +2 -0
  99. package/dist/css-bd0hqx8d.js +2 -0
  100. package/dist/csv-4m85ky3s.js +2 -0
  101. package/dist/cue-tkch0b5s.js +2 -0
  102. package/dist/cypher-9v66whj2.js +2 -0
  103. package/dist/d-h7frep7v.js +2 -0
  104. package/dist/dark-plus-3mz49csr.js +2 -0
  105. package/dist/dart-0ts3fbr7.js +2 -0
  106. package/dist/dax-epx6f5sr.js +2 -0
  107. package/dist/desktop-ga56hzcd.js +2 -0
  108. package/dist/diff-nj0camxe.js +2 -0
  109. package/dist/docker-ck9z05s1.js +2 -0
  110. package/dist/dotenv-n24rx33c.js +2 -0
  111. package/dist/dracula-rt7zm8kp.js +2 -0
  112. package/dist/dracula-soft-ny1w766n.js +2 -0
  113. package/dist/dream-maker-5bdhk1xw.js +2 -0
  114. package/dist/edge-nes62z5q.js +2 -0
  115. package/dist/elixir-t2dacwg4.js +2 -0
  116. package/dist/elm-efkwc9kb.js +2 -0
  117. package/dist/emacs-lisp-aeyrqndc.js +2 -0
  118. package/dist/erb-1jnjam5w.js +2 -0
  119. package/dist/erlang-q2nxsk7t.js +2 -0
  120. package/dist/everforest-dark-q5afr5gg.js +2 -0
  121. package/dist/everforest-light-gwf12vcx.js +2 -0
  122. package/dist/fennel-qcrnckrq.js +2 -0
  123. package/dist/fish-fybdeyvp.js +2 -0
  124. package/dist/fluent-71z72985.js +2 -0
  125. package/dist/fortran-fixed-form-1gqb01bw.js +2 -0
  126. package/dist/fortran-free-form-kxkmegqs.js +2 -0
  127. package/dist/fsharp-cgvxcgsx.js +2 -0
  128. package/dist/gdresource-46k5gmzt.js +2 -0
  129. package/dist/gdscript-68kq1xvg.js +2 -0
  130. package/dist/gdshader-b3674jka.js +2 -0
  131. package/dist/genie-jyymh6js.js +2 -0
  132. package/dist/gherkin-7e2sjv5d.js +2 -0
  133. package/dist/git-commit-9wk0r5sb.js +2 -0
  134. package/dist/git-rebase-prhzk4j5.js +2 -0
  135. package/dist/github-dark-default-0vxh5df6.js +2 -0
  136. package/dist/github-dark-dimmed-mrkg0dkj.js +2 -0
  137. package/dist/github-dark-high-contrast-dfjvzvs1.js +2 -0
  138. package/dist/github-dark-vmmv282e.js +2 -0
  139. package/dist/github-light-79sz9hnx.js +2 -0
  140. package/dist/github-light-default-1jr038w7.js +2 -0
  141. package/dist/github-light-high-contrast-r2s26c8v.js +2 -0
  142. package/dist/gleam-0915n1m3.js +2 -0
  143. package/dist/glimmer-js-k7czmdfm.js +2 -0
  144. package/dist/glimmer-ts-194ejtg4.js +2 -0
  145. package/dist/glsl-dj78d5j4.js +2 -0
  146. package/dist/gn-1hvwh71v.js +2 -0
  147. package/dist/gnuplot-3hmy4dt7.js +2 -0
  148. package/dist/go-33wfsnyk.js +2 -0
  149. package/dist/graphql-0aac9yec.js +2 -0
  150. package/dist/groovy-ja0xcaxz.js +2 -0
  151. package/dist/gruvbox-dark-hard-5s80mtba.js +2 -0
  152. package/dist/gruvbox-dark-medium-n4khhzte.js +2 -0
  153. package/dist/gruvbox-dark-soft-e71n00ep.js +2 -0
  154. package/dist/gruvbox-light-hard-pbvye0e8.js +2 -0
  155. package/dist/gruvbox-light-medium-ta1n6jez.js +2 -0
  156. package/dist/gruvbox-light-soft-ymh9etvc.js +2 -0
  157. package/dist/hack-wbm9q4mm.js +2 -0
  158. package/dist/haml-gx26k3n5.js +2 -0
  159. package/dist/handlebars-x15bnv4j.js +2 -0
  160. package/dist/haskell-gphr2mx4.js +2 -0
  161. package/dist/haxe-jjqygeb7.js +2 -0
  162. package/dist/hcl-cr0bx0fz.js +2 -0
  163. package/dist/hjson-f1xxjn7x.js +2 -0
  164. package/dist/hlsl-dx0egzxe.js +2 -0
  165. package/dist/horizon-bright-4xdqr7cd.js +2 -0
  166. package/dist/horizon-ztsnzjdn.js +2 -0
  167. package/dist/houston-61g9eh8r.js +2 -0
  168. package/dist/html-derivative-hvxv75a7.js +2 -0
  169. package/dist/html-wqddzypw.js +2 -0
  170. package/dist/http-kh76rh1s.js +2 -0
  171. package/dist/hurl-4c8qps7w.js +2 -0
  172. package/dist/hxml-3bkn4jp8.js +2 -0
  173. package/dist/hy-fxpg7aaw.js +2 -0
  174. package/dist/imba-q8na79n7.js +2 -0
  175. package/dist/index-pdw64t43.js +15 -0
  176. package/dist/ini-s6y2n2r0.js +2 -0
  177. package/dist/java-bcf5924q.js +2 -0
  178. package/dist/javascript-qmy7d5mk.js +2 -0
  179. package/dist/jinja-y1162pxj.js +2 -0
  180. package/dist/jison-444dx63z.js +2 -0
  181. package/dist/json-gwwdj89t.js +2 -0
  182. package/dist/json5-3100ynmc.js +2 -0
  183. package/dist/jsonc-v2rnz0h1.js +2 -0
  184. package/dist/jsonl-axvqz7sn.js +2 -0
  185. package/dist/jsonnet-zfn0ptb5.js +2 -0
  186. package/dist/jssm-gej4xq4j.js +2 -0
  187. package/dist/jsx-zc0j90dq.js +2 -0
  188. package/dist/julia-as91r849.js +2 -0
  189. package/dist/just-zmsqbkqy.js +2 -0
  190. package/dist/kanagawa-dragon-d76szdr9.js +2 -0
  191. package/dist/kanagawa-lotus-wd9eezwr.js +2 -0
  192. package/dist/kanagawa-wave-acc5532t.js +2 -0
  193. package/dist/kdl-0nd9fhgr.js +2 -0
  194. package/dist/kotlin-v71xk1rn.js +2 -0
  195. package/dist/kusto-9mpsj4vk.js +2 -0
  196. package/dist/laserwave-db8954kv.js +2 -0
  197. package/dist/latex-xs0c2nvw.js +2 -0
  198. package/dist/lean-vdhz6cqv.js +2 -0
  199. package/dist/less-312pw0ev.js +2 -0
  200. package/dist/light-plus-aq99ra4y.js +2 -0
  201. package/dist/liquid-dmnzg3ty.js +2 -0
  202. package/dist/llvm-t6bzgxkv.js +2 -0
  203. package/dist/log-ssjyybt8.js +2 -0
  204. package/dist/logo-qb8mz41r.js +2 -0
  205. package/dist/lua-kk3ewrfz.js +2 -0
  206. package/dist/luau-1332gd7k.js +2 -0
  207. package/dist/make-ym3y5he3.js +2 -0
  208. package/dist/markdown-yakp348x.js +2 -0
  209. package/dist/marko-t2xabqrz.js +2 -0
  210. package/dist/material-theme-darker-vyfbvm1v.js +2 -0
  211. package/dist/material-theme-e94sgaj2.js +2 -0
  212. package/dist/material-theme-lighter-12stms50.js +2 -0
  213. package/dist/material-theme-ocean-vbjhpav2.js +2 -0
  214. package/dist/material-theme-palenight-zvsby2j7.js +2 -0
  215. package/dist/matlab-7z9bsz8e.js +2 -0
  216. package/dist/md.js +4 -0
  217. package/dist/mdc-fnzmnxrv.js +2 -0
  218. package/dist/mdx-txks2jee.js +2 -0
  219. package/dist/mermaid-2geg9v5h.js +2 -0
  220. package/dist/min-dark-p6btg8dq.js +2 -0
  221. package/dist/min-light-v3br1wzp.js +2 -0
  222. package/dist/mipsasm-npsfhz7p.js +2 -0
  223. package/dist/mojo-53s8q8kz.js +2 -0
  224. package/dist/monokai-j1kkm1ja.js +2 -0
  225. package/dist/moonbit-gcr903w0.js +2 -0
  226. package/dist/move-4vm43y7r.js +2 -0
  227. package/dist/narrat-4dfafp1n.js +2 -0
  228. package/dist/nextflow-gen0wthn.js +2 -0
  229. package/dist/nextflow-groovy-rntv4ct1.js +2 -0
  230. package/dist/nginx-md97v71f.js +2 -0
  231. package/dist/night-owl-bgdmn1df.js +2 -0
  232. package/dist/night-owl-light-jka34m0q.js +2 -0
  233. package/dist/nim-fngvzh2t.js +2 -0
  234. package/dist/nix-x4emth0n.js +2 -0
  235. package/dist/nord-xscwecj8.js +2 -0
  236. package/dist/nushell-tjxswzet.js +2 -0
  237. package/dist/objective-c-nk9a9yrs.js +2 -0
  238. package/dist/objective-cpp-p6sapemd.js +2 -0
  239. package/dist/ocaml-bcy7sgka.js +2 -0
  240. package/dist/odin-5vrv5d1s.js +2 -0
  241. package/dist/one-dark-pro-r96tb03e.js +2 -0
  242. package/dist/one-light-bfcdemmg.js +2 -0
  243. package/dist/openscad-w36wsg83.js +2 -0
  244. package/dist/pascal-zje13224.js +2 -0
  245. package/dist/perl-jb96y2dw.js +2 -0
  246. package/dist/php-66y7zdam.js +2 -0
  247. package/dist/pkl-j08f73a2.js +2 -0
  248. package/dist/plastic-d95k0yjm.js +2 -0
  249. package/dist/plsql-a5tqv6r5.js +2 -0
  250. package/dist/po-z4zztbvf.js +2 -0
  251. package/dist/poimandres-ft3p00vk.js +2 -0
  252. package/dist/polar-45ka4fdw.js +2 -0
  253. package/dist/postcss-ak75ftnf.js +2 -0
  254. package/dist/powerquery-j6z2e9xw.js +2 -0
  255. package/dist/powershell-ca63wk2e.js +2 -0
  256. package/dist/prisma-b2y4avdt.js +2 -0
  257. package/dist/prolog-wktkj1zv.js +2 -0
  258. package/dist/proto-5pd1z1zv.js +2 -0
  259. package/dist/pug-80k5jz6p.js +2 -0
  260. package/dist/puppet-66683nhq.js +2 -0
  261. package/dist/purescript-cmqqet79.js +2 -0
  262. package/dist/python-jabyzx3d.js +2 -0
  263. package/dist/qml-d92cbtkt.js +2 -0
  264. package/dist/qmldir-za85z5zc.js +2 -0
  265. package/dist/qss-gh7cf1zk.js +2 -0
  266. package/dist/r-s39xqqt9.js +2 -0
  267. package/dist/racket-gbjk3es0.js +2 -0
  268. package/dist/raku-zqwbnxmq.js +2 -0
  269. package/dist/razor-zg3bck80.js +2 -0
  270. package/dist/red-k6970d1d.js +2 -0
  271. package/dist/reg-gserh519.js +2 -0
  272. package/dist/regexp-a95pq17y.js +2 -0
  273. package/dist/rel-gaefrfhc.js +2 -0
  274. package/dist/riscv-cszphkwv.js +2 -0
  275. package/dist/ron-yf5x21c5.js +2 -0
  276. package/dist/rose-pine-1zbcjg1b.js +2 -0
  277. package/dist/rose-pine-dawn-tmsqdesr.js +2 -0
  278. package/dist/rose-pine-moon-cmwgg41b.js +2 -0
  279. package/dist/rosmsg-8j5zf8wv.js +2 -0
  280. package/dist/rst-7trgmfaq.js +2 -0
  281. package/dist/ruby-2svq4615.js +2 -0
  282. package/dist/rust-q5spk848.js +2 -0
  283. package/dist/sas-qhcyyrbt.js +2 -0
  284. package/dist/sass-qwyex0n3.js +2 -0
  285. package/dist/scala-jmhd870s.js +2 -0
  286. package/dist/scheme-5dvkrg0d.js +2 -0
  287. package/dist/scss-7v9m0m7d.js +2 -0
  288. package/dist/sdbl-93kewz9d.js +2 -0
  289. package/dist/shaderlab-97e0480d.js +2 -0
  290. package/dist/shellscript-6mxk36va.js +2 -0
  291. package/dist/shellsession-c7mva2xt.js +2 -0
  292. package/dist/slack-dark-y62znhvd.js +2 -0
  293. package/dist/slack-ochin-esm65n7t.js +2 -0
  294. package/dist/smalltalk-fkw0jz97.js +2 -0
  295. package/dist/snazzy-light-gdz5rv1k.js +2 -0
  296. package/dist/solarized-dark-zgcy8wm4.js +2 -0
  297. package/dist/solarized-light-66pg8xzk.js +2 -0
  298. package/dist/solidity-q5d4ht8n.js +2 -0
  299. package/dist/soy-hhhx5cj0.js +2 -0
  300. package/dist/sparql-hm2pqpge.js +2 -0
  301. package/dist/splunk-w5h843nw.js +2 -0
  302. package/dist/sql-pas3x5ke.js +2 -0
  303. package/dist/ssh-config-n2kt2cym.js +2 -0
  304. package/dist/stata-9j4p5d8c.js +2 -0
  305. package/dist/stylus-9s01c3kp.js +2 -0
  306. package/dist/surrealql-gxntasn8.js +2 -0
  307. package/dist/svelte-nvgnrg0t.js +2 -0
  308. package/dist/swift-j07yna4k.js +2 -0
  309. package/dist/synthwave-84-d7yw2bf0.js +2 -0
  310. package/dist/system-verilog-30bs377q.js +2 -0
  311. package/dist/systemd-4252hbv8.js +2 -0
  312. package/dist/talonscript-qbxwesm0.js +2 -0
  313. package/dist/tasl-m18yj07w.js +2 -0
  314. package/dist/tcl-qfvbg90f.js +2 -0
  315. package/dist/templ-msv3jzfx.js +2 -0
  316. package/dist/terraform-w6q6kyy0.js +2 -0
  317. package/dist/tex-1h8385qh.js +2 -0
  318. package/dist/tokyo-night-11kv01fx.js +2 -0
  319. package/dist/toml-02rkjp4b.js +2 -0
  320. package/dist/ts-tags-zmwja4z5.js +2 -0
  321. package/dist/tsv-t7svepav.js +2 -0
  322. package/dist/tsx-5ck84m8p.js +2 -0
  323. package/dist/turtle-synzazfp.js +2 -0
  324. package/dist/twig-41166c5j.js +2 -0
  325. package/dist/typescript-cqey3bjn.js +2 -0
  326. package/dist/typespec-ddd8ynv9.js +2 -0
  327. package/dist/typst-ex558216.js +2 -0
  328. package/dist/v-1bn5h0en.js +2 -0
  329. package/dist/vala-078a3s0x.js +2 -0
  330. package/dist/vb-5sq26hr3.js +2 -0
  331. package/dist/verilog-ekh48e1e.js +2 -0
  332. package/dist/vesper-j18bqpbg.js +2 -0
  333. package/dist/vhdl-fhjza3xz.js +2 -0
  334. package/dist/viml-9jfzgmge.js +2 -0
  335. package/dist/vitesse-black-3b8qwvte.js +2 -0
  336. package/dist/vitesse-dark-bsvtvg1h.js +2 -0
  337. package/dist/vitesse-light-egp8j39z.js +2 -0
  338. package/dist/vue-6yd2mg34.js +2 -0
  339. package/dist/vue-html-y5mtwexa.js +2 -0
  340. package/dist/vue-vine-732a4732.js +2 -0
  341. package/dist/vyper-h4fr87vt.js +2 -0
  342. package/dist/wasm-c0hbsbpk.js +2 -0
  343. package/dist/wasm-xe5dxyky.js +2 -0
  344. package/dist/wenyan-pf79c6ns.js +2 -0
  345. package/dist/wgsl-20v05k5y.js +2 -0
  346. package/dist/wikitext-6vf691aw.js +2 -0
  347. package/dist/wit-gp0gbqxw.js +2 -0
  348. package/dist/wolfram-y1r4y7zp.js +2 -0
  349. package/dist/xml-9fqvyqnc.js +2 -0
  350. package/dist/xsl-xpzpqrmc.js +2 -0
  351. package/dist/yaml-885sffq4.js +2 -0
  352. package/dist/zenscript-0k3ar154.js +2 -0
  353. package/dist/zig-h5gys7p5.js +2 -0
  354. package/package.json +51 -23
  355. package/src/app/cli-info.ts +90 -0
  356. package/src/app/errors.ts +19 -0
  357. package/src/app/file-not-found-error.ts +6 -0
  358. package/src/app/format-error.ts +35 -0
  359. package/src/app/invalid-theme-error.ts +6 -0
  360. package/src/app/pager-error.ts +5 -0
  361. package/src/app/run-md.ts +197 -0
  362. package/src/app/stdin-read-error.ts +5 -0
  363. package/src/cli/options.ts +20 -0
  364. package/src/cli-app.ts +113 -0
  365. package/src/cli.ts +64 -0
  366. package/src/config/errors.ts +6 -0
  367. package/src/config/index.ts +183 -0
  368. package/src/config/read-error.ts +6 -0
  369. package/src/constants.ts +2 -0
  370. package/src/index.ts +51 -0
  371. package/src/lib/ansi.ts +24 -0
  372. package/src/lib/config.ts +2 -0
  373. package/src/lib/default-config.toml +25 -0
  374. package/src/lib/elements/blockquote.ts +34 -0
  375. package/src/lib/elements/code.ts +326 -0
  376. package/src/lib/elements/heading.ts +39 -0
  377. package/src/lib/elements/link.ts +33 -0
  378. package/src/lib/elements/list.ts +89 -0
  379. package/src/lib/elements/table.ts +65 -0
  380. package/src/lib/elements/text.ts +237 -0
  381. package/src/lib/languages.ts +123 -0
  382. package/src/lib/layout.ts +67 -0
  383. package/src/lib/pager.ts +121 -0
  384. package/src/lib/parser.ts +299 -0
  385. package/src/lib/render-code-blocks.ts +25 -0
  386. package/src/lib/render.ts +37 -0
  387. package/src/lib/shiki.ts +197 -0
  388. package/src/lib/width.ts +21 -0
  389. package/src/paths.ts +14 -0
  390. package/src/types/hyphen.d.ts +3 -0
  391. package/src/ui/banner.ts +23 -0
  392. package/src/ui/picker.ts +120 -0
  393. package/src/ui/themes/ansi.ts +161 -0
  394. package/src/ui/themes/color-support.ts +106 -0
  395. package/src/ui/themes/generated.ts +748 -0
  396. package/src/ui/themes/index.ts +58 -0
  397. package/src/ui/themes/overrides.ts +83 -0
  398. package/src/ui/themes/semantic.ts +125 -0
  399. package/src/ui/themes/types.ts +67 -0
  400. package/dist/index.js +0 -194
@@ -0,0 +1,326 @@
1
+ // Src/lib/elements/code.ts
2
+ import boxen from 'boxen';
3
+ import { Effect } from 'effect';
4
+
5
+ import { theme } from '../../ui/themes';
6
+ import {
7
+ getBoxTitleStyle,
8
+ getHexColors,
9
+ getInlineCodeStyle,
10
+ getMutedColor,
11
+ getSubtleColor,
12
+ } from '../../ui/themes/semantic';
13
+ import { visibleLength } from '../ansi';
14
+ import { getLanguageLabel, normalizeLang, supportsNerdFonts } from '../languages';
15
+ import { highlightCode } from '../shiki';
16
+
17
+ interface CodeConfig {
18
+ width: number;
19
+ wrap: boolean;
20
+ continuation: string;
21
+ theme: string;
22
+ useNerdFonts?: boolean;
23
+ }
24
+
25
+ const KIBIBYTE = 1024;
26
+ const CODE_BLOCK_HIGHLIGHT_KIB = 16;
27
+
28
+ /** Skip Shiki for very long blocks (bat / claudewatch pattern). */
29
+ const MAX_CODE_BLOCK_HIGHLIGHT_LENGTH = CODE_BLOCK_HIGHLIGHT_KIB * KIBIBYTE;
30
+
31
+ const ESC = '\u001B';
32
+ const ANSI_RESET = `${ESC}[0m`;
33
+ const ANSI_SGR_PATTERN = new RegExp(`${ESC}\\[([0-9;]*)m`, 'u');
34
+ const ANSI_SEQUENCE_PATTERN = new RegExp(`${ESC}\\[[0-9;]*m`, 'gu');
35
+
36
+ const SGR_RESET = 0;
37
+ const SGR_STYLE_MIN = 1;
38
+ const SGR_STYLE_MAX = 9;
39
+ const SGR_STYLE_OFF_BASE = 20;
40
+ const SGR_FG_EXTENDED = 38;
41
+ const SGR_BG_EXTENDED = 48;
42
+ const SGR_FG_DEFAULT = 39;
43
+ const SGR_BG_DEFAULT = 49;
44
+ const SGR_FG_BASIC_MIN = 30;
45
+ const SGR_FG_BASIC_MAX = 37;
46
+ const SGR_FG_BRIGHT_MIN = 90;
47
+ const SGR_FG_BRIGHT_MAX = 97;
48
+ const SGR_BG_BASIC_MIN = 40;
49
+ const SGR_BG_BASIC_MAX = 47;
50
+ const SGR_BG_BRIGHT_MIN = 100;
51
+ const SGR_BG_BRIGHT_MAX = 107;
52
+ const SGR_MODE_256 = '5';
53
+ const SGR_MODE_RGB = '2';
54
+ const RGB_PARAM_COUNT = 4;
55
+ const BOX_HORIZONTAL_PADDING = 4;
56
+
57
+ /**
58
+ * Track active ANSI styles. Handles basic SGR codes:
59
+ * 0 = reset, 1 = bold, 2 = dim, 3 = italic, 4 = underline,
60
+ * 30-37/90-97 = fg color, 38;5;N = 256 fg, 38;2;R;G;B = RGB fg,
61
+ * 40-47/100-107 = bg color, 48;5;N = 256 bg, 48;2;R;G;B = RGB bg
62
+ */
63
+ class AnsiState {
64
+ private styles = new Set<string>();
65
+ private fgColor: string | null = null;
66
+ private bgColor: string | null = null;
67
+
68
+ private resetAll(): void {
69
+ this.styles.clear();
70
+ this.fgColor = null;
71
+ this.bgColor = null;
72
+ }
73
+
74
+ private applyStyleOn(code: number, param: string): void {
75
+ if (code >= SGR_STYLE_MIN && code <= SGR_STYLE_MAX) {
76
+ this.styles.add(param);
77
+ }
78
+ }
79
+
80
+ private applyStyleOff(code: number): void {
81
+ if (code >= SGR_STYLE_OFF_BASE + 1 && code <= SGR_STYLE_OFF_BASE + SGR_STYLE_MAX) {
82
+ this.styles.delete(String(code - SGR_STYLE_OFF_BASE));
83
+ }
84
+ }
85
+
86
+ private applyExtendedColor(
87
+ params: string[],
88
+ index: number,
89
+ baseCode: number,
90
+ target: 'fg' | 'bg',
91
+ ): number {
92
+ if (params[index + 1] === SGR_MODE_256) {
93
+ const sequence = `${baseCode};5;${params[index + 2]}`;
94
+ if (target === 'fg') {
95
+ this.fgColor = sequence;
96
+ } else {
97
+ this.bgColor = sequence;
98
+ }
99
+ return 2;
100
+ }
101
+ if (params[index + 1] === SGR_MODE_RGB) {
102
+ const sequence = `${baseCode};2;${params[index + 2]};${params[index + 3]};${params[index + 4]}`;
103
+ if (target === 'fg') {
104
+ this.fgColor = sequence;
105
+ } else {
106
+ this.bgColor = sequence;
107
+ }
108
+ return RGB_PARAM_COUNT;
109
+ }
110
+ return 0;
111
+ }
112
+
113
+ private applyBasicFg(code: number, param: string): void {
114
+ if (
115
+ (code >= SGR_FG_BASIC_MIN && code <= SGR_FG_BASIC_MAX) ||
116
+ (code >= SGR_FG_BRIGHT_MIN && code <= SGR_FG_BRIGHT_MAX)
117
+ ) {
118
+ this.fgColor = param;
119
+ }
120
+ }
121
+
122
+ private applyBasicBg(code: number, param: string): void {
123
+ if (
124
+ (code >= SGR_BG_BASIC_MIN && code <= SGR_BG_BASIC_MAX) ||
125
+ (code >= SGR_BG_BRIGHT_MIN && code <= SGR_BG_BRIGHT_MAX)
126
+ ) {
127
+ this.bgColor = param;
128
+ }
129
+ }
130
+
131
+ apply(sequence: string): void {
132
+ const match = sequence.match(ANSI_SGR_PATTERN);
133
+ const params = match?.[1]?.split(';').filter(Boolean) ?? [];
134
+ let i = 0;
135
+
136
+ while (i < params.length) {
137
+ const param = params[i];
138
+ if (param === undefined || param.length === 0) {
139
+ break;
140
+ }
141
+ const code = Number.parseInt(param, 10);
142
+
143
+ if (code === SGR_RESET) {
144
+ this.resetAll();
145
+ } else {
146
+ this.applyStyleOn(code, param);
147
+ this.applyStyleOff(code);
148
+ i += this.applyExtendedColor(params, i, SGR_FG_EXTENDED, 'fg');
149
+ i += this.applyExtendedColor(params, i, SGR_BG_EXTENDED, 'bg');
150
+ this.applyBasicFg(code, param);
151
+ if (code === SGR_FG_DEFAULT) {
152
+ this.fgColor = null;
153
+ }
154
+ this.applyBasicBg(code, param);
155
+ if (code === SGR_BG_DEFAULT) {
156
+ this.bgColor = null;
157
+ }
158
+ }
159
+
160
+ i += 1;
161
+ }
162
+ }
163
+
164
+ toSequence(): string {
165
+ const parts = [...this.styles];
166
+ if (this.fgColor !== null) {
167
+ parts.push(this.fgColor);
168
+ }
169
+ if (this.bgColor !== null) {
170
+ parts.push(this.bgColor);
171
+ }
172
+ return parts.length === 0 ? '' : `${ESC}[${parts.join(';')}m`;
173
+ }
174
+
175
+ clone(): AnsiState {
176
+ const copy = new AnsiState();
177
+ copy.styles = new Set(this.styles);
178
+ copy.fgColor = this.fgColor;
179
+ copy.bgColor = this.bgColor;
180
+ return copy;
181
+ }
182
+
183
+ isEmpty(): boolean {
184
+ return this.styles.size === 0 && this.fgColor === null && this.bgColor === null;
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Slice a string by visible character positions, preserving ANSI codes.
190
+ * Returns [sliced portion with reset, remainder with state prefix]
191
+ */
192
+ const sliceByVisible = (str: string, start: number, end?: number): [string, string] => {
193
+ let visiblePos = 0;
194
+ let startIdx = 0;
195
+ let endIdx = str.length;
196
+ let foundStart = start === 0;
197
+ const state = new AnsiState();
198
+ let stateAtEnd: AnsiState | null = null;
199
+
200
+ let i = 0;
201
+ while (i < str.length) {
202
+ ANSI_SEQUENCE_PATTERN.lastIndex = i;
203
+ const match = ANSI_SEQUENCE_PATTERN.exec(str);
204
+
205
+ if (match?.index === i) {
206
+ state.apply(match[0]);
207
+ i += match[0].length;
208
+ } else {
209
+ if (!foundStart && visiblePos === start) {
210
+ startIdx = i;
211
+ foundStart = true;
212
+ }
213
+
214
+ visiblePos += 1;
215
+
216
+ if (end !== undefined && visiblePos === end) {
217
+ endIdx = i + 1;
218
+ stateAtEnd = state.clone();
219
+ break;
220
+ }
221
+
222
+ i += 1;
223
+ }
224
+ }
225
+
226
+ if (!foundStart) {
227
+ return ['', ''];
228
+ }
229
+
230
+ const sliced = str.slice(startIdx, endIdx);
231
+ const remainder = str.slice(endIdx);
232
+
233
+ const slicedWithReset =
234
+ stateAtEnd !== null && !stateAtEnd.isEmpty() ? sliced + ANSI_RESET : sliced;
235
+
236
+ const remainderWithState =
237
+ stateAtEnd !== null && !stateAtEnd.isEmpty() && remainder.length > 0
238
+ ? stateAtEnd.toSequence() + remainder
239
+ : remainder;
240
+
241
+ return [slicedWithReset, remainderWithState];
242
+ };
243
+
244
+ const wrapCodeLines = (code: string, width: number, continuation: string): string => {
245
+ const lines = code.split('\n');
246
+ const wrapped: string[] = [];
247
+ const continuationPrefix = `${getSubtleColor()(continuation)} `;
248
+ const continuationWidth = continuation.length + 1;
249
+
250
+ for (const line of lines) {
251
+ if (visibleLength(line) <= width) {
252
+ wrapped.push(line);
253
+ } else {
254
+ const [firstChunk, firstRest] = sliceByVisible(line, 0, width);
255
+ wrapped.push(firstChunk);
256
+
257
+ let remaining = firstRest;
258
+ const chunkWidth = width - continuationWidth - 1;
259
+
260
+ while (visibleLength(remaining) > 0) {
261
+ const [chunk, rest] = sliceByVisible(remaining, 0, chunkWidth);
262
+ wrapped.push(`${continuationPrefix} ${chunk}`);
263
+ remaining = rest;
264
+ }
265
+ }
266
+ }
267
+
268
+ return wrapped.join('\n');
269
+ };
270
+
271
+ const renderInlineCode = (code: string): string => getInlineCodeStyle()(` ${code} `);
272
+
273
+ /** Box + wrap already-highlighted source (no Shiki). */
274
+ const formatCodeBlockBox = (highlighted: string, lang: string, config: CodeConfig): string => {
275
+ const useNerdFonts = config.useNerdFonts ?? supportsNerdFonts();
276
+ const wrapped = config.wrap
277
+ ? wrapCodeLines(highlighted, config.width - BOX_HORIZONTAL_PADDING, config.continuation)
278
+ : highlighted;
279
+
280
+ const title = lang.length > 0 ? getLanguageLabel(lang, useNerdFonts) : undefined;
281
+
282
+ const box = boxen(wrapped, {
283
+ borderColor: getHexColors().subtle,
284
+ borderStyle: 'round',
285
+ padding: { bottom: 0, left: 1, right: 1, top: 0 },
286
+ ...(title === undefined ? {} : { title: getBoxTitleStyle()(title) }),
287
+ titleAlignment: 'left',
288
+ width: config.width,
289
+ });
290
+
291
+ return `${box}\n`;
292
+ };
293
+
294
+ const highlightCodeBlockSource = Effect.fn('md.highlight-code-block')(
295
+ (code: string, lang: string, themeId: string) =>
296
+ Effect.gen(function* highlightCodeBlockSourceGen() {
297
+ if (code.length > MAX_CODE_BLOCK_HIGHLIGHT_LENGTH) {
298
+ return getMutedColor()(code);
299
+ }
300
+ const langId = normalizeLang(lang);
301
+ const highlighted = yield* highlightCode(code, langId, themeId);
302
+ if (highlighted.includes('\u001B[')) {
303
+ return highlighted;
304
+ }
305
+ return getMutedColor()(code);
306
+ }),
307
+ );
308
+
309
+ const renderCodeBlock = Effect.fn('md.render-code-block')(function* renderCodeBlockGen(
310
+ code: string,
311
+ lang: string,
312
+ config: CodeConfig,
313
+ ) {
314
+ const highlighted = yield* highlightCodeBlockSource(code, lang, theme().shikiTheme);
315
+ return formatCodeBlockBox(highlighted, lang, config);
316
+ });
317
+
318
+ export {
319
+ type CodeConfig,
320
+ formatCodeBlockBox,
321
+ highlightCodeBlockSource,
322
+ MAX_CODE_BLOCK_HIGHLIGHT_LENGTH,
323
+ renderCodeBlock,
324
+ renderInlineCode,
325
+ wrapCodeLines,
326
+ };
@@ -0,0 +1,39 @@
1
+ import boxen from 'boxen';
2
+
3
+ import { getHeadingColor, getHexColors, getSubtleColor } from '../../ui/themes/semantic';
4
+
5
+ const FALLBACK_HEADING_LEVEL = 5;
6
+ const H1_BOX_PADDING = 8;
7
+ const H2_RULE_GAP = 2;
8
+
9
+ export const renderHeading = (text: string, level: number, width: number): string => {
10
+ const cleanText = text.trim();
11
+
12
+ switch (level) {
13
+ case 1: {
14
+ const boxed = boxen(getHeadingColor(1)(cleanText), {
15
+ borderColor: getHexColors().h1,
16
+ borderStyle: 'round',
17
+ padding: { bottom: 0, left: 2, right: 2, top: 0 },
18
+ textAlignment: 'center',
19
+ width: Math.min(width, cleanText.length + H1_BOX_PADDING),
20
+ });
21
+ return `\n\n${boxed}\n\n`;
22
+ }
23
+ case 2: {
24
+ const line = getSubtleColor()(
25
+ '─'.repeat(Math.max(0, width - cleanText.length - H2_RULE_GAP)),
26
+ );
27
+ return `\n${getHeadingColor(2)(cleanText)} ${line}\n`;
28
+ }
29
+ case 3: {
30
+ return `\n${getHeadingColor(3)(cleanText)}\n`;
31
+ }
32
+ case 4: {
33
+ return `\n${getHeadingColor(4)(cleanText)}\n`;
34
+ }
35
+ default: {
36
+ return `\n${getHeadingColor(FALLBACK_HEADING_LEVEL)(cleanText)}\n`;
37
+ }
38
+ }
39
+ };
@@ -0,0 +1,33 @@
1
+ // Src/lib/elements/link.ts
2
+ import { getLinkColor, getSubtleColor } from '../../ui/themes/semantic';
3
+
4
+ interface LinkConfig {
5
+ osc8: 'auto' | boolean;
6
+ show_urls: boolean;
7
+ }
8
+
9
+ const OSC8_TERMINALS = ['iTerm.app', 'WezTerm', 'vscode', 'Hyper', 'kitty', 'Alacritty'];
10
+
11
+ export const supportsOsc8 = (): boolean => {
12
+ const term = Bun.env['TERM_PROGRAM'] ?? '';
13
+ return OSC8_TERMINALS.some((t) => term.includes(t));
14
+ };
15
+
16
+ export const renderLink = (text: string, url: string, config: LinkConfig): string => {
17
+ const useOsc8 = config.osc8 === true || (config.osc8 === 'auto' && supportsOsc8());
18
+ const linkColor = getLinkColor();
19
+ const styledText = linkColor(text);
20
+
21
+ if (useOsc8) {
22
+ const hyperlink = `\u001B]8;;${url}\u0007${styledText}\u001B]8;;\u0007`;
23
+ if (config.show_urls && text !== url) {
24
+ return `${hyperlink} ${getSubtleColor()(`(${url})`)}`;
25
+ }
26
+ return hyperlink;
27
+ }
28
+
29
+ if (text === url) {
30
+ return styledText;
31
+ }
32
+ return `${styledText} ${getSubtleColor()(`(${url})`)}`;
33
+ };
@@ -0,0 +1,89 @@
1
+ // Src/lib/elements/list.ts
2
+ import { getAccentColor, getMutedColor } from '../../ui/themes/semantic';
3
+ import { visibleLength } from '../ansi';
4
+ import { wrapText } from './text';
5
+
6
+ const INDENT_SIZE = 3;
7
+ const BULLETS = ['•', '◦', '▪'] as const;
8
+
9
+ const CHECKBOXES = {
10
+ checked: { nerd: '󰱒', unicode: '☑' },
11
+ unchecked: { nerd: '󰄱', unicode: '☐' },
12
+ } as const;
13
+
14
+ interface ListItemConfig {
15
+ width?: number;
16
+ hyphenation?: boolean;
17
+ task?: boolean;
18
+ checked?: boolean;
19
+ nerdFonts?: boolean;
20
+ }
21
+
22
+ const getBullet = (
23
+ config: ListItemConfig | undefined,
24
+ ordered: boolean,
25
+ depth: number,
26
+ index: number | undefined,
27
+ ): string => {
28
+ if (config?.task === true) {
29
+ const style = config.checked === true ? CHECKBOXES.checked : CHECKBOXES.unchecked;
30
+ return config.nerdFonts === true ? style.nerd : style.unicode;
31
+ }
32
+ if (ordered) {
33
+ return `${index ?? 1}.`;
34
+ }
35
+ const bulletIndex = depth % BULLETS.length;
36
+ return BULLETS[bulletIndex] ?? BULLETS[0];
37
+ };
38
+
39
+ const renderListItem = (
40
+ text: string,
41
+ ordered: boolean,
42
+ depth: number,
43
+ index?: number,
44
+ config?: ListItemConfig,
45
+ ): string => {
46
+ const indent = ' '.repeat(depth * INDENT_SIZE);
47
+ const bullet = getBullet(config, ordered, depth, index);
48
+ const coloredBullet = getAccentColor()(bullet);
49
+ const styledText =
50
+ config?.task === true && config.checked === true ? getMutedColor()(text) : text;
51
+
52
+ if (config?.width === undefined || config.width === 0) {
53
+ return `${indent}${coloredBullet} ${styledText}`;
54
+ }
55
+
56
+ const bulletWidth = visibleLength(coloredBullet);
57
+ const prefixWidth = indent.length + bulletWidth + 1;
58
+ const textWidth = config.width - prefixWidth;
59
+
60
+ if (textWidth <= 0) {
61
+ return `${indent}${coloredBullet} ${styledText}`;
62
+ }
63
+
64
+ const wrapped = wrapText(styledText, textWidth, {
65
+ hyphenation: config.hyphenation ?? false,
66
+ locale: 'en-us',
67
+ });
68
+
69
+ const lines = wrapped.split('\n');
70
+ const continuationIndent = ' '.repeat(prefixWidth);
71
+
72
+ return lines
73
+ .map((line, i) => {
74
+ if (i === 0) {
75
+ return `${indent}${coloredBullet} ${line}`;
76
+ }
77
+ return `${continuationIndent}${line}`;
78
+ })
79
+ .join('\n');
80
+ };
81
+
82
+ const renderList = (
83
+ items: string[],
84
+ ordered: boolean,
85
+ depth = 0,
86
+ config?: ListItemConfig,
87
+ ): string => items.map((item, i) => renderListItem(item, ordered, depth, i + 1, config)).join('\n');
88
+
89
+ export { renderList, renderListItem };
@@ -0,0 +1,65 @@
1
+ // Src/lib/elements/table.ts
2
+ import { Table } from 'console-table-printer';
3
+
4
+ const TABLE_STYLE = {
5
+ headerBottom: { left: '├', mid: '┼', other: '─', right: '┤' },
6
+ headerTop: { left: '┌', mid: '┬', other: '─', right: '┐' },
7
+ tableBottom: { left: '└', mid: '┴', other: '─', right: '┘' },
8
+ vertical: '│',
9
+ };
10
+
11
+ const ROW_COLOR = 'white';
12
+ const MIN_COLUMN_WIDTH = 10;
13
+
14
+ interface TableOptions {
15
+ width?: number;
16
+ }
17
+
18
+ export const renderTable = (
19
+ headers: string[],
20
+ rows: string[][],
21
+ options?: TableOptions,
22
+ ): string => {
23
+ const numColumns = headers.length;
24
+
25
+ let columnMaxLens: number[] | undefined;
26
+ const tableWidth = options?.width;
27
+ if (tableWidth !== undefined && tableWidth > 0 && numColumns > 0) {
28
+ const borderOverhead = numColumns + 1 + 2 * numColumns;
29
+ const availableForContent = tableWidth - borderOverhead;
30
+ const baseLen = Math.max(MIN_COLUMN_WIDTH, Math.floor(availableForContent / numColumns));
31
+ const remainder = availableForContent - baseLen * numColumns;
32
+ columnMaxLens = headers.map((_, i) => (i < remainder ? baseLen + 1 : baseLen));
33
+ }
34
+
35
+ const table = new Table({
36
+ colorMap: {
37
+ // Frappe.text + bold
38
+ custom_header: '\u001B[38;5;189m\u001B[1m',
39
+ // Frappe.subtext1
40
+ custom_row: '\u001B[38;5;146m',
41
+ },
42
+ columns: headers.map((header, i) => {
43
+ const maxLen = columnMaxLens?.[i];
44
+ return {
45
+ alignment: 'left' as const,
46
+ color: ROW_COLOR,
47
+ name: header,
48
+ ...(maxLen === undefined ? {} : { maxLen }),
49
+ };
50
+ }),
51
+ style: {
52
+ headerBottom: TABLE_STYLE.headerBottom,
53
+ headerTop: TABLE_STYLE.headerTop,
54
+ tableBottom: TABLE_STYLE.tableBottom,
55
+ vertical: TABLE_STYLE.vertical,
56
+ },
57
+ });
58
+
59
+ for (const row of rows) {
60
+ const rowObj = Object.fromEntries(headers.map((header, i) => [header, row[i] ?? '']));
61
+ table.addRow(rowObj, { color: 'custom_row' });
62
+ }
63
+
64
+ return table.render();
65
+ };