yanki 2.0.4 → 2.0.6
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.
- package/dist/bin/cli.js +1055 -94
- package/dist/lib/index.d.ts +39 -11
- package/dist/lib/index.js +250 -104
- package/dist/standalone/index.d.ts +73 -35
- package/dist/standalone/index.js +1010 -96
- package/package.json +21 -17
- package/readme.md +11 -40
- package/dist/.DS_Store +0 -0
- package/dist/bin/abap-lNEwo1Fh.js +0 -1
- package/dist/bin/actionscript-3-BaFy4IUl.js +0 -1
- package/dist/bin/ada-HceTT-Hk.js +0 -1
- package/dist/bin/andromeeda-DSb5DuLX.js +0 -1
- package/dist/bin/angular-html-BMgm7jKv.js +0 -1
- package/dist/bin/angular-html-DaLgCdY4.js +0 -1
- package/dist/bin/angular-ts-_FOddbkN.js +0 -1
- package/dist/bin/apache-MxcCclyI.js +0 -1
- package/dist/bin/apex-Dt1yk6kE.js +0 -1
- package/dist/bin/apl-Ct_wGLTZ.js +0 -1
- package/dist/bin/applescript-CByslqpM.js +0 -1
- package/dist/bin/ara-BM6jOAfW.js +0 -1
- package/dist/bin/asciidoc-BlA3UgbV.js +0 -1
- package/dist/bin/asm-VlQVLZc1.js +0 -1
- package/dist/bin/astro-ZcVfwsPl.js +0 -1
- package/dist/bin/aurora-x-CeJL9O0f.js +0 -1
- package/dist/bin/awk-UE5FuWyB.js +0 -1
- package/dist/bin/ayu-dark-BZ1fKSke.js +0 -1
- package/dist/bin/ayu-light-Ck_aK9Yx.js +0 -1
- package/dist/bin/ayu-mirage-BbZPk566.js +0 -1
- package/dist/bin/ballerina-Bd4N5CqQ.js +0 -1
- package/dist/bin/bat-nOz1h7iR.js +0 -1
- package/dist/bin/beancount-DYpPd8NJ.js +0 -1
- package/dist/bin/berry-D6DSNBWg.js +0 -1
- package/dist/bin/bibtex-8WxC_vKc.js +0 -1
- package/dist/bin/bicep-Dr_R0619.js +0 -1
- package/dist/bin/bird2-CFa4jX8R.js +0 -1
- package/dist/bin/blade-CxETtqpr.js +0 -1
- package/dist/bin/bsl-C-_RJCQ1.js +0 -1
- package/dist/bin/c-24YQ-N5y.js +0 -1
- package/dist/bin/c-DZllpasP.js +0 -1
- package/dist/bin/c3-BzjQIVCp.js +0 -1
- package/dist/bin/cadence-QJ1AGP7V.js +0 -1
- package/dist/bin/cairo-Cud9ep5K.js +0 -1
- package/dist/bin/catppuccin-frappe-C74znM78.js +0 -1
- package/dist/bin/catppuccin-latte-yc8K1O2M.js +0 -1
- package/dist/bin/catppuccin-macchiato-DfzJUoQE.js +0 -1
- package/dist/bin/catppuccin-mocha-CV-OB_YP.js +0 -1
- package/dist/bin/clarity-CP8m4qdU.js +0 -1
- package/dist/bin/clojure-Du7V1e4x.js +0 -1
- package/dist/bin/cmake-CmanohFH.js +0 -1
- package/dist/bin/cmake-DirU205C.js +0 -1
- package/dist/bin/cobol-D6VccPzE.js +0 -1
- package/dist/bin/codeowners-C-jlmeHU.js +0 -1
- package/dist/bin/codeql-DQHv5NBs.js +0 -1
- package/dist/bin/coffee-C_ytDHuo.js +0 -1
- package/dist/bin/common-lisp-BsVO-SvL.js +0 -1
- package/dist/bin/coq-Bl0U720i.js +0 -1
- package/dist/bin/cpp-BGpKj3Ti.js +0 -1
- package/dist/bin/cpp-BuOb9E77.js +0 -1
- package/dist/bin/crystal-D7hCMRTO.js +0 -1
- package/dist/bin/csharp-DJUgEWNf.js +0 -1
- package/dist/bin/csharp-iOHJHJRL.js +0 -1
- package/dist/bin/css-CLlsZvz0.js +0 -1
- package/dist/bin/css-OMa7meLh.js +0 -1
- package/dist/bin/csv-BPqpBVRL.js +0 -1
- package/dist/bin/csv-naVBPhrS.js +0 -1
- package/dist/bin/cue-C3D0yAYi.js +0 -1
- package/dist/bin/cypher-CeWowZt9.js +0 -1
- package/dist/bin/d-DYrc22cP.js +0 -1
- package/dist/bin/dark-plus-Comjg6US.js +0 -1
- package/dist/bin/dart-DIQ3D60A.js +0 -1
- package/dist/bin/dax-B0jXJO6E.js +0 -1
- package/dist/bin/desktop-DW6_MitS.js +0 -1
- package/dist/bin/diff-B1zQwqWC.js +0 -1
- package/dist/bin/diff-swkNtDFu.js +0 -1
- package/dist/bin/docker-otzKDcRB.js +0 -1
- package/dist/bin/dotenv-DK8FyOTY.js +0 -1
- package/dist/bin/dracula-soft-srQhJYut.js +0 -1
- package/dist/bin/dracula-tZpPjTpX.js +0 -1
- package/dist/bin/dream-maker-CNbVmTq1.js +0 -1
- package/dist/bin/edge-BJ5yEaU_.js +0 -1
- package/dist/bin/elixir-DQ_HZ35Z.js +0 -1
- package/dist/bin/elm-BPdX9LvI.js +0 -1
- package/dist/bin/emacs-lisp-OLcd4D2Y.js +0 -1
- package/dist/bin/erb-DTravkov.js +0 -1
- package/dist/bin/erlang-CkFToG4V.js +0 -1
- package/dist/bin/everforest-dark-Bu3gFA-8.js +0 -1
- package/dist/bin/everforest-light-Cf0fR5Ti.js +0 -1
- package/dist/bin/fennel-Bbo-EUQE.js +0 -1
- package/dist/bin/fish-DrrKatD-.js +0 -1
- package/dist/bin/fluent-BWbo2JQ_.js +0 -1
- package/dist/bin/fortran-fixed-form-CIezU5eM.js +0 -1
- package/dist/bin/fortran-free-form-BqeOewcz.js +0 -1
- package/dist/bin/fortran-free-form-C04P-dlU.js +0 -1
- package/dist/bin/fsharp-Dm-_SWJW.js +0 -1
- package/dist/bin/gdresource-fnofKreT.js +0 -1
- package/dist/bin/gdscript-BtzCMxvf.js +0 -1
- package/dist/bin/gdscript-CQy5Em6X.js +0 -1
- package/dist/bin/gdshader-1gA3GZ5B.js +0 -1
- package/dist/bin/gdshader-DuGt6i2A.js +0 -1
- package/dist/bin/genie-BtQYZNKR.js +0 -1
- package/dist/bin/gherkin-CIadD1ZT.js +0 -1
- package/dist/bin/git-commit-_8RqjgP7.js +0 -1
- package/dist/bin/git-rebase-Z73Q-A3B.js +0 -1
- package/dist/bin/github-dark-9m5hPMlo.js +0 -1
- package/dist/bin/github-dark-default-DlN5M7CE.js +0 -1
- package/dist/bin/github-dark-dimmed-nV3axXTC.js +0 -1
- package/dist/bin/github-dark-high-contrast-MfTMaKuJ.js +0 -1
- package/dist/bin/github-light-C9MFANg3.js +0 -1
- package/dist/bin/github-light-default-Cfefjxfr.js +0 -1
- package/dist/bin/github-light-high-contrast-BW7U_oJF.js +0 -1
- package/dist/bin/gleam-Bnawsb2X.js +0 -1
- package/dist/bin/glimmer-js-DIMbe603.js +0 -1
- package/dist/bin/glimmer-ts-B2T7GOhV.js +0 -1
- package/dist/bin/glsl-CGmNjIir.js +0 -1
- package/dist/bin/glsl-DEYttXt8.js +0 -1
- package/dist/bin/gn-Bc2dAhdc.js +0 -1
- package/dist/bin/gnuplot-X12GawsY.js +0 -1
- package/dist/bin/go-Ci0dAgBY.js +0 -1
- package/dist/bin/go-DN89cYst.js +0 -1
- package/dist/bin/graphql-CCYPSk-D.js +0 -1
- package/dist/bin/graphql-DOCOrfKm.js +0 -1
- package/dist/bin/groovy-eavxb_aL.js +0 -1
- package/dist/bin/gruvbox-dark-hard-Ckkb-ckr.js +0 -1
- package/dist/bin/gruvbox-dark-medium-DveV0NZQ.js +0 -1
- package/dist/bin/gruvbox-dark-soft-BnCoejWh.js +0 -1
- package/dist/bin/gruvbox-light-hard-alFf9nMB.js +0 -1
- package/dist/bin/gruvbox-light-medium-DXv1IAoL.js +0 -1
- package/dist/bin/gruvbox-light-soft-DE2R_dXV.js +0 -1
- package/dist/bin/hack-DZ-_iRCj.js +0 -1
- package/dist/bin/haml-DfH0AzHT.js +0 -1
- package/dist/bin/haml-DvXbkT9I.js +0 -1
- package/dist/bin/handlebars-CF9TGn7D.js +0 -1
- package/dist/bin/haskell-D52N8aee.js +0 -1
- package/dist/bin/haxe-DTUNnskd.js +0 -1
- package/dist/bin/haxe-lcHdXErF.js +0 -1
- package/dist/bin/hcl-CohGLpsg.js +0 -1
- package/dist/bin/hjson-kJZd-7Uv.js +0 -1
- package/dist/bin/hlsl-BJTcBv8Y.js +0 -1
- package/dist/bin/hlsl-Bed0H4CN.js +0 -1
- package/dist/bin/horizon-BjlQhBS5.js +0 -1
- package/dist/bin/horizon-bright-B9AmrisQ.js +0 -1
- package/dist/bin/houston-BRgUYlu1.js +0 -1
- package/dist/bin/html-Cuf7VAVg.js +0 -1
- package/dist/bin/html-RMei9Tro.js +0 -1
- package/dist/bin/html-derivative-BTT60mrv.js +0 -1
- package/dist/bin/html-derivative-D-Zlk8m5.js +0 -1
- package/dist/bin/http-bTeAg4ti.js +0 -1
- package/dist/bin/hurl-DNDYXzGk.js +0 -1
- package/dist/bin/hxml-DRC8Rsp0.js +0 -1
- package/dist/bin/hy-ClHGi00q.js +0 -1
- package/dist/bin/imba-BwxhzLVj.js +0 -1
- package/dist/bin/ini-BF8qU-L3.js +0 -1
- package/dist/bin/java-CQDUhPYw.js +0 -1
- package/dist/bin/java-DGXJx_7v.js +0 -1
- package/dist/bin/javascript-DPhXM0a6.js +0 -1
- package/dist/bin/javascript-DRicMqJx.js +0 -1
- package/dist/bin/jinja-B64tWnuH.js +0 -1
- package/dist/bin/jison-DzJXWpYr.js +0 -1
- package/dist/bin/json-CJDJkUtd.js +0 -1
- package/dist/bin/json-ci7zycrx.js +0 -1
- package/dist/bin/json5-5ueAesZq.js +0 -1
- package/dist/bin/jsonc-DLUxDCmI.js +0 -1
- package/dist/bin/jsonl-CcfJT6c3.js +0 -1
- package/dist/bin/jsonnet-BfXfyZk_.js +0 -1
- package/dist/bin/jssm-CG0kgLyz.js +0 -1
- package/dist/bin/jsx-BVfyPJhl.js +0 -1
- package/dist/bin/jsx-nttEtUui.js +0 -1
- package/dist/bin/julia-CdOV4Bps.js +0 -1
- package/dist/bin/just--5xSNTPr.js +0 -1
- package/dist/bin/kanagawa-dragon-CbwGXU96.js +0 -1
- package/dist/bin/kanagawa-lotus-DvItD0v_.js +0 -1
- package/dist/bin/kanagawa-wave-7BIcQNHD.js +0 -1
- package/dist/bin/kdl-CGCQY1-0.js +0 -1
- package/dist/bin/kotlin-Babw_olw.js +0 -1
- package/dist/bin/kusto-CrSJ-cBg.js +0 -1
- package/dist/bin/laserwave-D7dCmej9.js +0 -1
- package/dist/bin/latex-BAAvcuYp.js +0 -1
- package/dist/bin/lean-BHhNV2FE.js +0 -1
- package/dist/bin/less-CwsIRTz2.js +0 -1
- package/dist/bin/less-EIhUe2O9.js +0 -1
- package/dist/bin/light-plus-DY08IP0P.js +0 -1
- package/dist/bin/liquid-Bqh7lbg7.js +0 -1
- package/dist/bin/llvm-CnTFl-xP.js +0 -1
- package/dist/bin/log-DWm71oiG.js +0 -1
- package/dist/bin/logo-CSNcrIVD.js +0 -1
- package/dist/bin/lua-BMcOOLRU.js +0 -1
- package/dist/bin/lua-yurtT0y-.js +0 -1
- package/dist/bin/luau-D1AKCLXr.js +0 -1
- package/dist/bin/make-BcNpqY4E.js +0 -1
- package/dist/bin/markdown-BWnBsa8n.js +0 -1
- package/dist/bin/markdown-DVKCeKaE.js +0 -1
- package/dist/bin/marko-R0Qz5H3f.js +0 -1
- package/dist/bin/material-theme-CE5_eJON.js +0 -1
- package/dist/bin/material-theme-darker-D9dePcxU.js +0 -1
- package/dist/bin/material-theme-lighter-mNHXfMW6.js +0 -1
- package/dist/bin/material-theme-ocean-FUMkFnrk.js +0 -1
- package/dist/bin/material-theme-palenight-Byjl0ziV.js +0 -1
- package/dist/bin/matlab-DLY1DdfV.js +0 -1
- package/dist/bin/mdc-K4Wa14qY.js +0 -1
- package/dist/bin/mdx-C15-rtcb.js +0 -1
- package/dist/bin/mermaid-BjiOJq8q.js +0 -1
- package/dist/bin/min-dark-DmJdERaK.js +0 -1
- package/dist/bin/min-light-QnTJyXug.js +0 -1
- package/dist/bin/mipsasm-CKHxalY6.js +0 -1
- package/dist/bin/mojo-C2AiLnrb.js +0 -1
- package/dist/bin/monokai-BlWWERvb.js +0 -1
- package/dist/bin/moonbit-CyDpODU8.js +0 -1
- package/dist/bin/move-DCXtz79I.js +0 -1
- package/dist/bin/narrat-BEsur76A.js +0 -1
- package/dist/bin/nextflow-BFCLGvvZ.js +0 -1
- package/dist/bin/nextflow-groovy-BXH4qERK.js +0 -1
- package/dist/bin/nextflow-groovy-CkcyVHVG.js +0 -1
- package/dist/bin/nginx-Dbalglmi.js +0 -1
- package/dist/bin/night-owl-CQ_y355d.js +0 -1
- package/dist/bin/night-owl-light-9on5aClC.js +0 -1
- package/dist/bin/nim-z_s042OS.js +0 -1
- package/dist/bin/nix-BlkifsNW.js +0 -1
- package/dist/bin/nord-CHhLQxrx.js +0 -1
- package/dist/bin/nushell-CGbyWjqd.js +0 -1
- package/dist/bin/objective-c-DnEgp4sH.js +0 -1
- package/dist/bin/objective-cpp-DA1zjGUh.js +0 -1
- package/dist/bin/ocaml-XKrHblGZ.js +0 -1
- package/dist/bin/odin-CUQeabzv.js +0 -1
- package/dist/bin/one-dark-pro-CPor5xCJ.js +0 -1
- package/dist/bin/one-light-Cs4MmHBp.js +0 -1
- package/dist/bin/openscad-C-pyoaHZ.js +0 -1
- package/dist/bin/pascal-DTg8yr2K.js +0 -1
- package/dist/bin/perl-2YKQo-0l.js +0 -1
- package/dist/bin/perl-Fl9SoTWs.js +0 -1
- package/dist/bin/php-Bo9TDZJt.js +0 -1
- package/dist/bin/php-C0eWpkIO.js +0 -1
- package/dist/bin/pkl-Dmk952a-.js +0 -1
- package/dist/bin/plastic-CKy4gKei.js +0 -1
- package/dist/bin/plsql-DlmRLiy4.js +0 -1
- package/dist/bin/po-nqc2dSM7.js +0 -1
- package/dist/bin/poimandres-BcnQgoA4.js +0 -1
- package/dist/bin/polar-CUas3-Ed.js +0 -1
- package/dist/bin/postcss-CCUr_tF-.js +0 -1
- package/dist/bin/postcss-DsLOvYd_.js +0 -1
- package/dist/bin/powerquery-o8pQIha0.js +0 -1
- package/dist/bin/powershell-DnB_d8z7.js +0 -1
- package/dist/bin/prisma-BhG3Ia_M.js +0 -1
- package/dist/bin/prolog-CxNOQvhU.js +0 -1
- package/dist/bin/proto-CxYQsozc.js +0 -1
- package/dist/bin/pug-DUGDf_q9.js +0 -1
- package/dist/bin/puppet-CYAa5kR2.js +0 -1
- package/dist/bin/purescript-CN27zoMM.js +0 -1
- package/dist/bin/python-DAHUwdu1.js +0 -1
- package/dist/bin/python-Db-ndmZZ.js +0 -1
- package/dist/bin/qml-CPQoc4lh.js +0 -1
- package/dist/bin/qmldir-DK51keAu.js +0 -1
- package/dist/bin/qss-Dz7u-rR1.js +0 -1
- package/dist/bin/r-CqHWlSSM.js +0 -1
- package/dist/bin/r-fQq-2_SC.js +0 -1
- package/dist/bin/racket-COiCIaTN.js +0 -1
- package/dist/bin/raku-0kOHw_dw.js +0 -1
- package/dist/bin/razor-DNawYG-W.js +0 -1
- package/dist/bin/red-m6Euu7mt.js +0 -1
- package/dist/bin/reg-qVlCOoBm.js +0 -1
- package/dist/bin/regexp-D7f8yhPZ.js +0 -1
- package/dist/bin/regexp-YxswBMQR.js +0 -1
- package/dist/bin/rel-CWou97ke.js +0 -1
- package/dist/bin/riscv-DsFkdmj1.js +0 -1
- package/dist/bin/ron-BiFFIB8X.js +0 -1
- package/dist/bin/rose-pine-P4OLTmk8.js +0 -1
- package/dist/bin/rose-pine-dawn-Bjp9OAsX.js +0 -1
- package/dist/bin/rose-pine-moon-BDOjeUMF.js +0 -1
- package/dist/bin/rosmsg-C8-G6Zy3.js +0 -1
- package/dist/bin/rst-DYfDFbA3.js +0 -1
- package/dist/bin/ruby-DucPskDY.js +0 -1
- package/dist/bin/ruby-WBenXl3j.js +0 -1
- package/dist/bin/rust-8VLxkvbI.js +0 -1
- package/dist/bin/sas-CAA8PJ6W.js +0 -1
- package/dist/bin/sass-CAZlzDYO.js +0 -1
- package/dist/bin/scala-CNeLcgeU.js +0 -1
- package/dist/bin/scheme-DM0dV7X-.js +0 -1
- package/dist/bin/scss-DsPnGUE-.js +0 -1
- package/dist/bin/scss-gssODMF6.js +0 -1
- package/dist/bin/sdbl-D91Q0-P-.js +0 -1
- package/dist/bin/sdbl-xOqMdGXn.js +0 -1
- package/dist/bin/shaderlab-DgQHun4U.js +0 -1
- package/dist/bin/shellscript-C3cZBHq3.js +0 -1
- package/dist/bin/shellscript-CE_I727X.js +0 -1
- package/dist/bin/shellsession-lr0Ayolf.js +0 -1
- package/dist/bin/slack-dark-D3icvwba.js +0 -1
- package/dist/bin/slack-ochin-HRbhvypv.js +0 -1
- package/dist/bin/smalltalk-CaV7xkpe.js +0 -1
- package/dist/bin/snazzy-light-DH6eOZ8E.js +0 -1
- package/dist/bin/solarized-dark-CyUppETu.js +0 -1
- package/dist/bin/solarized-light-CUG32Y3B.js +0 -1
- package/dist/bin/solidity-CUUGhfh7.js +0 -1
- package/dist/bin/soy-CvtaBVSX.js +0 -1
- package/dist/bin/sparql-C2NKB4nB.js +0 -1
- package/dist/bin/splunk-D3BNLPbA.js +0 -1
- package/dist/bin/sql-BBjVgCWI.js +0 -1
- package/dist/bin/sql-k-FO79OG.js +0 -1
- package/dist/bin/ssh-config-DSA-oRqW.js +0 -1
- package/dist/bin/stata-CxUtssUq.js +0 -1
- package/dist/bin/stylus-B8GmhT3T.js +0 -1
- package/dist/bin/stylus-BjHmFbLS.js +0 -1
- package/dist/bin/surrealql-UeEcHssQ.js +0 -1
- package/dist/bin/svelte-biVT5zcD.js +0 -1
- package/dist/bin/swift-B3Og23RF.js +0 -1
- package/dist/bin/synthwave-84-BQqBrmUY.js +0 -1
- package/dist/bin/system-verilog-lZv4orfV.js +0 -1
- package/dist/bin/systemd-C_lHKyyv.js +0 -1
- package/dist/bin/talonscript-BgSK8iKj.js +0 -1
- package/dist/bin/tasl-CfJEvNyg.js +0 -1
- package/dist/bin/tcl-_6WfXxa8.js +0 -1
- package/dist/bin/templ-BYYVc90I.js +0 -1
- package/dist/bin/terraform-CvaKdwhe.js +0 -1
- package/dist/bin/tex-C2t_GUxi.js +0 -1
- package/dist/bin/tex-bdKBkGZu.js +0 -1
- package/dist/bin/tokyo-night-Dxn9nxCt.js +0 -1
- package/dist/bin/toml-C2IeULXW.js +0 -1
- package/dist/bin/ts-tags-BfYDhMLE.js +0 -1
- package/dist/bin/tsv-upWrMxDX.js +0 -1
- package/dist/bin/tsx-BVj7RLM1.js +0 -1
- package/dist/bin/tsx-CqFEeXnl.js +0 -1
- package/dist/bin/turtle-D8pw025F.js +0 -1
- package/dist/bin/turtle-OfMAFnDU.js +0 -1
- package/dist/bin/twig-CwzAgcmH.js +0 -1
- package/dist/bin/typescript-DNgWo8f4.js +0 -1
- package/dist/bin/typescript-QhLgbiI3.js +0 -1
- package/dist/bin/typespec-Cl5YolbG.js +0 -1
- package/dist/bin/typst-B0bxD-3R.js +0 -1
- package/dist/bin/v-DgtEGhmc.js +0 -1
- package/dist/bin/vala-X9RAnsG9.js +0 -1
- package/dist/bin/vb-B8fi0ef3.js +0 -1
- package/dist/bin/verilog-9KNl_vs0.js +0 -1
- package/dist/bin/vesper-BUDildQy.js +0 -1
- package/dist/bin/vhdl-Ex4Tk_Q4.js +0 -1
- package/dist/bin/viml-9TyT6AIR.js +0 -1
- package/dist/bin/vitesse-black-BLDFwo2e.js +0 -1
- package/dist/bin/vitesse-dark-B7cKn6BQ.js +0 -1
- package/dist/bin/vitesse-light-Cxpku45l.js +0 -1
- package/dist/bin/vue-DRO7KWbH.js +0 -1
- package/dist/bin/vue-html-BpQ6tiBD.js +0 -1
- package/dist/bin/vue-vine-BoHGuuLM.js +0 -1
- package/dist/bin/vyper-DlDvdFHA.js +0 -1
- package/dist/bin/wasm-BJM1CVhc.js +0 -1
- package/dist/bin/wasm-CgH-dZ_Q.js +0 -1
- package/dist/bin/wenyan-cHQHBRol.js +0 -1
- package/dist/bin/wgsl-BGXNRVfe.js +0 -1
- package/dist/bin/wikitext-B_NAdate.js +0 -1
- package/dist/bin/wit-DpEeRzSj.js +0 -1
- package/dist/bin/wolfram-FezxoFHC.js +0 -1
- package/dist/bin/xml-CfpLAPLz.js +0 -1
- package/dist/bin/xml-DDPMLAMm.js +0 -1
- package/dist/bin/xsl-BEetQfvy.js +0 -1
- package/dist/bin/yaml-IgZurznZ.js +0 -1
- package/dist/bin/yaml-OQyYPsei.js +0 -1
- package/dist/bin/zenscript-BSSNIKM2.js +0 -1
- package/dist/bin/zig-DO_pxwRi.js +0 -1
- package/dist/standalone/abap-lNEwo1Fh.js +0 -1
- package/dist/standalone/actionscript-3-BaFy4IUl.js +0 -1
- package/dist/standalone/ada-HceTT-Hk.js +0 -1
- package/dist/standalone/andromeeda-Drn3I52d.js +0 -1
- package/dist/standalone/angular-html-WQX9Y2mw.js +0 -1
- package/dist/standalone/angular-ts-Bnj08IE9.js +0 -1
- package/dist/standalone/apache-UvT67k7r.js +0 -1
- package/dist/standalone/apex-C-zVKAtI.js +0 -1
- package/dist/standalone/apl-Dqn1qSR2.js +0 -1
- package/dist/standalone/applescript-CUUTxpqG.js +0 -1
- package/dist/standalone/ara-DXe565Eb.js +0 -1
- package/dist/standalone/asciidoc-y8iYfg5t.js +0 -1
- package/dist/standalone/asm-FONT_MzT.js +0 -1
- package/dist/standalone/astro-CQ8up1JW.js +0 -1
- package/dist/standalone/aurora-x-CbSRhEG_.js +0 -1
- package/dist/standalone/awk-C1Xf3NCS.js +0 -1
- package/dist/standalone/ayu-dark-DUKhGG9M.js +0 -1
- package/dist/standalone/ayu-light-zq1IImlB.js +0 -1
- package/dist/standalone/ayu-mirage-C0t0AhQz.js +0 -1
- package/dist/standalone/ballerina-CtqZ90g_.js +0 -1
- package/dist/standalone/bat-u_XFPZwF.js +0 -1
- package/dist/standalone/beancount-gCaRbBDP.js +0 -1
- package/dist/standalone/berry-v4FqJ4ET.js +0 -1
- package/dist/standalone/bibtex-6NwGpUZD.js +0 -1
- package/dist/standalone/bicep-CA2puXK8.js +0 -1
- package/dist/standalone/bird2-DqiG7xuw.js +0 -1
- package/dist/standalone/blade-CygzwZSe.js +0 -1
- package/dist/standalone/bsl-BpGgGeZC.js +0 -1
- package/dist/standalone/c-CUtwC4Mj.js +0 -1
- package/dist/standalone/c3-Ce3JALMQ.js +0 -1
- package/dist/standalone/cadence-bRc3mSPd.js +0 -1
- package/dist/standalone/cairo-r1f5WYPg.js +0 -1
- package/dist/standalone/catppuccin-frappe-Ck2c3Ir7.js +0 -1
- package/dist/standalone/catppuccin-latte-vbplB5Zo.js +0 -1
- package/dist/standalone/catppuccin-macchiato-Bl8WMzwO.js +0 -1
- package/dist/standalone/catppuccin-mocha-kN0Ta6g1.js +0 -1
- package/dist/standalone/clarity-BFCwqYZP.js +0 -1
- package/dist/standalone/clojure-VpUVxvc9.js +0 -1
- package/dist/standalone/cmake-C9OlSQmP.js +0 -1
- package/dist/standalone/cobol-B8Vke0Of.js +0 -1
- package/dist/standalone/codeowners-BRS2WD7U.js +0 -1
- package/dist/standalone/codeql-Bbt3c-53.js +0 -1
- package/dist/standalone/coffee-Cc6XxMHI.js +0 -1
- package/dist/standalone/common-lisp-BvU0WGaz.js +0 -1
- package/dist/standalone/coq-CYNX735i.js +0 -1
- package/dist/standalone/cpp-COjeSwn8.js +0 -1
- package/dist/standalone/crystal-14bSZvxG.js +0 -1
- package/dist/standalone/csharp-DEz-wF3L.js +0 -1
- package/dist/standalone/css-0fme0D-h.js +0 -1
- package/dist/standalone/csv-CwVLIGRx.js +0 -1
- package/dist/standalone/cue-BAFnez9U.js +0 -1
- package/dist/standalone/cypher-ByMDbfJE.js +0 -1
- package/dist/standalone/d-Bj_XxJbi.js +0 -1
- package/dist/standalone/dark-plus-BxwPW2PO.js +0 -1
- package/dist/standalone/dart-WAvmL6i0.js +0 -1
- package/dist/standalone/dax-CN15Ir6v.js +0 -1
- package/dist/standalone/desktop-Blw5nWNd.js +0 -1
- package/dist/standalone/diff-DnSAa7YV.js +0 -1
- package/dist/standalone/docker-CrBT4uQ5.js +0 -1
- package/dist/standalone/dotenv-B3TKMiE2.js +0 -1
- package/dist/standalone/dracula-DDAawnm1.js +0 -1
- package/dist/standalone/dracula-soft-B6l93y6r.js +0 -1
- package/dist/standalone/dream-maker-0xoAwu9F.js +0 -1
- package/dist/standalone/edge-C4RY6CZu.js +0 -1
- package/dist/standalone/elixir-BpoXFRn8.js +0 -1
- package/dist/standalone/elm-B6bFr4e_.js +0 -1
- package/dist/standalone/emacs-lisp-BYwwOo2e.js +0 -1
- package/dist/standalone/erb-CJHKFDY_.js +0 -1
- package/dist/standalone/erlang-CI6aeixR.js +0 -1
- package/dist/standalone/everforest-dark-uqvKxCLa.js +0 -1
- package/dist/standalone/everforest-light-Bgi4okNs.js +0 -1
- package/dist/standalone/fennel-CDz99RXZ.js +0 -1
- package/dist/standalone/fish-BWVO9Ijr.js +0 -1
- package/dist/standalone/fluent-SYyPuB0x.js +0 -1
- package/dist/standalone/fortran-fixed-form-uKGwTJjf.js +0 -1
- package/dist/standalone/fortran-free-form-Cvm5N8AW.js +0 -1
- package/dist/standalone/fsharp-CASMX8mg.js +0 -1
- package/dist/standalone/gdresource-CJ9IjTdR.js +0 -1
- package/dist/standalone/gdscript-DVPR-jwA.js +0 -1
- package/dist/standalone/gdshader-DKg6VZob.js +0 -1
- package/dist/standalone/genie-CnxW4Aei.js +0 -1
- package/dist/standalone/gherkin-Ba85ScdA.js +0 -1
- package/dist/standalone/git-commit-CzSqi32T.js +0 -1
- package/dist/standalone/git-rebase-8fT5ziFE.js +0 -1
- package/dist/standalone/github-dark-CUBA-q-0.js +0 -1
- package/dist/standalone/github-dark-default-C6xZFMUm.js +0 -1
- package/dist/standalone/github-dark-dimmed-BrWMwSTm.js +0 -1
- package/dist/standalone/github-dark-high-contrast-BwsS_67p.js +0 -1
- package/dist/standalone/github-light-C3_GirKd.js +0 -1
- package/dist/standalone/github-light-default-DSvSOSFj.js +0 -1
- package/dist/standalone/github-light-high-contrast-D-cuyaxK.js +0 -1
- package/dist/standalone/gleam-BK_CIoct.js +0 -1
- package/dist/standalone/glimmer-js-DWfa8dIU.js +0 -1
- package/dist/standalone/glimmer-ts-DnQuWFQ4.js +0 -1
- package/dist/standalone/glsl-BL_YD74S.js +0 -1
- package/dist/standalone/gn-C_iz9Wbo.js +0 -1
- package/dist/standalone/gnuplot-DXHAMx9j.js +0 -1
- package/dist/standalone/go-ChiWKuTz.js +0 -1
- package/dist/standalone/graphql-Clgp8jU8.js +0 -1
- package/dist/standalone/groovy-CPhve-3q.js +0 -1
- package/dist/standalone/gruvbox-dark-hard-DwraziE-.js +0 -1
- package/dist/standalone/gruvbox-dark-medium-tN06WFx5.js +0 -1
- package/dist/standalone/gruvbox-dark-soft-BRDrk-Jk.js +0 -1
- package/dist/standalone/gruvbox-light-hard-BUtBEr5w.js +0 -1
- package/dist/standalone/gruvbox-light-medium-BDydPOJI.js +0 -1
- package/dist/standalone/gruvbox-light-soft-B6sZTVCC.js +0 -1
- package/dist/standalone/hack-C9FDVZ3F.js +0 -1
- package/dist/standalone/haml-Bzme-jHN.js +0 -1
- package/dist/standalone/handlebars-CBJ4eJ41.js +0 -1
- package/dist/standalone/haskell-BZidAwBv.js +0 -1
- package/dist/standalone/haxe-7LrSSm24.js +0 -1
- package/dist/standalone/hcl-B89HlRT6.js +0 -1
- package/dist/standalone/hjson--1iec2mk.js +0 -1
- package/dist/standalone/hlsl-ys6eD8k3.js +0 -1
- package/dist/standalone/horizon-DHDEy49h.js +0 -1
- package/dist/standalone/horizon-bright-DI78Rvup.js +0 -1
- package/dist/standalone/houston-C2UUgkcj.js +0 -1
- package/dist/standalone/html-CdYAzs3O.js +0 -1
- package/dist/standalone/html-derivative-CTfvg-k9.js +0 -1
- package/dist/standalone/http-DtJ6xqmi.js +0 -1
- package/dist/standalone/hurl-DVOcDWDo.js +0 -1
- package/dist/standalone/hxml-CUgBPRa1.js +0 -1
- package/dist/standalone/hy-DfDp0LOu.js +0 -1
- package/dist/standalone/imba-5rlinXsS.js +0 -1
- package/dist/standalone/ini-Dvl7p4fh.js +0 -1
- package/dist/standalone/java-De0U3342.js +0 -1
- package/dist/standalone/javascript-CnBrVnUh.js +0 -1
- package/dist/standalone/jinja-SiVN3EPo.js +0 -1
- package/dist/standalone/jison-Cxwzm23V.js +0 -1
- package/dist/standalone/json-DW5QMcCj.js +0 -1
- package/dist/standalone/json5-B92atw3l.js +0 -1
- package/dist/standalone/jsonc-BQ8btgHR.js +0 -1
- package/dist/standalone/jsonl-Sr_oGeX-.js +0 -1
- package/dist/standalone/jsonnet-CLmJlxUC.js +0 -1
- package/dist/standalone/jssm-DnM8i8ut.js +0 -1
- package/dist/standalone/jsx-BLpri0NB.js +0 -1
- package/dist/standalone/julia-BOYqvvvj.js +0 -1
- package/dist/standalone/just-IvSacbqb.js +0 -1
- package/dist/standalone/kanagawa-dragon-Rl17Vq_C.js +0 -1
- package/dist/standalone/kanagawa-lotus-CEfzoMAY.js +0 -1
- package/dist/standalone/kanagawa-wave-Dl5jL6TY.js +0 -1
- package/dist/standalone/kdl-ByebaTOR.js +0 -1
- package/dist/standalone/kotlin-CO_7ebqK.js +0 -1
- package/dist/standalone/kusto-DD1r27tX.js +0 -1
- package/dist/standalone/laserwave-BymGJYS7.js +0 -1
- package/dist/standalone/latex-DGWWRHT_.js +0 -1
- package/dist/standalone/lean-D7q_Kpgv.js +0 -1
- package/dist/standalone/less-DfGpr34i.js +0 -1
- package/dist/standalone/light-plus-rCHX6NNy.js +0 -1
- package/dist/standalone/liquid-LYfo5SDA.js +0 -1
- package/dist/standalone/llvm-DI83sH5G.js +0 -1
- package/dist/standalone/log-GjieA_Fi.js +0 -1
- package/dist/standalone/logo-Z-Po9cqr.js +0 -1
- package/dist/standalone/lua-2gNjm8zw.js +0 -1
- package/dist/standalone/luau-CHFvY7vV.js +0 -1
- package/dist/standalone/make-pEFeZerG.js +0 -1
- package/dist/standalone/markdown-BLxfK9DH.js +0 -1
- package/dist/standalone/marko-U21Fnozx.js +0 -1
- package/dist/standalone/material-theme-_mO8dGF4.js +0 -1
- package/dist/standalone/material-theme-darker-CW8WbBMR.js +0 -1
- package/dist/standalone/material-theme-lighter-DWGtW3Sj.js +0 -1
- package/dist/standalone/material-theme-ocean-VhkfqVVF.js +0 -1
- package/dist/standalone/material-theme-palenight-cApQ4-KF.js +0 -1
- package/dist/standalone/matlab-L7fpDsTl.js +0 -1
- package/dist/standalone/mdc-C13-zRpl.js +0 -1
- package/dist/standalone/mdx-G_CG82jO.js +0 -1
- package/dist/standalone/mermaid-QCKf3Ptj.js +0 -1
- package/dist/standalone/min-dark-C7ciBb2i.js +0 -1
- package/dist/standalone/min-light-DC6qyE0O.js +0 -1
- package/dist/standalone/mipsasm-Ch_J_goG.js +0 -1
- package/dist/standalone/mojo-BUTjyOde.js +0 -1
- package/dist/standalone/monokai-D99JixW5.js +0 -1
- package/dist/standalone/moonbit-v_Wmuq4r.js +0 -1
- package/dist/standalone/move-CujRAOrk.js +0 -1
- package/dist/standalone/narrat-BUFChaaW.js +0 -1
- package/dist/standalone/nextflow-ClSSDbXV.js +0 -1
- package/dist/standalone/nextflow-groovy-BmdTtAtJ.js +0 -1
- package/dist/standalone/nginx-DphzlDyZ.js +0 -1
- package/dist/standalone/night-owl-light-ZvY_o4AV.js +0 -1
- package/dist/standalone/night-owl-zFbR0iUq.js +0 -1
- package/dist/standalone/nim-D01gBmZb.js +0 -1
- package/dist/standalone/nix-DVHO39rw.js +0 -1
- package/dist/standalone/nord-CSYW7zq7.js +0 -1
- package/dist/standalone/nushell-wvafmaI1.js +0 -1
- package/dist/standalone/objective-c-BJMjPSKt.js +0 -1
- package/dist/standalone/objective-cpp-COwkzZNW.js +0 -1
- package/dist/standalone/ocaml-BugjlZwQ.js +0 -1
- package/dist/standalone/odin-BbI_ip3y.js +0 -1
- package/dist/standalone/one-dark-pro-O7XwserV.js +0 -1
- package/dist/standalone/one-light-Bv2B3pGW.js +0 -1
- package/dist/standalone/openscad-CYP3kDCW.js +0 -1
- package/dist/standalone/pascal-DzRWzYc7.js +0 -1
- package/dist/standalone/perl-CuZPLwLm.js +0 -1
- package/dist/standalone/php-c2mqHOa5.js +0 -1
- package/dist/standalone/pkl-Csk3Pz3F.js +0 -1
- package/dist/standalone/plastic-B8sPQcwq.js +0 -1
- package/dist/standalone/plsql-DHpuTJ3X.js +0 -1
- package/dist/standalone/po-BlTn26iX.js +0 -1
- package/dist/standalone/poimandres-Nn-UO8qp.js +0 -1
- package/dist/standalone/polar-DEMP0iHG.js +0 -1
- package/dist/standalone/postcss-B3SVlKZw.js +0 -1
- package/dist/standalone/powerquery-DuUdfu4q.js +0 -1
- package/dist/standalone/powershell-CB3_ElnE.js +0 -1
- package/dist/standalone/prisma-BxeT-Y5M.js +0 -1
- package/dist/standalone/prolog-BxrMgyN9.js +0 -1
- package/dist/standalone/proto-Dek-exro.js +0 -1
- package/dist/standalone/pug-C3IdK9Vd.js +0 -1
- package/dist/standalone/puppet-C16HFbnX.js +0 -1
- package/dist/standalone/purescript-C73JvxLF.js +0 -1
- package/dist/standalone/python-DFvGjTfU.js +0 -1
- package/dist/standalone/qml-CGE-rgGq.js +0 -1
- package/dist/standalone/qmldir-D2UzrXvk.js +0 -1
- package/dist/standalone/qss-CyPgAzDy.js +0 -1
- package/dist/standalone/r-BTPLa6iH.js +0 -1
- package/dist/standalone/racket-BaoaiPkO.js +0 -1
- package/dist/standalone/raku-BsUkgPqO.js +0 -1
- package/dist/standalone/razor-DjuaA8CM.js +0 -1
- package/dist/standalone/red-CCJAPkdg.js +0 -1
- package/dist/standalone/reg-DOi1ALwl.js +0 -1
- package/dist/standalone/regexp-cogjKOiz.js +0 -1
- package/dist/standalone/rel-Y9vyrCmO.js +0 -1
- package/dist/standalone/riscv-C9NE9rlt.js +0 -1
- package/dist/standalone/ron-uMa_rbSR.js +0 -1
- package/dist/standalone/rose-pine-B6wSIDAC.js +0 -1
- package/dist/standalone/rose-pine-dawn-CalFuemK.js +0 -1
- package/dist/standalone/rose-pine-moon-BS44sctL.js +0 -1
- package/dist/standalone/rosmsg-ncCRrAah.js +0 -1
- package/dist/standalone/rst-CYE4T0LV.js +0 -1
- package/dist/standalone/ruby-Cs80OLeO.js +0 -1
- package/dist/standalone/rust-D__ScB18.js +0 -1
- package/dist/standalone/sas-CrQDddD2.js +0 -1
- package/dist/standalone/sass-Dcwwxgkc.js +0 -1
- package/dist/standalone/scala-qMGqTQGj.js +0 -1
- package/dist/standalone/scheme-BUvagZbg.js +0 -1
- package/dist/standalone/scss-C9pn4GwM.js +0 -1
- package/dist/standalone/sdbl-CdI9Io2f.js +0 -1
- package/dist/standalone/shaderlab-DhVgk0F4.js +0 -1
- package/dist/standalone/shellscript-CLNzcEEH.js +0 -1
- package/dist/standalone/shellsession-B3JdqBVn.js +0 -1
- package/dist/standalone/slack-dark-CZWNFbAj.js +0 -1
- package/dist/standalone/slack-ochin-CcsRSPGb.js +0 -1
- package/dist/standalone/smalltalk-CkHsb-ck.js +0 -1
- package/dist/standalone/snazzy-light-Cm_pY2Ne.js +0 -1
- package/dist/standalone/solarized-dark-EVcpLOPz.js +0 -1
- package/dist/standalone/solarized-light-BGmOwKbi.js +0 -1
- package/dist/standalone/solidity-DcmwFsmZ.js +0 -1
- package/dist/standalone/soy-BezrirVf.js +0 -1
- package/dist/standalone/sparql-BVgWJlnd.js +0 -1
- package/dist/standalone/splunk-BAf42Kh3.js +0 -1
- package/dist/standalone/sql-OpUJ1H7b.js +0 -1
- package/dist/standalone/ssh-config-DTZY5LJQ.js +0 -1
- package/dist/standalone/stata-H0pnFm1o.js +0 -1
- package/dist/standalone/stylus-CHp-rBJx.js +0 -1
- package/dist/standalone/surrealql-DIXH8vKD.js +0 -1
- package/dist/standalone/svelte-BTt1OQ0v.js +0 -1
- package/dist/standalone/swift-DjfAKDlq.js +0 -1
- package/dist/standalone/synthwave-84-B5y6dw6I.js +0 -1
- package/dist/standalone/system-verilog-CstGBDHm.js +0 -1
- package/dist/standalone/systemd-CV0H8W0r.js +0 -1
- package/dist/standalone/talonscript-BfJo0mzd.js +0 -1
- package/dist/standalone/tasl-CbFmChTU.js +0 -1
- package/dist/standalone/tcl-DNn0b4Xi.js +0 -1
- package/dist/standalone/templ-BSHIRmzI.js +0 -1
- package/dist/standalone/terraform-C-5xJLZK.js +0 -1
- package/dist/standalone/tex-BjwG_oxA.js +0 -1
- package/dist/standalone/tokyo-night-DwP487HJ.js +0 -1
- package/dist/standalone/toml-BUQbhfId.js +0 -1
- package/dist/standalone/ts-tags-Cp9pA_As.js +0 -1
- package/dist/standalone/tsv-DboMNYlp.js +0 -1
- package/dist/standalone/tsx-D_ZL21a1.js +0 -1
- package/dist/standalone/turtle-ep-yDHHJ.js +0 -1
- package/dist/standalone/twig-BX08EwMF.js +0 -1
- package/dist/standalone/typescript-DLmRjE2H.js +0 -1
- package/dist/standalone/typespec-BM547vOZ.js +0 -1
- package/dist/standalone/typst-OK3ZsbAS.js +0 -1
- package/dist/standalone/v-BRzbo0xa.js +0 -1
- package/dist/standalone/vala-DajMRXrp.js +0 -1
- package/dist/standalone/vb-Cp5p1BHA.js +0 -1
- package/dist/standalone/verilog-Karwuy7m.js +0 -1
- package/dist/standalone/vesper-D8EI4h-P.js +0 -1
- package/dist/standalone/vhdl-BWVkbJap.js +0 -1
- package/dist/standalone/viml-D006eITo.js +0 -1
- package/dist/standalone/vitesse-black-CiyuYPYv.js +0 -1
- package/dist/standalone/vitesse-dark-DF1BoauX.js +0 -1
- package/dist/standalone/vitesse-light-BkWBILrw.js +0 -1
- package/dist/standalone/vue-BRMpKK6E.js +0 -1
- package/dist/standalone/vue-html-BZjQbgy2.js +0 -1
- package/dist/standalone/vue-vine-G3wsxe4j.js +0 -1
- package/dist/standalone/vyper-pqGBEKo6.js +0 -1
- package/dist/standalone/wasm-BNcVSub7.js +0 -1
- package/dist/standalone/wasm-BoWtZ2Hg.js +0 -1
- package/dist/standalone/wenyan-B1aPQ0e8.js +0 -1
- package/dist/standalone/wgsl-MFrJo5Av.js +0 -1
- package/dist/standalone/wikitext-Bam7iWkE.js +0 -1
- package/dist/standalone/wit-RYUlqdwx.js +0 -1
- package/dist/standalone/wolfram-BAx02ysC.js +0 -1
- package/dist/standalone/xml-D0UfBFEi.js +0 -1
- package/dist/standalone/xsl-DB3rrNcL.js +0 -1
- package/dist/standalone/yaml-BipAacI9.js +0 -1
- package/dist/standalone/zenscript-BidEsPSr.js +0 -1
- package/dist/standalone/zig-DRQ1gulu.js +0 -1
- /package/dist/bin/{open-B4GJGp_X.js → open-CC1xuL9n.js} +0 -0
- /package/dist/standalone/{open-BpEGCZtV.js → open-DsJJlGt1.js} +0 -0
package/dist/lib/index.js
CHANGED
|
@@ -2,13 +2,45 @@ import { deepmerge } from "deepmerge-ts";
|
|
|
2
2
|
import plur from "plur";
|
|
3
3
|
import prettyMilliseconds from "pretty-ms";
|
|
4
4
|
import { YankiConnect, defaultYankiConnectOptions } from "yanki-connect";
|
|
5
|
-
import
|
|
5
|
+
import bash from "@shikijs/langs/bash";
|
|
6
|
+
import c from "@shikijs/langs/c";
|
|
7
|
+
import cpp from "@shikijs/langs/cpp";
|
|
8
|
+
import css from "@shikijs/langs/css";
|
|
9
|
+
import diff from "@shikijs/langs/diff";
|
|
10
|
+
import dockerfile from "@shikijs/langs/dockerfile";
|
|
11
|
+
import go from "@shikijs/langs/go";
|
|
12
|
+
import html from "@shikijs/langs/html";
|
|
13
|
+
import java from "@shikijs/langs/java";
|
|
14
|
+
import javascript from "@shikijs/langs/javascript";
|
|
15
|
+
import json from "@shikijs/langs/json";
|
|
16
|
+
import jsx from "@shikijs/langs/jsx";
|
|
17
|
+
import kotlin from "@shikijs/langs/kotlin";
|
|
18
|
+
import markdown from "@shikijs/langs/markdown";
|
|
19
|
+
import php from "@shikijs/langs/php";
|
|
20
|
+
import python from "@shikijs/langs/python";
|
|
21
|
+
import regex from "@shikijs/langs/regex";
|
|
22
|
+
import ruby from "@shikijs/langs/ruby";
|
|
23
|
+
import rust from "@shikijs/langs/rust";
|
|
24
|
+
import scss from "@shikijs/langs/scss";
|
|
25
|
+
import shellscript from "@shikijs/langs/shellscript";
|
|
26
|
+
import sql from "@shikijs/langs/sql";
|
|
27
|
+
import swift from "@shikijs/langs/swift";
|
|
28
|
+
import toml from "@shikijs/langs/toml";
|
|
29
|
+
import tsx from "@shikijs/langs/tsx";
|
|
30
|
+
import typescript from "@shikijs/langs/typescript";
|
|
31
|
+
import xml from "@shikijs/langs/xml";
|
|
32
|
+
import yaml from "@shikijs/langs/yaml";
|
|
33
|
+
import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
|
|
34
|
+
import githubDark from "@shikijs/themes/github-dark";
|
|
35
|
+
import githubLight from "@shikijs/themes/github-light";
|
|
6
36
|
import { toText } from "hast-util-to-text";
|
|
7
37
|
import rehypeFormat from "rehype-format";
|
|
8
38
|
import rehypeParse from "rehype-parse";
|
|
9
39
|
import rehypeRaw from "rehype-raw";
|
|
10
40
|
import rehypeStringify from "rehype-stringify";
|
|
11
41
|
import remarkRehype from "remark-rehype";
|
|
42
|
+
import { createHighlighterCore } from "shiki/core";
|
|
43
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
12
44
|
import { unified } from "unified";
|
|
13
45
|
import { u } from "unist-builder";
|
|
14
46
|
import { CONTINUE, EXIT, SKIP, visit } from "unist-util-visit";
|
|
@@ -42,10 +74,13 @@ function capitalize(text) {
|
|
|
42
74
|
* Truncates on word boundary and adds ellipsis. Does not give special treatment
|
|
43
75
|
* to file extensions. If there are no spaces in the text, it will truncate at
|
|
44
76
|
* `maxLength` without respect for word boundaries.
|
|
77
|
+
*
|
|
45
78
|
* @param text Text to truncate
|
|
46
79
|
* @param maxLength Maximum length excluding ellipsis
|
|
47
80
|
* @param truncationString String to append to truncated text. Defaults to '...'
|
|
48
|
-
* @param wordBoundary Character to consider a word boundary. Defaults to a
|
|
81
|
+
* @param wordBoundary Character to consider a word boundary. Defaults to a
|
|
82
|
+
* space.
|
|
83
|
+
*
|
|
49
84
|
* @returns Truncated string
|
|
50
85
|
*/
|
|
51
86
|
function truncateOnWordBoundary(text, maxLength, truncationString = "...", wordBoundary = " ") {
|
|
@@ -63,10 +98,12 @@ function emptyIsUndefined(text) {
|
|
|
63
98
|
return text.trim() === "" ? void 0 : text;
|
|
64
99
|
}
|
|
65
100
|
/**
|
|
66
|
-
* Mainly for nice formatting with prettier. But the line wrapping means we have
|
|
101
|
+
* Mainly for nice formatting with prettier. But the line wrapping means we have
|
|
102
|
+
* to strip surplus whitespace.
|
|
103
|
+
*
|
|
67
104
|
* @public
|
|
68
105
|
*/
|
|
69
|
-
function css(strings, ...values) {
|
|
106
|
+
function css$1(strings, ...values) {
|
|
70
107
|
return trimLeadingIndentation(strings, ...values);
|
|
71
108
|
}
|
|
72
109
|
const NEWLINE_REGEX$1 = /\r?\n/;
|
|
@@ -86,10 +123,12 @@ function splitAtFirstMatch(text, regex) {
|
|
|
86
123
|
//#endregion
|
|
87
124
|
//#region src/lib/shared/constants.ts
|
|
88
125
|
/**
|
|
89
|
-
* The default CSS to use for cards. This matches Anki's default. Stored in the
|
|
90
|
-
*
|
|
126
|
+
* The default CSS to use for cards. This matches Anki's default. Stored in the
|
|
127
|
+
* Yanki card models and shared across all Yanki-managed notes regardless of
|
|
128
|
+
* namespace. It does change occasionally, see
|
|
129
|
+
* https://github.com/ankitects/anki/blob/main/rslib/src/notetype/styling.css
|
|
91
130
|
*/
|
|
92
|
-
const CSS_DEFAULT_STYLE = css`
|
|
131
|
+
const CSS_DEFAULT_STYLE = css$1`
|
|
93
132
|
.card {
|
|
94
133
|
font-family: arial;
|
|
95
134
|
font-size: 20px;
|
|
@@ -100,7 +139,8 @@ const CSS_DEFAULT_STYLE = css`
|
|
|
100
139
|
}
|
|
101
140
|
`;
|
|
102
141
|
/**
|
|
103
|
-
* CSS class to always include in a top-level div wrapper in the card template
|
|
142
|
+
* CSS class to always include in a top-level div wrapper in the card template
|
|
143
|
+
* to allow for custom styling.
|
|
104
144
|
*/
|
|
105
145
|
const CSS_DEFAULT_CLASS_NAME = "yanki";
|
|
106
146
|
/**
|
|
@@ -110,12 +150,13 @@ const CSS_DEFAULT_CLASS_NAME = "yanki";
|
|
|
110
150
|
*/
|
|
111
151
|
const NOTE_DEFAULT_DECK_NAME = "Yanki";
|
|
112
152
|
/**
|
|
113
|
-
* Text to show if a note 'Front' field is empty, and content is required for a
|
|
153
|
+
* Text to show if a note 'Front' field is empty, and content is required for a
|
|
154
|
+
* semantically valid card.
|
|
114
155
|
*/
|
|
115
156
|
const NOTE_DEFAULT_EMPTY_TEXT = "(Empty)";
|
|
116
157
|
/**
|
|
117
|
-
* HTML element to use to present `NOTE_DEFAULT_EMPTY_TEXT`.
|
|
118
|
-
*
|
|
158
|
+
* HTML element to use to present `NOTE_DEFAULT_EMPTY_TEXT`. TODO consider
|
|
159
|
+
* hidden span?
|
|
119
160
|
*/
|
|
120
161
|
const NOTE_DEFAULT_EMPTY_HAST = u("element", {
|
|
121
162
|
properties: {},
|
|
@@ -130,19 +171,23 @@ const MEDIA_DEFAULT_HASH_MODE_URL = "metadata";
|
|
|
130
171
|
* How to first attempt to infer the asset type behind a URL.
|
|
131
172
|
*
|
|
132
173
|
* - `metadata`: Fetch the head and hope for a `Content-Type` header.
|
|
133
|
-
* - `name`: Infer the extension from the URL alone, won't work if there's nothing
|
|
174
|
+
* - `name`: Infer the extension from the URL alone, won't work if there's nothing
|
|
175
|
+
* extension-like in the `pathname`.
|
|
134
176
|
*/
|
|
135
177
|
const MEDIA_URL_CONTENT_TYPE_MODE = "metadata";
|
|
136
178
|
/**
|
|
137
|
-
* Filename to use when a media asset has no name. Will be appended with counter
|
|
179
|
+
* Filename to use when a media asset has no name. Will be appended with counter
|
|
180
|
+
* parenthetical as needed.
|
|
138
181
|
*/
|
|
139
182
|
const MEDIA_DEFAULT_EMPTY_FILENAME = "Untitled";
|
|
140
183
|
/**
|
|
141
184
|
* Supported image extensions for Anki media assets.
|
|
142
185
|
*
|
|
143
|
-
* Note that while officially "supported", some of these are not universally
|
|
186
|
+
* Note that while officially "supported", some of these are not universally
|
|
187
|
+
* compatible across Anki platforms.
|
|
144
188
|
*
|
|
145
|
-
* Via
|
|
189
|
+
* Via
|
|
190
|
+
* https://github.com/ankitects/anki/blob/e41c4573d789afe8b020fab5d9d1eede50c3fa3d/qt/aqt/editor.py#L62
|
|
146
191
|
*/
|
|
147
192
|
const MEDIA_SUPPORTED_IMAGE_EXTENSIONS = [
|
|
148
193
|
"avif",
|
|
@@ -360,7 +405,8 @@ const FORBIDDEN_CHARACTERS = [
|
|
|
360
405
|
];
|
|
361
406
|
/**
|
|
362
407
|
* Convenience
|
|
363
|
-
*
|
|
408
|
+
*
|
|
409
|
+
* @returns Sanitized valid namespace
|
|
364
410
|
* @throws {Error} If namespace is invalid
|
|
365
411
|
*/
|
|
366
412
|
function validateAndSanitizeNamespace(namespace, allowAsterisk = false) {
|
|
@@ -369,7 +415,8 @@ function validateAndSanitizeNamespace(namespace, allowAsterisk = false) {
|
|
|
369
415
|
}
|
|
370
416
|
/**
|
|
371
417
|
* Used internally before storing and searching
|
|
372
|
-
*
|
|
418
|
+
*
|
|
419
|
+
* @returns Sanitized namespace
|
|
373
420
|
*/
|
|
374
421
|
function sanitizeNamespace(namespace) {
|
|
375
422
|
return namespace.normalize("NFC").trim();
|
|
@@ -383,11 +430,13 @@ function sanitizeNamespace(namespace) {
|
|
|
383
430
|
* about the letter of the namespace, otherwise there's a risk of data loss. For
|
|
384
431
|
* this reason, validation is strict and throws errors, so that the user can
|
|
385
432
|
* understand and correct their input so that they know the proper form for
|
|
386
|
-
* subsequent uses of the namespace string — especially if they're using the
|
|
433
|
+
* subsequent uses of the namespace string — especially if they're using the
|
|
434
|
+
* CLI.
|
|
387
435
|
*
|
|
388
436
|
* Silently correcting the namespace would be a bad idea, because the user might
|
|
389
437
|
* not realize that the namespace has been changed, and then they might not be
|
|
390
438
|
* able to find their notes.
|
|
439
|
+
*
|
|
391
440
|
* @throws {Error}
|
|
392
441
|
*/
|
|
393
442
|
function validateNamespace(namespace, allowAsterisk = false) {
|
|
@@ -462,7 +511,9 @@ const WINDOWS_DRIVE_LETTER_REGEX = /^[A-Z]:/i;
|
|
|
462
511
|
const QUERY_FRAGMENT_START_REGEX = /[#?^]/;
|
|
463
512
|
/**
|
|
464
513
|
* The browserify polyfill doesn't implement win32 absolute path detection...
|
|
514
|
+
*
|
|
465
515
|
* @param filePath Normalized path
|
|
516
|
+
*
|
|
466
517
|
* @returns Whether the path is absolute
|
|
467
518
|
*/
|
|
468
519
|
function isAbsolute(filePath) {
|
|
@@ -472,8 +523,10 @@ const RE_WINDOWS_EXTENDED_LENGTH_PATH = /^\\\\\?\\.+/;
|
|
|
472
523
|
/**
|
|
473
524
|
* Converts all paths to cross-platform 'mixed' style with forward slashes.
|
|
474
525
|
* Warns on unsupported Windows extended length paths.
|
|
526
|
+
*
|
|
475
527
|
* @param filePath Path to normalize
|
|
476
|
-
*
|
|
528
|
+
*
|
|
529
|
+
* @returns Normalized path
|
|
477
530
|
*/
|
|
478
531
|
function normalize(filePath) {
|
|
479
532
|
if (RE_WINDOWS_EXTENDED_LENGTH_PATH.test(filePath)) {
|
|
@@ -486,14 +539,15 @@ function normalize(filePath) {
|
|
|
486
539
|
return normalizedPath;
|
|
487
540
|
}
|
|
488
541
|
/**
|
|
489
|
-
* Special handling for `/absolute-path.md` style links in Obsidian
|
|
490
|
-
*
|
|
491
|
-
*
|
|
542
|
+
* Special handling for `/absolute-path.md` style links in Obsidian and static
|
|
543
|
+
* site generators, where absolute paths are relative to a base path instead of
|
|
544
|
+
* the volume root.
|
|
492
545
|
*
|
|
493
|
-
|
|
546
|
+
* Paths starting with Windows drive letters, while technically absolute, are
|
|
547
|
+
* _not_ prepended with the base:
|
|
494
548
|
*
|
|
495
|
-
*
|
|
496
|
-
*
|
|
549
|
+
* - If no base path is provided, paths are resolved relative to the the provided
|
|
550
|
+
* CWD.
|
|
497
551
|
* - If paths are relative, the base paths are ignored and the CWD is used.
|
|
498
552
|
*
|
|
499
553
|
* All path values are normalized and in 'mixed' platform style.
|
|
@@ -570,8 +624,9 @@ function isUrl(text) {
|
|
|
570
624
|
return safeParseUrl(text) !== void 0;
|
|
571
625
|
}
|
|
572
626
|
/**
|
|
573
|
-
* Helper to "filter" file URLs into path strings so they're treated
|
|
574
|
-
*
|
|
627
|
+
* Helper to "filter" file URLs into path strings so they're treated correctly
|
|
628
|
+
* in mdastToHtml
|
|
629
|
+
*
|
|
575
630
|
* @todo Need stuff from node's implementation, fileURLToPath?
|
|
576
631
|
*/
|
|
577
632
|
function fileUrlToPath(url) {
|
|
@@ -593,9 +648,12 @@ function getSrcType(filePathOrUrl) {
|
|
|
593
648
|
}
|
|
594
649
|
/**
|
|
595
650
|
* Supports both Header type and Record<string, string> type
|
|
651
|
+
*
|
|
596
652
|
* @param headers Headers object or record from a fetch response
|
|
597
653
|
* @param headerKeys Headers to include in the string
|
|
598
|
-
*
|
|
654
|
+
*
|
|
655
|
+
* @returns A concatenated string of the header contents, suitable for hashing,
|
|
656
|
+
* or undefined if no matching headers are present
|
|
599
657
|
*/
|
|
600
658
|
function getHeadersString(headers, headerKeys) {
|
|
601
659
|
if (headers === void 0) return;
|
|
@@ -648,11 +706,11 @@ async function getFileExtensionFromUrl(url, fetchAdapter, mode = MEDIA_URL_CONTE
|
|
|
648
706
|
*
|
|
649
707
|
* - `filename`: Use the filename of the media asset, no network required.
|
|
650
708
|
* - `metadata`: Use the metadata of the media asset, either fstat stuff for
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* - `content`: Actually read the content of the media asset, requires reading
|
|
654
|
-
*
|
|
655
|
-
*
|
|
709
|
+
* files, or reading the headers for URLs... requires a network request for
|
|
710
|
+
* remote urls. Falls through to `filename` if not available.
|
|
711
|
+
* - `content`: Actually read the content of the media asset, requires reading the
|
|
712
|
+
* file or fetching the URL. Not yet implemented. Falls through to `metadata`
|
|
713
|
+
* if not available.
|
|
656
714
|
*/
|
|
657
715
|
async function getUrlContentHash(url, fetchAdapter, mode = MEDIA_DEFAULT_HASH_MODE_URL) {
|
|
658
716
|
switch (mode) {
|
|
@@ -687,8 +745,11 @@ function hostAndPortToUrl(host, port) {
|
|
|
687
745
|
//#region src/lib/utilities/media.ts
|
|
688
746
|
/**
|
|
689
747
|
* Get the extension of a media file, if it's supported
|
|
690
|
-
*
|
|
748
|
+
*
|
|
749
|
+
* @returns Extension without the `.`, possibly an extra string if no extension
|
|
750
|
+
* is found
|
|
691
751
|
* @todo Check for how it handles query strings
|
|
752
|
+
*
|
|
692
753
|
* @todo Clean up type casting
|
|
693
754
|
*/
|
|
694
755
|
async function getAnkiMediaFilenameExtension(pathOrUrl, fetchAdapter) {
|
|
@@ -704,8 +765,8 @@ async function mediaAssetExists(absolutePathOrUrl, fileAdapter, fetchAdapter) {
|
|
|
704
765
|
return fileExists(absolutePathOrUrl, fileAdapter);
|
|
705
766
|
}
|
|
706
767
|
/**
|
|
707
|
-
* Get a safe filename for an Anki media asset
|
|
708
|
-
*
|
|
768
|
+
* Get a safe filename for an Anki media asset Anki truncates long file names...
|
|
769
|
+
* so we crush the complete path down to a hash
|
|
709
770
|
*/
|
|
710
771
|
async function getSafeAnkiMediaFilename(absolutePathOrUrl, namespace, fileExtension, fileAdapter, fetchAdapter) {
|
|
711
772
|
if (!await mediaAssetExists(absolutePathOrUrl, fileAdapter, fetchAdapter)) return;
|
|
@@ -722,6 +783,10 @@ async function getContentHash(absolutePathOrUrl, fileAdapter, fetchAdapter) {
|
|
|
722
783
|
}
|
|
723
784
|
//#endregion
|
|
724
785
|
//#region src/lib/parse/rehype-mathjax-anki.ts
|
|
786
|
+
const CONSECUTIVE_BRACES_REGEX = /([{}])(?=[{}])/g;
|
|
787
|
+
function sanitizeBraces(value) {
|
|
788
|
+
return value.replaceAll(CONSECUTIVE_BRACES_REGEX, "$1 ");
|
|
789
|
+
}
|
|
725
790
|
/**
|
|
726
791
|
* Non-rendering replacement for the `rehype-mathjax` plugin, which takes output
|
|
727
792
|
* from `remark-math` and wraps it in Anki-specific syntax.
|
|
@@ -740,6 +805,7 @@ const plugin$3 = function() {
|
|
|
740
805
|
if (node.tagName === "code" && Array.isArray(node.properties.className) && node.properties.className.includes("language-math")) {
|
|
741
806
|
const isBlock = node.properties.className.includes("math-display") || fenced;
|
|
742
807
|
fenced = false;
|
|
808
|
+
for (const child of node.children) if (child.type === "text") child.value = sanitizeBraces(child.value);
|
|
743
809
|
node.tagName = isBlock ? "div" : "span";
|
|
744
810
|
node.children = [
|
|
745
811
|
{
|
|
@@ -770,7 +836,41 @@ const plugin$2 = function() {
|
|
|
770
836
|
//#endregion
|
|
771
837
|
//#region src/lib/parse/rehype-utilities.ts
|
|
772
838
|
const DIMENSION_CHARS_REGEX = /^[\dx]+$/;
|
|
773
|
-
const
|
|
839
|
+
const highlighter = await createHighlighterCore({
|
|
840
|
+
engine: createJavaScriptRegexEngine(),
|
|
841
|
+
langs: [
|
|
842
|
+
bash,
|
|
843
|
+
c,
|
|
844
|
+
cpp,
|
|
845
|
+
css,
|
|
846
|
+
diff,
|
|
847
|
+
dockerfile,
|
|
848
|
+
go,
|
|
849
|
+
html,
|
|
850
|
+
java,
|
|
851
|
+
javascript,
|
|
852
|
+
json,
|
|
853
|
+
jsx,
|
|
854
|
+
kotlin,
|
|
855
|
+
markdown,
|
|
856
|
+
php,
|
|
857
|
+
python,
|
|
858
|
+
regex,
|
|
859
|
+
ruby,
|
|
860
|
+
rust,
|
|
861
|
+
scss,
|
|
862
|
+
shellscript,
|
|
863
|
+
sql,
|
|
864
|
+
swift,
|
|
865
|
+
toml,
|
|
866
|
+
tsx,
|
|
867
|
+
typescript,
|
|
868
|
+
xml,
|
|
869
|
+
yaml
|
|
870
|
+
],
|
|
871
|
+
themes: [githubDark, githubLight]
|
|
872
|
+
});
|
|
873
|
+
const processor = unified().use(plugin$2).use(remarkRehype, { allowDangerousHtml: true }).use(rehypeRaw).use(plugin$3).use(rehypeShikiFromHighlighter, highlighter, {
|
|
774
874
|
defaultLanguage: "plaintext",
|
|
775
875
|
fallbackLanguage: "plaintext",
|
|
776
876
|
themes: {
|
|
@@ -939,7 +1039,9 @@ function parseDimensions(dimensions) {
|
|
|
939
1039
|
}
|
|
940
1040
|
/**
|
|
941
1041
|
* Determine if a HAST tree is visually empty.
|
|
1042
|
+
*
|
|
942
1043
|
* @param tree - The HAST tree to check.
|
|
1044
|
+
*
|
|
943
1045
|
* @returns - True if the tree is visually empty, otherwise false.
|
|
944
1046
|
*/
|
|
945
1047
|
function isVisuallyEmpty(tree) {
|
|
@@ -976,10 +1078,12 @@ function isVisuallyEmpty(tree) {
|
|
|
976
1078
|
return !hasVisualContent;
|
|
977
1079
|
}
|
|
978
1080
|
/**
|
|
979
|
-
* Add a first child to the first div element in a HAST tree.
|
|
980
|
-
*
|
|
1081
|
+
* Add a first child to the first div element in a HAST tree. Intended for use
|
|
1082
|
+
* with the "div-wrapped" HAST tree generated early in `mdastToHtml`.
|
|
1083
|
+
*
|
|
981
1084
|
* @param tree - The HAST tree to modify in place.
|
|
982
1085
|
* @param newChild - The new child node to add.
|
|
1086
|
+
*
|
|
983
1087
|
* @returns - The modified-in-place HAST tree.
|
|
984
1088
|
*/
|
|
985
1089
|
function addFirstChildToFirstDiv(tree, newChild) {
|
|
@@ -1069,9 +1173,12 @@ async function deleteNotes(client, notes, dryRun = false) {
|
|
|
1069
1173
|
*
|
|
1070
1174
|
* Duplicates will be created if present in the source. It's up to the user to
|
|
1071
1175
|
* manage their Markdown files as they like.
|
|
1176
|
+
*
|
|
1072
1177
|
* @param client An instance of YankiConnect
|
|
1073
1178
|
* @param note The note to add
|
|
1074
|
-
* @param dryRun If true, the note will not be created and an ID of 0 will be
|
|
1179
|
+
* @param dryRun If true, the note will not be created and an ID of 0 will be
|
|
1180
|
+
* returned
|
|
1181
|
+
*
|
|
1075
1182
|
* @returns The ID of the newly created note in Anki
|
|
1076
1183
|
* @throws {Error}
|
|
1077
1184
|
*/
|
|
@@ -1103,11 +1210,14 @@ async function addNote(client, note, dryRun, fileAdapter) {
|
|
|
1103
1210
|
}
|
|
1104
1211
|
/**
|
|
1105
1212
|
* Updates a note in Anki.
|
|
1213
|
+
*
|
|
1106
1214
|
* @param client An instance of YankiConnect
|
|
1107
1215
|
* @param localNote A note read from a markdown file
|
|
1108
1216
|
* @param remoteNote A note loaded from Anki
|
|
1217
|
+
*
|
|
1109
1218
|
* @returns True if the note was updated, false otherwise.
|
|
1110
|
-
* @throws {Error} If the local note ID or remote note cards are undefined, or
|
|
1219
|
+
* @throws {Error} If the local note ID or remote note cards are undefined, or
|
|
1220
|
+
* if model/deck errors occur.
|
|
1111
1221
|
*/
|
|
1112
1222
|
async function updateNote(client, localNote, remoteNote, dryRun, fileAdapter) {
|
|
1113
1223
|
if (localNote.noteId === void 0) throw new Error("Local note ID is undefined");
|
|
@@ -1146,6 +1256,7 @@ async function updateNote(client, localNote, remoteNote, dryRun, fileAdapter) {
|
|
|
1146
1256
|
}
|
|
1147
1257
|
/**
|
|
1148
1258
|
* Helper to compare local and remote field contents.
|
|
1259
|
+
*
|
|
1149
1260
|
* @returns True if the fields are equal, false otherwise.
|
|
1150
1261
|
*/
|
|
1151
1262
|
function areFieldsEqual(localFields, remoteFields) {
|
|
@@ -1167,14 +1278,14 @@ function areNotesEqual(noteA, noteB, includeId = true) {
|
|
|
1167
1278
|
return true;
|
|
1168
1279
|
}
|
|
1169
1280
|
/**
|
|
1170
|
-
* Helper function to compare two arrays of tags.
|
|
1171
|
-
*
|
|
1172
|
-
* https://github.com/kitschpatrol/yanki-obsidian/issues/44
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
* ['yes', '
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1281
|
+
* Helper function to compare two arrays of tags. Note some nuances around case
|
|
1282
|
+
* insensitivity as discussed here:
|
|
1283
|
+
* https://github.com/kitschpatrol/yanki-obsidian/issues/44 Anki will
|
|
1284
|
+
* alphabetically sort tags, so we sort as well. Duplicate tags are ignored in
|
|
1285
|
+
* Anki, so we ignore them here: ['yes', 'yes'] is considered equal to ['yes'].
|
|
1286
|
+
* Tags in different orders are considered equal: ['yes', 'no'] is considered
|
|
1287
|
+
* equal to ['no', 'yes'].
|
|
1288
|
+
*
|
|
1178
1289
|
* @returns True if the tags are equal, false otherwise.
|
|
1179
1290
|
*/
|
|
1180
1291
|
function areTagsEqual(localTags, remoteTags) {
|
|
@@ -1184,8 +1295,11 @@ function areTagsEqual(localTags, remoteTags) {
|
|
|
1184
1295
|
}
|
|
1185
1296
|
/**
|
|
1186
1297
|
* Get all notes from Anki that match the model prefix.
|
|
1298
|
+
*
|
|
1187
1299
|
* @param client An instance of YankiConnect
|
|
1188
|
-
* @param namespace The value of the YankiNamespace field, or search with '*' to
|
|
1300
|
+
* @param namespace The value of the YankiNamespace field, or search with '*' to
|
|
1301
|
+
* get all notes. Defaults to the global default namespace.
|
|
1302
|
+
*
|
|
1189
1303
|
* @returns An array of YankiNote objects
|
|
1190
1304
|
* @throws {Error}
|
|
1191
1305
|
*/
|
|
@@ -1196,14 +1310,19 @@ async function getRemoteNotes(client, namespace = defaultGlobalOptions.namespace
|
|
|
1196
1310
|
* Get all data from Anki required to populate the YankiNote type.
|
|
1197
1311
|
*
|
|
1198
1312
|
* Handles some extra footwork to identify the deck name and validate the model
|
|
1199
|
-
* name. There's no way to get everything we need in one shot from
|
|
1313
|
+
* name. There's no way to get everything we need in one shot from
|
|
1314
|
+
* Anki-Connect.
|
|
1200
1315
|
*
|
|
1201
1316
|
* Undefined elements in the returned array are subsequently used to identify
|
|
1202
1317
|
* notes that need to be created.
|
|
1318
|
+
*
|
|
1203
1319
|
* @param client An instance of YankiConnect
|
|
1204
1320
|
* @param noteIds An array of local note IDs to (attempt) to fetch
|
|
1205
|
-
*
|
|
1206
|
-
* @
|
|
1321
|
+
*
|
|
1322
|
+
* @returns Array of YankiNote objects, with undefined for notes that could not
|
|
1323
|
+
* be found.
|
|
1324
|
+
* @throws {Error} If an unknown model name or multiple decks are found for a
|
|
1325
|
+
* note, or if no deck is found.
|
|
1207
1326
|
*/
|
|
1208
1327
|
async function getRemoteNotesById(client, noteIds) {
|
|
1209
1328
|
const ankiNotes = await client.note.notesInfo({ notes: noteIds });
|
|
@@ -1311,7 +1430,8 @@ async function deleteOrphanedDecks(client, activeNotes, originalNotes, dryRun) {
|
|
|
1311
1430
|
return decksToDelete;
|
|
1312
1431
|
}
|
|
1313
1432
|
/**
|
|
1314
|
-
* Global! Does not respect namespace. You can write namespace checks into your
|
|
1433
|
+
* Global! Does not respect namespace. You can write namespace checks into your
|
|
1434
|
+
* css if you want.
|
|
1315
1435
|
*/
|
|
1316
1436
|
async function updateModelStyle(client, modelName, css, dryRun) {
|
|
1317
1437
|
let currentCss;
|
|
@@ -1343,6 +1463,7 @@ async function getModelStyle(client, modelName = yankiModelNames[0]) {
|
|
|
1343
1463
|
}
|
|
1344
1464
|
/**
|
|
1345
1465
|
* Upload all media files for a note to Anki.
|
|
1466
|
+
*
|
|
1346
1467
|
* @returns Original source name of media files uploaded
|
|
1347
1468
|
*/
|
|
1348
1469
|
async function uploadMediaForNote(client, note, dryRun, fileAdapter) {
|
|
@@ -1416,7 +1537,9 @@ async function reconcileMedia(client, liveNotes, namespace, dryRun, fileAdapter)
|
|
|
1416
1537
|
}
|
|
1417
1538
|
/**
|
|
1418
1539
|
* Request permission to access Anki through Anki-Connect.
|
|
1419
|
-
*
|
|
1540
|
+
*
|
|
1541
|
+
* @returns 'ankiUnreachable' if Anki is not open, or 'granted' if everything is
|
|
1542
|
+
* copacetic
|
|
1420
1543
|
* @throws {Error} If access is denied
|
|
1421
1544
|
*/
|
|
1422
1545
|
async function requestPermission(client) {
|
|
@@ -1443,8 +1566,10 @@ const defaultCleanOptions = { ...defaultGlobalOptions };
|
|
|
1443
1566
|
* Deletes all remote notes in Anki associated with the given namespace.
|
|
1444
1567
|
*
|
|
1445
1568
|
* Use with significant caution. Mostly useful for testing.
|
|
1569
|
+
*
|
|
1446
1570
|
* @returns The IDs of the notes that were deleted
|
|
1447
|
-
* @throws {Error} If Anki is unreachable or another error occurs during
|
|
1571
|
+
* @throws {Error} If Anki is unreachable or another error occurs during
|
|
1572
|
+
* deletion.
|
|
1448
1573
|
*/
|
|
1449
1574
|
async function cleanNotes(options) {
|
|
1450
1575
|
const startTime = performance.now();
|
|
@@ -1552,8 +1677,11 @@ function getSafeTitleForNote(note, manageFilenames, maxLength) {
|
|
|
1552
1677
|
}
|
|
1553
1678
|
/**
|
|
1554
1679
|
* Get a safe filename for a media asset
|
|
1680
|
+
*
|
|
1555
1681
|
* @param text Text to be converted to a safe filename
|
|
1556
|
-
* @param maxLength If undefined, no truncation will take place. If defined, a
|
|
1682
|
+
* @param maxLength If undefined, no truncation will take place. If defined, a
|
|
1683
|
+
* maximum maximum length of the filename will be enforced.
|
|
1684
|
+
*
|
|
1557
1685
|
* @returns A safe filename
|
|
1558
1686
|
*/
|
|
1559
1687
|
function getSafeFilename(text, maxLength) {
|
|
@@ -1582,8 +1710,11 @@ function auditUniqueFilePath(filePath, existingFilenames) {
|
|
|
1582
1710
|
}
|
|
1583
1711
|
/**
|
|
1584
1712
|
* Strip the trailing increment from a filename
|
|
1585
|
-
*
|
|
1586
|
-
* @
|
|
1713
|
+
*
|
|
1714
|
+
* @param filename File name with or without an extension, and possibly with a
|
|
1715
|
+
* (1)
|
|
1716
|
+
*
|
|
1717
|
+
* @returns Filename without the increment
|
|
1587
1718
|
*/
|
|
1588
1719
|
function stripFilenameIncrement(filename) {
|
|
1589
1720
|
const validExtension = filename.endsWith(".") || filename.endsWith(")") ? void 0 : path.extname(filename);
|
|
@@ -1610,27 +1741,31 @@ const defaultResolveLinkOptions = {
|
|
|
1610
1741
|
/**
|
|
1611
1742
|
* Resolve a file path, URL, or wiki-style named links to an absolute path.
|
|
1612
1743
|
*
|
|
1613
|
-
* Warning:
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1744
|
+
* Warning: Wiki name link resolution is CASE INSENSITIVE, like in Obsidian,
|
|
1745
|
+
* though the case of the matching file will be preserved in the returned path.
|
|
1746
|
+
*
|
|
1616
1747
|
* @param filePathOrUrl May be one of:
|
|
1617
|
-
*
|
|
1618
|
-
*
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1621
|
-
*
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
* (All file paths can be Windows or POSIX, with or
|
|
1625
|
-
* or without funky Obsidian-style
|
|
1626
|
-
* additions.)
|
|
1748
|
+
*
|
|
1749
|
+
* - Wiki named link
|
|
1750
|
+
* - Relative file path
|
|
1751
|
+
* - Bare file path
|
|
1752
|
+
* - Absolute file path
|
|
1753
|
+
* - HTTP protocol URL string
|
|
1754
|
+
* - File protocol URL string
|
|
1755
|
+
* - Obsidian protocol URL string (All file paths can be Windows or POSIX, with or
|
|
1756
|
+
* without URI encoding, with or without funky Obsidian-style
|
|
1757
|
+
* post-extension block and heading anchor additions.)
|
|
1758
|
+
*
|
|
1759
|
+
*
|
|
1627
1760
|
* @returns Resolved absolute path or URL One of:
|
|
1628
|
-
*
|
|
1761
|
+
*
|
|
1762
|
+
* - Resolved absolute POSIX-style paths
|
|
1629
1763
|
* - Removes any file path query parameters
|
|
1630
1764
|
* - Not URI-encoded
|
|
1631
1765
|
* - Retains original case
|
|
1632
|
-
*
|
|
1633
|
-
*
|
|
1766
|
+
* - HTTP protocol URL
|
|
1767
|
+
* - Obsidian protocol vault URL (Optionally, this will include file query
|
|
1768
|
+
* parameters)
|
|
1634
1769
|
*/
|
|
1635
1770
|
function resolveLink(filePathOrUrl, options) {
|
|
1636
1771
|
const { allFilePaths, basePath, convertFilePathsToProtocol, cwd, obsidianVaultName, type } = deepmerge(defaultResolveLinkOptions, options ?? {});
|
|
@@ -1695,16 +1830,19 @@ function resolveLink(filePathOrUrl, options) {
|
|
|
1695
1830
|
*
|
|
1696
1831
|
* See Obsidian's `getFirstLinkpathDest()` for a roughly equivalent algorithm.
|
|
1697
1832
|
*
|
|
1698
|
-
* Obsidian seems to treat note links slightly differently from image / asset
|
|
1833
|
+
* Obsidian seems to treat note links slightly differently from image / asset
|
|
1834
|
+
* links.
|
|
1835
|
+
*
|
|
1699
1836
|
* @param name Non-URI-encoded name of the file, may have file extension, if no
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1837
|
+
* match with a non-.md extension is found, a match will be attempted with .md
|
|
1838
|
+
* regardless. (POSIX-style paths.)
|
|
1702
1839
|
* @param cwd Absolute path to the current working directory of the file from
|
|
1703
|
-
*
|
|
1840
|
+
* which we're resolving the link. (POSIX-style paths)
|
|
1704
1841
|
* @param allFilePaths Array of absolute paths to all other files in the paths
|
|
1705
|
-
*
|
|
1842
|
+
* to be considered. (POSIX-style paths.)
|
|
1843
|
+
*
|
|
1706
1844
|
* @returns Absolute path to the best matching file with the name provided, or
|
|
1707
|
-
*
|
|
1845
|
+
* undefined if there's no valid match. (POSIX-style paths.)
|
|
1708
1846
|
*/
|
|
1709
1847
|
function resolveNameLink(name, cwd, allFilePaths) {
|
|
1710
1848
|
if (allFilePaths.length === 0) return;
|
|
@@ -1729,10 +1867,13 @@ function resolveNameLink(name, cwd, allFilePaths) {
|
|
|
1729
1867
|
/**
|
|
1730
1868
|
* Check for presence of a path in a list in a case- and query- agnostic manner.
|
|
1731
1869
|
* Ignores .md extensions to simplify matching files
|
|
1870
|
+
*
|
|
1732
1871
|
* @param filePath File path with file extension. (POSIX-style path.)
|
|
1733
|
-
* @param allFilePaths Array of absolute file paths to check. (POSIX-style
|
|
1872
|
+
* @param allFilePaths Array of absolute file paths to check. (POSIX-style
|
|
1873
|
+
* paths.)
|
|
1874
|
+
*
|
|
1734
1875
|
* @returns The file path if it is present in the list of all file paths, or
|
|
1735
|
-
*
|
|
1876
|
+
* undefined if it is not.
|
|
1736
1877
|
*/
|
|
1737
1878
|
function pathExistsInAllFiles(filePath, allFilePaths) {
|
|
1738
1879
|
const base = getBase(filePath);
|
|
@@ -1941,9 +2082,9 @@ function wikiBasic() {
|
|
|
1941
2082
|
return insideLabel;
|
|
1942
2083
|
}
|
|
1943
2084
|
/**
|
|
1944
|
-
* When encountering a right square bracket, we must look ahead at the next
|
|
1945
|
-
* to determine whether it indicates the end of the [[wikilink]]
|
|
1946
|
-
* simply part of the label text.
|
|
2085
|
+
* When encountering a right square bracket, we must look ahead at the next
|
|
2086
|
+
* character to determine whether it indicates the end of the [[wikilink]]
|
|
2087
|
+
* or is simply part of the label text.
|
|
1947
2088
|
*/
|
|
1948
2089
|
function lookaheadClosingMarker(code) {
|
|
1949
2090
|
if (code !== 93) return nok(code);
|
|
@@ -2061,12 +2202,12 @@ function wikiBasic() {
|
|
|
2061
2202
|
*
|
|
2062
2203
|
* Obsidian also supports wiki links in Markdown-style image and link syntax, so
|
|
2063
2204
|
* handling resolution here would miss those cases, so:
|
|
2205
|
+
*
|
|
2064
2206
|
* - Resolution of wiki link into absolute paths happens later in
|
|
2065
2207
|
* remark-resolve-links.ts
|
|
2066
2208
|
* - Parsing of Obsidian-style image size from alias / alt text happens later in
|
|
2067
2209
|
* rehype-utilities.ts
|
|
2068
2210
|
*
|
|
2069
|
-
*
|
|
2070
2211
|
* Note that only wiki links support spaces in the src, regular markdown links
|
|
2071
2212
|
* MUST be URI-encoded in the Markdown source Here, we URI-encode for
|
|
2072
2213
|
* consistency with the regular image syntax in the resulting HAST `<>` escaped
|
|
@@ -2471,29 +2612,29 @@ async function loadLocalNotes(allLocalFilePaths, options) {
|
|
|
2471
2612
|
}
|
|
2472
2613
|
const defaultDeckNamesFromFilePathsOptions = { mode: "common-root" };
|
|
2473
2614
|
/**
|
|
2474
|
-
* Helper function to infer deck names from file paths if `deckName` not defined
|
|
2615
|
+
* Helper function to infer deck names from file paths if `deckName` not defined
|
|
2616
|
+
* in the note's frontmatter.
|
|
2475
2617
|
*
|
|
2476
2618
|
* `deckName` will always override the inferred deck name.
|
|
2477
2619
|
*
|
|
2478
2620
|
* Depends on the context of _all_ file paths passed to `syncNoteFiles`.
|
|
2479
2621
|
*
|
|
2480
|
-
* Example of paths -> deck names with `common-root`:
|
|
2481
|
-
* /base/foo/note.md -> foo
|
|
2622
|
+
* Example of paths -> deck names with `common-root`: /base/foo/note.md -> foo
|
|
2482
2623
|
* /base/foo/baz/note.md -> foo::baz
|
|
2483
2624
|
*
|
|
2484
|
-
* Example of paths -> deck names with `common-root`:
|
|
2485
|
-
* /base/foo/note.md -> foo
|
|
2625
|
+
* Example of paths -> deck names with `common-root`: /base/foo/note.md -> foo
|
|
2486
2626
|
* /base/foo/note.md -> foo
|
|
2487
2627
|
*
|
|
2488
|
-
* Example of paths -> deck names with `common-parent`:
|
|
2489
|
-
* /base/foo/note.md -> base::foo
|
|
2490
|
-
* /base/foo/baz/note.md -> base::foo::baz
|
|
2628
|
+
* Example of paths -> deck names with `common-parent`: /base/foo/note.md ->
|
|
2629
|
+
* base::foo /base/foo/baz/note.md -> base::foo::baz
|
|
2491
2630
|
*
|
|
2492
|
-
* Example of paths -> deck names with `common-parent`:
|
|
2631
|
+
* Example of paths -> deck names with `common-parent`: /base/foo/note.md -> foo
|
|
2493
2632
|
* /base/foo/note.md -> foo
|
|
2494
|
-
*
|
|
2495
|
-
* @param absoluteFilePaths Absolute paths to all markdown Anki note files.
|
|
2496
|
-
*
|
|
2633
|
+
*
|
|
2634
|
+
* @param absoluteFilePaths Absolute paths to all markdown Anki note files.
|
|
2635
|
+
* (Ensures proper resolution if path module is polyfilled.)
|
|
2636
|
+
*
|
|
2637
|
+
* @returns Array of ::-delimited deck paths
|
|
2497
2638
|
*/
|
|
2498
2639
|
function getDeckNamesFromFilePaths(absoluteFilePaths, options) {
|
|
2499
2640
|
const { mode } = deepmerge(defaultDeckNamesFromFilePathsOptions, options ?? {});
|
|
@@ -2638,13 +2779,14 @@ const NEWLINE_REGEX = /\r?\n/;
|
|
|
2638
2779
|
*
|
|
2639
2780
|
* Used when a noteId is received from Anki after creating a note.
|
|
2640
2781
|
*
|
|
2641
|
-
*
|
|
2642
2782
|
* String manipulation is ugly, but it ensures that the markdown format is
|
|
2643
2783
|
* preserved verbatim. Running it through the unified AST and then
|
|
2644
2784
|
* remarkStringify would possibly change the format.
|
|
2785
|
+
*
|
|
2645
2786
|
* @param markdown Raw markdown string with frontmatter.
|
|
2646
|
-
* @param noteId
|
|
2647
|
-
*
|
|
2787
|
+
* @param noteId The value to set the noteId to. If undefined, the noteId will
|
|
2788
|
+
* be removed from the frontmatter. (Useful for testing.)
|
|
2789
|
+
*
|
|
2648
2790
|
* @returns Raw markdown string with updated frontmatter.
|
|
2649
2791
|
*/
|
|
2650
2792
|
async function setNoteIdInFrontmatter(markdown, noteId) {
|
|
@@ -2688,9 +2830,11 @@ function getFrontmatterRange(markdown) {
|
|
|
2688
2830
|
const defaultSyncNotesOptions = { ...defaultGlobalOptions };
|
|
2689
2831
|
/**
|
|
2690
2832
|
* Syncs local notes to Anki.
|
|
2833
|
+
*
|
|
2691
2834
|
* @param allLocalNotes All the YankiNotes to sync
|
|
2835
|
+
*
|
|
2692
2836
|
* @returns The synced notes (with new IDs where applicable), plus some stats
|
|
2693
|
-
*
|
|
2837
|
+
* about the sync
|
|
2694
2838
|
* @throws {Error} For various reasons...
|
|
2695
2839
|
*/
|
|
2696
2840
|
async function syncNotes(allLocalNotes, options) {
|
|
@@ -2819,9 +2963,11 @@ const defaultSyncFilesOptions = {
|
|
|
2819
2963
|
*
|
|
2820
2964
|
* Most importantly, it updates the note IDs in the frontmatter of the local
|
|
2821
2965
|
* files.
|
|
2966
|
+
*
|
|
2822
2967
|
* @param allLocalFilePaths Array of paths to the local markdown files
|
|
2968
|
+
*
|
|
2823
2969
|
* @returns The synced files (with new IDs where applicable), plus some stats
|
|
2824
|
-
*
|
|
2970
|
+
* about the sync
|
|
2825
2971
|
* @throws {Error} If syncing fails or file operations encounter an error.
|
|
2826
2972
|
*/
|
|
2827
2973
|
async function syncFiles(allLocalFilePaths, options) {
|