{"_id":"rehype-katex-notranslate","_rev":"6-32dafd87cfd855239b112cb988555e8a","name":"rehype-katex-notranslate","dist-tags":{"latest":"1.1.4"},"versions":{"1.0.0":{"name":"rehype-katex-notranslate","version":"1.0.0","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","format","fmt","beautify","prettify","html"],"author":"","license":"ISC","_id":"rehype-katex-notranslate@1.0.0","maintainers":[{"name":"edward-zhang","email":"643431636@qq.com"}],"dist":{"shasum":"528e46660eb88a0ae203422e79b2da414e26072c","tarball":"https://registry.npmjs.org/rehype-katex-notranslate/-/rehype-katex-notranslate-1.0.0.tgz","fileCount":5,"integrity":"sha512-GS0wgBOlPaN3JDps4C7Scboe8PSUXU8yUxxe35m3pFh8V3zyr957i478CZVcEAIP0n+VOxv7+qUDOllyccVuIQ==","signatures":[{"sig":"MEUCIDZASX2H2dpvf0J9M1O6QZPdI474/nIE8xil/PEVRJhBAiEAw40lFWl/ykXuIu8tiYOrceV6LPkymhyCV3VgCk/2v2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4529},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","gitHead":"99e36529e26bee8fec5f9c0489104557c003822a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc --build --clean && tsc --build","format":"npx prettier . --write","prepack":"npm run build && npm run format"},"_npmUser":{"name":"edward-zhang","email":"643431636@qq.com"},"_npmVersion":"10.8.2","description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","directories":{},"_nodeVersion":"22.6.0","dependencies":{"hast":"^0.0.2","unified":"^11.0.5","hast-util-select":"^6.0.2","prettier-plugin-organize-imports":"^4.1.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.3.3","typescript":"^5.6.2","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/rehype-katex-notranslate_1.0.0_1728265306865_0.6216024463372547","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"rehype-katex-notranslate","version":"1.1.0","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","format","fmt","beautify","prettify","html"],"author":"","license":"ISC","_id":"rehype-katex-notranslate@1.1.0","maintainers":[{"name":"edward-zhang","email":"643431636@qq.com"}],"dist":{"shasum":"c4a41b5c338e8a2d5265aa9e2283640b7bea748a","tarball":"https://registry.npmjs.org/rehype-katex-notranslate/-/rehype-katex-notranslate-1.1.0.tgz","fileCount":4,"integrity":"sha512-8YCEyvxM0UO7PKvm8SzaKqf1meHdIip+CL8X0OWtVWvqacwB5Bqk6WWfDGgsnnE6H501wARwAQQiXAPX+6rlOA==","signatures":[{"sig":"MEYCIQD4hBMkPgoUgybxSR4ADAWU95XVV/g6kWuwb0z+NGD+FAIhAKTos9ABf6ZhnAaEfgpKOfII5I9y7kRSgFbnv062gsNg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4811},"main":"./dist/lib/index.js","type":"module","types":"./dist/lib/index.d.ts","exports":"./dist/lib/index.js","gitHead":"c8ba69e8501977de2c3237a66b1d057d01ca88f4","scripts":{"test":"npm run build && node --test dist/test/index.test.js","build":"tsc --build --clean && tsc --build","format":"npx prettier . --write","prepack":"npm run build && npm run format"},"_npmUser":{"name":"edward-zhang","email":"643431636@qq.com"},"_npmVersion":"10.8.2","description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","directories":{},"_nodeVersion":"22.6.0","dependencies":{"hast":"^0.0.2","unified":"^11.0.5","hast-util-select":"^6.0.2"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.3.3","typescript":"^5.6.2","@types/node":"^22.7.4","rehype-parse":"^9.0.1","rehype-stringify":"^10.0.1","prettier-plugin-organize-imports":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/rehype-katex-notranslate_1.1.0_1728290306343_0.557639960824627","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"rehype-katex-notranslate","version":"1.1.1","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","format","fmt","beautify","prettify","html"],"author":"","license":"ISC","_id":"rehype-katex-notranslate@1.1.1","maintainers":[{"name":"edward-zhang","email":"643431636@qq.com"}],"dist":{"shasum":"35b00c741955ecdf65e8a16d6f7099ef4a687af3","tarball":"https://registry.npmjs.org/rehype-katex-notranslate/-/rehype-katex-notranslate-1.1.1.tgz","fileCount":4,"integrity":"sha512-qV9gAtR9gpGMIAoZnZ6z+8a1u+ETciYZLmYr5Uw3XqbzZ5K+2U1k/Q7nkard3Xouhy/jbVOqlUCJCnJHtkMROQ==","signatures":[{"sig":"MEYCIQD/l1iXpuooIoMsTgMA4rH5FLhujAGumV7gHHcaT/sJAgIhAIs666H6+AugmxEsDG4z+KAZHirTescyQES0Lhfznbun","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4850},"main":"./dist/lib/index.js","type":"module","types":"./dist/lib/index.d.ts","exports":"./dist/lib/index.js","gitHead":"2a9559dc457ea8e0452c6d698b52da3645fdf406","scripts":{"test":"npm run build && node --test dist/test/index.test.js","build":"tsc --build --clean && tsc --build","format":"npx prettier . --write","prepack":"npm run build && npm run format"},"_npmUser":{"name":"edward-zhang","email":"643431636@qq.com"},"_npmVersion":"10.8.2","description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","directories":{},"_nodeVersion":"22.6.0","dependencies":{"hast":"^0.0.2","unified":"^11.0.5","hast-util-select":"^6.0.2"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.3.3","typescript":"^5.6.2","@types/node":"^22.7.4","rehype-parse":"^9.0.1","rehype-stringify":"^10.0.1","prettier-plugin-organize-imports":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/rehype-katex-notranslate_1.1.1_1728300650489_0.6194304703925151","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"rehype-katex-notranslate","version":"1.1.3","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","format","fmt","beautify","prettify","html"],"author":{"name":"Ethan Zhang"},"license":"MIT","_id":"rehype-katex-notranslate@1.1.3","maintainers":[{"name":"edward-zhang","email":"codemetic@outlook.com"}],"homepage":"https://github.com/PrinOrange/rehype-katex-notranslate","bugs":{"url":"https://github.com/PrinOrange/rehype-katex-notranslate/issues"},"dist":{"shasum":"d0ee0b32ba24885cc3daf7830c7898640955974c","tarball":"https://registry.npmjs.org/rehype-katex-notranslate/-/rehype-katex-notranslate-1.1.3.tgz","fileCount":5,"integrity":"sha512-yUc44x2fxnQRqzkPJD7WZNyHZ4t6h1E8ndN0tok4Hy/cq5NNCEe9/lIvZ8J0spiYl5AefoDtnSnDtMPoec/3eA==","signatures":[{"sig":"MEQCIA4Zk028tXTu3vM39Emzwce2E0/Du6wDo/kjEYYHVpupAiBHB2TTdoQ0LJAejmdYAGKKuB0UHtcgjuVCqgRTZPTLRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6109},"main":"./dist/lib/index.js","type":"module","types":"./dist/lib/index.d.ts","exports":"./dist/lib/index.js","gitHead":"03a66653d874592b954ef8ed2ac1be352d94dd59","scripts":{"test":"npm run build && node --test dist/test/index.test.js","build":"tsc --build --clean && tsc --build","format":"npx prettier . --write","prepack":"npm run build && npm run format"},"_npmUser":{"name":"edward-zhang","email":"codemetic@outlook.com"},"repository":{"url":"git+https://github.com/PrinOrange/rehype-katex-notranslate.git","type":"git"},"_npmVersion":"10.8.2","description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","directories":{},"_nodeVersion":"22.6.0","dependencies":{"hast":"^0.0.2","unified":"^11.0.5","unist-util-visit":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.3.3","typescript":"^5.6.2","@types/node":"^22.7.4","rehype-parse":"^9.0.1","rehype-stringify":"^10.0.1","prettier-plugin-organize-imports":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/rehype-katex-notranslate_1.1.3_1728447718870_0.22746250779139654","host":"s3://npm-registry-packages"}},"1.1.4":{"name":"rehype-katex-notranslate","version":"1.1.4","description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","main":"./dist/lib/index.js","type":"module","exports":"./dist/lib/index.js","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","translate","translation","browser","sanitize","format","fmt","html"],"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build","format":"npx prettier . --write","test":"npm run build && node --test dist/test/index.test.js"},"repository":{"type":"git","url":"git+https://github.com/PrinOrange/rehype-katex-notranslate.git"},"homepage":"https://github.com/PrinOrange/rehype-katex-notranslate","author":{"name":"Ethan Zhang"},"license":"MIT","devDependencies":{"@types/hast":"^3.0.4","@types/node":"^22.7.4","prettier":"3.3.3","prettier-plugin-organize-imports":"^4.1.0","rehype-parse":"^9.0.1","rehype-stringify":"^10.0.1","typescript":"^5.6.2"},"dependencies":{"unified":"^11.0.5","unist-util-visit":"^5.0.0"},"_id":"rehype-katex-notranslate@1.1.4","gitHead":"968333f7f4f7a2905fad9bbb65fdae3d3179a9d6","types":"./dist/lib/index.d.ts","bugs":{"url":"https://github.com/PrinOrange/rehype-katex-notranslate/issues"},"_nodeVersion":"22.6.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-zr2NMVDnTHAFyyVC14I00NDDlSwjvd//EWzIhazz6eNn34LeJQyFECaRBCVdqBIVA6KMvBooO26pfSZXjUG84Q==","shasum":"84b301f3963907991df4637e0ee863ed73a36eb1","tarball":"https://registry.npmjs.org/rehype-katex-notranslate/-/rehype-katex-notranslate-1.1.4.tgz","fileCount":5,"unpackedSize":6172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHO0449of1NWL3NhZMWXJWfUeOMNYOuli/f+Aa00hlSCAiBE+ZhfP42K9uso7miunMI0Zdl3xz0ewlRsUy33vLqzHA=="}]},"_npmUser":{"name":"edward-zhang","email":"codemetic@outlook.com"},"directories":{},"maintainers":[{"name":"edward-zhang","email":"codemetic@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-katex-notranslate_1.1.4_1730561175246_0.4945779514727813"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-07T01:41:46.864Z","modified":"2024-11-02T15:26:15.631Z","1.0.0":"2024-10-07T01:41:47.014Z","1.1.0":"2024-10-07T08:38:26.537Z","1.1.1":"2024-10-07T11:30:50.654Z","1.1.2":"2024-10-09T04:17:25.081Z","1.1.3":"2024-10-09T04:21:59.076Z","1.1.4":"2024-11-02T15:26:15.460Z"},"bugs":{"url":"https://github.com/PrinOrange/rehype-katex-notranslate/issues"},"author":{"name":"Ethan Zhang"},"license":"MIT","homepage":"https://github.com/PrinOrange/rehype-katex-notranslate","keywords":["unified","markdown","mdx","mdast","rehype","rehype-plugin","plugin","translate","translation","browser","sanitize","format","fmt","html"],"repository":{"type":"git","url":"git+https://github.com/PrinOrange/rehype-katex-notranslate.git"},"description":"Add the attribute translate=\"no\" to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage translation tools.","maintainers":[{"name":"edward-zhang","email":"codemetic@outlook.com"}],"readme":"# rehype-katex-notranslate\n\nThis package is a [unified][] ([rehype][]) plugin. It Add the attribute `translate=\"no\"` to the katex formula generated by rehype-katex to prevent the formulas from being recognized and translated by webpage and browser translation tools, like Chrome translate.\n\n## Contents\n\n- [rehype-katex-notranslate](#rehype-katex-notranslate)\n  - [Contents](#contents)\n  - [Install](#install)\n  - [Usage](#usage)\n  - [License](#license)\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install rehype-katex-notranslate\n```\n\n## Usage\n\nGenerally, this plugin is usually used with [rehype-katex][rehype-katex].\n\nSay our document is\n\n```html\n<p>\n  Lift(<code class=\"language-math\">L</code>) can be determined by Lift\n  Coefficient (<code class=\"language-math\">C_L</code>) like the following\n  equation.\n</p>\n<pre><code class=\"language-math\">\n  L = \\frac{1}{2} \\rho v^2 S C_L\n</code></pre>\n```\n\n```js\nimport rehypeDocument from 'rehype-document';\nimport rehypeKatex from 'rehype-katex';\nimport rehypeParse from 'rehype-parse';\nimport rehypeStringify from 'rehype-stringify';\nimport rehypeKatexNotranslate from 'rehype-katex-notranslate';\nimport {read, write} from 'to-vfile';\nimport {unified} from 'unified';\n\nconst file = await unified()\n  .use(rehypeParse, {fragment: true})\n  .use(rehypeDocument, {\n    // Get the latest one from: <https://katex.org/docs/browser>.\n    css: 'https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css',\n  })\n  .use(rehypeKatex)\n  .use(rehypeKatexNotranslate) // Use this plugin after rehype-katex\n  .use(rehypeStringify)\n  .process(await read('input.html'));\n\nfile.basename = 'output.html';\nawait write(file);\n```\n\nThen it will outputs with\n\n```html\n<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <title>input</title>\n    <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\" />\n    <link\n      href=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css\"\n      rel=\"stylesheet\"\n    />\n  </head>\n  <body>\n    <p>\n      Lift(<span class=\"katex\" translate=\"no\"><!--…--></span>) can be determined\n      by Lift Coefficient (<span class=\"katex\" translate=\"no\"><!--…--></span>)\n      like the following equation.\n    </p>\n    <span class=\"katex-display\"><!--…--></span>\n  </body>\n</html>\n```\n\nThis plugin will add the attribute `translate=\"no\"` for every katex blocks.\n\n## License\n\n[MIT][license] © [Codemetic][author]\n\n<!-- Definitions -->\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n[npm]: https://docs.npmjs.com/cli/install\n[license]: license\n[author]: https://dreams.plus\n[unified]: https://github.com/unifiedjs/unified\n[rehype]: https://github.com/rehypejs/rehype\n[rehype-katex]: https://github.com/remarkjs/remark-math/tree/main/packages/rehype-katex\n","readmeFilename":"README.MD"}