@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,120 @@
1
+ import { autocomplete, isCancel } from '@clack/prompts';
2
+ import { Effect, Schema } from 'effect';
3
+ import fuzzysort from 'fuzzysort';
4
+
5
+ import { getTerminalHeight } from '../lib/width';
6
+ import { getMutedColor } from './themes/semantic';
7
+
8
+ interface Option {
9
+ label: string;
10
+ value: string;
11
+ }
12
+
13
+ class PickerError extends Schema.TaggedErrorClass<PickerError>()('PickerError', {
14
+ cause: Schema.Unknown,
15
+ }) {}
16
+
17
+ const MIN_PICKER_ITEMS = 5;
18
+ const PICKER_VERTICAL_RESERVE = 6;
19
+
20
+ const isHiddenPathSegment = (part: string): boolean => part.startsWith('.') && part !== '.';
21
+
22
+ const shouldSkipMarkdownPath = (file: string): boolean =>
23
+ file.includes('node_modules/') ||
24
+ file.includes('.git/') ||
25
+ file.split('/').some((part) => isHiddenPathSegment(part));
26
+
27
+ /**
28
+ * Find all markdown files in current directory, sorted by modification time.
29
+ * Ignores node_modules, .git, and hidden directories.
30
+ */
31
+ const scanMarkdownFiles = async (): Promise<string[]> => {
32
+ const glob = new Bun.Glob('**/*.md');
33
+ const files: string[] = [];
34
+
35
+ for await (const file of glob.scan({ cwd: '.', onlyFiles: true })) {
36
+ if (!shouldSkipMarkdownPath(file)) {
37
+ files.push(file);
38
+ }
39
+ }
40
+
41
+ const filesWithMtime = await Promise.all(
42
+ files.map(async (file) => {
43
+ const stat = await Bun.file(file).stat();
44
+ return { file, mtime: stat.mtime };
45
+ }),
46
+ );
47
+
48
+ filesWithMtime.sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
49
+
50
+ return filesWithMtime.map((entry) => entry.file);
51
+ };
52
+
53
+ const findMarkdownFiles = Effect.fn('md.find-markdown-files')(function* findMarkdownFilesGen() {
54
+ return yield* Effect.tryPromise({
55
+ catch: (cause) => new PickerError({ cause }),
56
+ try: () => scanMarkdownFiles(),
57
+ });
58
+ });
59
+
60
+ /**
61
+ * Create a fuzzy filter function for use with @clack/prompts autocomplete.
62
+ * Uses fuzzysort for fast, subsequence-based matching (like fzf/SublimeText).
63
+ */
64
+ const createFuzzyFilter = (): ((input: string, options: Option[]) => Option[]) => {
65
+ return (input: string, options: Option[]): Option[] => {
66
+ if (input.trim().length === 0) {
67
+ return options;
68
+ }
69
+
70
+ const results = fuzzysort.go(input, options, { key: 'label', limit: 100, threshold: 0.2 });
71
+
72
+ return results.map((result) => result.obj);
73
+ };
74
+ };
75
+
76
+ const isStringSelection = (value: unknown): value is string => typeof value === 'string';
77
+
78
+ /**
79
+ * Show interactive file picker for markdown files.
80
+ * Returns array of selected file paths, or empty array if cancelled/no files.
81
+ */
82
+ const showFilePicker = Effect.fn('md.show-file-picker')(function* showFilePickerGen() {
83
+ const files = yield* findMarkdownFiles();
84
+
85
+ if (files.length === 0) {
86
+ yield* Effect.sync(() => {
87
+ console.log(getMutedColor()('No markdown files found in current directory.'));
88
+ });
89
+ return [];
90
+ }
91
+
92
+ const allOptions = files.map((f) => ({ label: f, value: f }));
93
+ const maxItems = Math.max(MIN_PICKER_ITEMS, getTerminalHeight() - PICKER_VERTICAL_RESERVE);
94
+ const filter = createFuzzyFilter();
95
+
96
+ const selected = yield* Effect.tryPromise({
97
+ catch: (cause) => new PickerError({ cause }),
98
+ try: () =>
99
+ autocomplete({
100
+ maxItems,
101
+ message: 'Select a markdown file',
102
+ options() {
103
+ const input = this.userInput || '';
104
+ return filter(input, allOptions);
105
+ },
106
+ }),
107
+ });
108
+
109
+ if (isCancel(selected)) {
110
+ return [];
111
+ }
112
+
113
+ if (!isStringSelection(selected)) {
114
+ return [];
115
+ }
116
+
117
+ return [selected];
118
+ });
119
+
120
+ export { createFuzzyFilter, findMarkdownFiles, PickerError, showFilePicker };
@@ -0,0 +1,161 @@
1
+ // Src/ui/themes/ansi.ts
2
+ import { getColorLevel } from './color-support';
3
+
4
+ const ESC = '\u001B';
5
+ const RESET = `${ESC}[0m`;
6
+
7
+ const ANSI_STANDARD_COUNT = 16;
8
+ const ANSI_CUBE_BASE = 16;
9
+ const ANSI_CUBE_SIZE = 36;
10
+ const ANSI_GRAYSCALE_BASE = 232;
11
+ const ANSI_PALETTE_SIZE = 256;
12
+ const RGB_MAX = 255;
13
+ const RGB_MID = 128;
14
+ const RGB_LIGHT = 192;
15
+ const CUBE_LEVELS = 6;
16
+ const CUBE_RGB_OFFSET = 55;
17
+ const CUBE_RGB_STEP = 40;
18
+ const GRAY_RAMP_START = 8;
19
+ const GRAY_RAMP_STEP = 10;
20
+
21
+ type Rgb = [number, number, number];
22
+
23
+ const STANDARD_ANSI_COLORS: readonly Rgb[] = [
24
+ [0, 0, 0],
25
+ [RGB_MID, 0, 0],
26
+ [0, RGB_MID, 0],
27
+ [RGB_MID, RGB_MID, 0],
28
+ [0, 0, RGB_MID],
29
+ [RGB_MID, 0, RGB_MID],
30
+ [0, RGB_MID, RGB_MID],
31
+ [RGB_LIGHT, RGB_LIGHT, RGB_LIGHT],
32
+ [RGB_MID, RGB_MID, RGB_MID],
33
+ [RGB_MAX, 0, 0],
34
+ [0, RGB_MAX, 0],
35
+ [RGB_MAX, RGB_MAX, 0],
36
+ [0, 0, RGB_MAX],
37
+ [RGB_MAX, 0, RGB_MAX],
38
+ [0, RGB_MAX, RGB_MAX],
39
+ [RGB_MAX, RGB_MAX, RGB_MAX],
40
+ ] as const;
41
+
42
+ const cubeComponentToRgb = (value: number): number =>
43
+ value === 0 ? 0 : CUBE_RGB_OFFSET + value * CUBE_RGB_STEP;
44
+
45
+ /**
46
+ * ANSI 256-color palette RGB values.
47
+ * Colors 0-15: Standard colors (system-dependent, skip)
48
+ * Colors 16-231: 6x6x6 color cube
49
+ * Colors 232-255: Grayscale ramp
50
+ */
51
+ const getAnsi256Color = (code: number): Rgb => {
52
+ if (code < ANSI_STANDARD_COUNT) {
53
+ const color = STANDARD_ANSI_COLORS[code];
54
+ return color ?? [0, 0, 0];
55
+ }
56
+
57
+ if (code < ANSI_GRAYSCALE_BASE) {
58
+ const idx = code - ANSI_CUBE_BASE;
59
+ const r = Math.floor(idx / ANSI_CUBE_SIZE);
60
+ const g = Math.floor((idx % ANSI_CUBE_SIZE) / CUBE_LEVELS);
61
+ const b = idx % CUBE_LEVELS;
62
+ return [cubeComponentToRgb(r), cubeComponentToRgb(g), cubeComponentToRgb(b)];
63
+ }
64
+
65
+ const gray = GRAY_RAMP_START + (code - ANSI_GRAYSCALE_BASE) * GRAY_RAMP_STEP;
66
+ return [gray, gray, gray];
67
+ };
68
+
69
+ const hexToRgb = (hex: string): Rgb => {
70
+ const h = hex.replace('#', '').toLowerCase();
71
+ return [
72
+ Number.parseInt(h.slice(0, 2), 16),
73
+ Number.parseInt(h.slice(2, 4), 16),
74
+ Number.parseInt(h.slice(4, 6), 16),
75
+ ];
76
+ };
77
+
78
+ const colorDistance = ([r1, g1, b1]: Rgb, [r2, g2, b2]: Rgb): number =>
79
+ (r1 - r2) ** 2 + (g1 - g2) ** 2 + (b1 - b2) ** 2;
80
+
81
+ const hexToAnsi256 = (hex: string): number => {
82
+ const target = hexToRgb(hex);
83
+ let closest = ANSI_CUBE_BASE;
84
+ let minDist = Infinity;
85
+
86
+ for (let i = ANSI_CUBE_BASE; i < ANSI_PALETTE_SIZE; i += 1) {
87
+ const dist = colorDistance(target, getAnsi256Color(i));
88
+ if (dist < minDist) {
89
+ minDist = dist;
90
+ closest = i;
91
+ }
92
+ }
93
+
94
+ return closest;
95
+ };
96
+
97
+ const ansiFg = (hex: string): ((text: string) => string) => {
98
+ if (getColorLevel() >= 3) {
99
+ const [r, g, b] = hexToRgb(hex);
100
+ return (text: string) => `${ESC}[38;2;${r};${g};${b}m${text}${RESET}`;
101
+ }
102
+ const code = hexToAnsi256(hex);
103
+ return (text: string) => `${ESC}[38;5;${code}m${text}${RESET}`;
104
+ };
105
+
106
+ const ansiBg = (hex: string): ((text: string) => string) => {
107
+ if (getColorLevel() >= 3) {
108
+ const [r, g, b] = hexToRgb(hex);
109
+ return (text: string) => `${ESC}[48;2;${r};${g};${b}m${text}${RESET}`;
110
+ }
111
+ const code = hexToAnsi256(hex);
112
+ return (text: string) => `${ESC}[48;5;${code}m${text}${RESET}`;
113
+ };
114
+
115
+ const ansiFgBg = (fgHex: string, bgHex: string): ((text: string) => string) => {
116
+ if (getColorLevel() >= 3) {
117
+ const [fgR, fgG, fgB] = hexToRgb(fgHex);
118
+ const [bgR, bgG, bgB] = hexToRgb(bgHex);
119
+ return (text: string) =>
120
+ `${ESC}[38;2;${fgR};${fgG};${fgB};48;2;${bgR};${bgG};${bgB}m${text}${RESET}`;
121
+ }
122
+ const fgCode = hexToAnsi256(fgHex);
123
+ const bgCode = hexToAnsi256(bgHex);
124
+ return (text: string) => `${ESC}[38;5;${fgCode};48;5;${bgCode}m${text}${RESET}`;
125
+ };
126
+
127
+ const ansiBold = (hex: string): ((text: string) => string) => {
128
+ if (getColorLevel() >= 3) {
129
+ const [r, g, b] = hexToRgb(hex);
130
+ return (text: string) => `${ESC}[1;38;2;${r};${g};${b}m${text}${RESET}`;
131
+ }
132
+ const code = hexToAnsi256(hex);
133
+ return (text: string) => `${ESC}[1;38;5;${code}m${text}${RESET}`;
134
+ };
135
+
136
+ const ansiItalic = (hex: string): ((text: string) => string) => {
137
+ if (getColorLevel() >= 3) {
138
+ const [r, g, b] = hexToRgb(hex);
139
+ return (text: string) => `${ESC}[3;38;2;${r};${g};${b}m${text}${RESET}`;
140
+ }
141
+ const code = hexToAnsi256(hex);
142
+ return (text: string) => `${ESC}[3;38;5;${code}m${text}${RESET}`;
143
+ };
144
+
145
+ /**
146
+ * Style text with foreground color, transitioning to another color instead of resetting.
147
+ * Useful for styled text embedded in colored contexts (like box titles in borders).
148
+ */
149
+ const ansiFgTransition = (fgHex: string, transitionHex: string): ((text: string) => string) => {
150
+ if (getColorLevel() >= 3) {
151
+ const [fgR, fgG, fgB] = hexToRgb(fgHex);
152
+ const [trR, trG, trB] = hexToRgb(transitionHex);
153
+ return (text: string) =>
154
+ `${ESC}[38;2;${fgR};${fgG};${fgB}m${text}${ESC}[38;2;${trR};${trG};${trB}m`;
155
+ }
156
+ const fgCode = hexToAnsi256(fgHex);
157
+ const trCode = hexToAnsi256(transitionHex);
158
+ return (text: string) => `${ESC}[38;5;${fgCode}m${text}${ESC}[38;5;${trCode}m`;
159
+ };
160
+
161
+ export { ansiBg, ansiBold, ansiFg, ansiFgBg, ansiFgTransition, ansiItalic, hexToAnsi256, hexToRgb };
@@ -0,0 +1,106 @@
1
+ // Src/ui/themes/color-support.ts
2
+ import supportsColor from 'supports-color';
3
+
4
+ type ColorLevel = 0 | 1 | 2 | 3;
5
+
6
+ let cachedLevel: ColorLevel | null = null;
7
+ let configOverride: boolean | 'auto' = 'auto';
8
+
9
+ /**
10
+ * Initialize color environment on module load.
11
+ * Syncs NO_COLOR to FORCE_COLOR for chalk/boxen consistency.
12
+ */
13
+ const initColorEnvironment = (): void => {
14
+ const noColorEnv = Bun.env['NO_COLOR'] !== undefined && Bun.env['NO_COLOR'] !== '';
15
+ const noColorFlag = process.argv.includes('--no-color');
16
+
17
+ if (noColorEnv || noColorFlag) {
18
+ Bun.env['FORCE_COLOR'] = '0';
19
+ }
20
+ };
21
+
22
+ initColorEnvironment();
23
+
24
+ /**
25
+ * Set color configuration override.
26
+ * @param truecolor - true for truecolor, false for 256-color, 'auto' for detection
27
+ */
28
+ const setColorConfig = (truecolor: boolean | 'auto'): void => {
29
+ configOverride = truecolor;
30
+ cachedLevel = null;
31
+
32
+ if (truecolor === true) {
33
+ Bun.env['FORCE_COLOR'] = '3';
34
+ } else if (truecolor === false) {
35
+ Bun.env['FORCE_COLOR'] = '2';
36
+ }
37
+ };
38
+
39
+ /** Reset the cached color level. Useful for testing. */
40
+ const resetColorCache = (): void => {
41
+ cachedLevel = null;
42
+ };
43
+
44
+ const detectAutoColorLevel = (): ColorLevel => {
45
+ const force = Bun.env['FORCE_COLOR'];
46
+ if (force === '0') {
47
+ return 0;
48
+ }
49
+ if (force === '1') {
50
+ return 1;
51
+ }
52
+ if (force === '2') {
53
+ return 2;
54
+ }
55
+ if (force === '3') {
56
+ return 3;
57
+ }
58
+
59
+ if (!process.stdout.isTTY) {
60
+ return 0;
61
+ }
62
+
63
+ const colorterm = Bun.env['COLORTERM'];
64
+ if (colorterm === 'truecolor' || colorterm === '24bit') {
65
+ return 3;
66
+ }
67
+
68
+ const term = Bun.env['TERM'] ?? '';
69
+ if (term.includes('256color')) {
70
+ return 2;
71
+ }
72
+
73
+ const detected = supportsColor.stdout;
74
+ if (detected === false) {
75
+ return 0;
76
+ }
77
+ return detected.level as ColorLevel;
78
+ };
79
+
80
+ /** Get the current color level: 0 (none), 1 (basic), 2 (256), or 3 (truecolor). */
81
+ const getColorLevel = (): ColorLevel => {
82
+ if (cachedLevel !== null) {
83
+ return cachedLevel;
84
+ }
85
+
86
+ let level: ColorLevel;
87
+
88
+ if (Bun.env['NO_COLOR'] !== undefined && Bun.env['NO_COLOR'] !== '') {
89
+ level = 0;
90
+ } else if (configOverride === true) {
91
+ level = 3;
92
+ } else if (configOverride === false) {
93
+ level = 2;
94
+ } else {
95
+ level = detectAutoColorLevel();
96
+ }
97
+
98
+ cachedLevel = level;
99
+ return level;
100
+ };
101
+
102
+ /** Check if truecolor is supported. */
103
+ const supportsTruecolor = (): boolean => getColorLevel() >= 3;
104
+
105
+ export type { ColorLevel };
106
+ export { getColorLevel, resetColorCache, setColorConfig, supportsTruecolor };