Repository navigation
Add tex2typst extension - #22667
Add tex2typst extension#22667
Conversation
- rm owner - init
commented
Nov 5, 2025
|
Congratulations on your new Raycast extension! 🚀 You can expect an initial review within five business days. Once the PR is approved and merged, the extension will be available on our Store. |
- rename icon - fix: ja 2 en - add icon
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds a new "tex2typst" extension that provides bidirectional conversion between TeX and Typst mathematical notation formats. The extension includes two no-view commands that read mathematical expressions from the clipboard, convert them using the tex2typst npm library, and copy the results back to the clipboard with toast notifications for user feedback. The implementation follows standard Raycast patterns with proper error handling, TypeScript configuration, and development tooling. All configuration files (ESLint, Prettier, TypeScript) adhere to Raycast's extension templates. The extension targets users who work with both LaTeX and Typst typesetting systems and need quick conversion capabilities.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/tex2typst/src/convert-tex-to-typst.ts | 4/5 | Implements TeX-to-Typst conversion command with proper error handling and clipboard operations |
| extensions/tex2typst/src/convert-typst-to-tex.ts | 3/5 | Implements Typst-to-TeX conversion with Japanese error message inconsistency |
| extensions/tex2typst/README.md | 4/5 | Comprehensive Japanese documentation for the extension functionality |
| extensions/tex2typst/package.json | 4/5 | Extension configuration with proper metadata and dependencies |
| extensions/tex2typst/CHANGELOG.md | 5/5 | Standard changelog with correct template string format |
| extensions/tex2typst/.gitignore | 5/5 | Standard Raycast extension gitignore configuration |
| extensions/tex2typst/tsconfig.json | 5/5 | Standard TypeScript configuration for Raycast extensions |
| extensions/tex2typst/eslint.config.js | 5/5 | Standard ESLint configuration following Raycast template |
| extensions/tex2typst/.prettierrc | 5/5 | Standard Prettier configuration matching Raycast guidelines |
Confidence score: 3/5
- This PR contains a mixed language issue that affects user experience consistency
- Score reduced due to the Japanese error message in the Typst-to-TeX converter while all other messages are in English, creating an inconsistent user experience
- The convert-typst-to-tex.ts file needs attention to fix the localization inconsistency on line 26
9 files reviewed, 2 comments
| } catch (e: unknown) { | ||
| const message = e instanceof Error ? e.message : String(e); | ||
| await showToast({ | ||
| title: "Conversion failed", | ||
| message, | ||
| style: Toast.Style.Failure, | ||
| }); | ||
| } |
There was a problem hiding this comment.
style: Could simplify error handling with showFailureToast from @raycast/utils
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Merge branch \'contributions/merge-1762485663071\' - Pull contributions - refactor: use `showFailureToast`
| # tex2typst (Raycast Extension) | ||
|
|
||
| TeX と Typst の相互変換を、Raycast からワンアクションで行う拡張機能です。 | ||
|
|
||
| ## 機能 | ||
|
|
||
| - TeX -> Typst 変換(クリップボードの TeX を Typst に変換してコピー) | ||
| - Typst -> TeX 変換(クリップボードの Typst を TeX に変換してコピー) | ||
| - 成功/失敗を Raycast のトーストで通知 | ||
|
|
||
| 変換ロジックは `tex2typst` ライブラリに依存しています。 | ||
|
|
||
|
|
||
| ## 使い方 | ||
|
|
||
| 1. 変換したいテキストをクリップボードにコピーします。 | ||
| - TeX を Typst にしたい場合: TeX をコピーして「Convert TeX to Typst」を実行 | ||
| - Typst を TeX にしたい場合: Typst をコピーして「Convert Typst to TeX」を実行 | ||
| 2. 実行後、結果はクリップボードへ上書きコピーされます。 | ||
| 3. 成功/失敗はトーストで表示されます。 | ||
|
|
||
| 補足: | ||
|
|
||
| - 本拡張は `no-view` モードで動作し、UI は表示しません(トーストのみ)。 | ||
|
|
||
| ## コマンド一覧 | ||
|
|
||
| - Convert TeX to Typst (`convert-tex-to-typst`) | ||
| - Convert Typst to TeX (`convert-typst-to-tex`) | ||
|
|
||
| ## 開発 | ||
|
|
||
| インストールと開発サーバー起動: | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ビルド: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| Lint: | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| npm run fix-lint | ||
| ``` | ||
|
|
||
| 公開(Raycast Store へ): | ||
|
|
||
| ```bash | ||
| npm run publish | ||
| ``` | ||
|
|
||
| ## ライセンス | ||
|
|
||
| Apache License 2.0 No newline at end of file |
There was a problem hiding this comment.
At the moment, Raycast doesn't support localization and only supports US English. Therefore, please avoid introducing your custom way to localize your extension. If the locale might affect functionality (e.g. using the correct unit of measurement), please use the preferences API.
commented
Nov 7, 2025
|
I apologize for having used a Japanese README due to a lack of thorough checking on my part. I have made the necessary corrections, so could you please review the Pull Request again? I am sorry for the inconvenience this has caused. |
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. The developer has addressed the previous feedback by refactoring error handling to use showFailureToast from @raycast/utils instead of manually constructing toast notifications. Both conversion command files (convert-tex-to-typst.ts and convert-typst-to-tex.ts) now use this utility function, simplifying error handling code from 4 lines to 1 line per error case. Additionally, the README.md has been translated from Japanese to English to comply with Raycast's localization guidelines that require US English only. These changes improve code consistency, reduce boilerplate, and align with Raycast's recommended practices.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/tex2typst/src/convert-typst-to-tex.ts | 5/5 | Refactored error handling to use showFailureToast utility instead of manual toast construction |
| extensions/tex2typst/src/convert-tex-to-typst.ts | 5/5 | Simplified error handling by adopting showFailureToast from @raycast/utils |
| extensions/tex2typst/README.md | 5/5 | Translated documentation from Japanese to English for Raycast localization compliance |
Confidence score: 5/5
- This PR is safe to merge with minimal risk
- Score reflects clean refactoring following Raycast best practices and compliance with localization guidelines
- No files require special attention
3 files reviewed, no comments
commented
Nov 7, 2025
|
Published to the Raycast Store: |
commented
Nov 7, 2025
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Adds two commands: one to convert TeX math expressions on the clipboard to Typst, and another to convert Typst math expressions to TeX.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder