爱意满满的作品展示区。
xcaptain

做了一个在线的 typst 编辑器

  •  1
     
  •   xcaptain · Jan 14, 2025 · 3341 views
    This topic created in 657 days ago, the information mentioned may be changed or developed.

    前段时间在本地用 vscode + typst 写了一些 ppt ,然后就产生了一个将 typst 编译器搬到浏览器上的想法,正好有大佬开源了 https://github.com/Myriad-Dreamin/typst.ts 所以我就用这个库加上 CodeMirror 编辑器,做了一个简单的网站,见:

    https://typ.ink/

    目前实现了基本的文件管理,编辑和预览导出的功能,欢迎大家来体验下

    12 replies  •  2025-01-16 18:56:20 +08:00
    lthero
    lthero
    Jan 14, 2025
    1
    有个 bug ,输入 nick name->google 登录->又要输入 nick name
    rqYzyAced2NbD8fw
    rqYzyAced2NbD8fw
    Jan 15, 2025
    2
    以前写文档都是极其痛苦的对着一堆 warning 和 error 改 latex ,typst 是我的救赎吗 🥹
    xcaptain
    xcaptain
    OP
    Jan 15, 2025
    3
    @lthero 看你已经注册进来了,有体验一下编辑的功能吗?
    0x0x
    0x0x
    Jan 15, 2025
    4
    这个颜色可以改下,刺眼
    xcaptain
    xcaptain
    OP
    Jan 15, 2025
    5
    @LanhuaMa 我感觉 typst 编译器报错提示做的还是比较好的,不过我因为用的是 CodeMirror 的编辑器,这个库比较小众,目前还不支持 typst 语法,所以我的编辑器连语法高亮都还没有
    xcaptain
    xcaptain
    OP
    Jan 15, 2025
    6
    手机上也是能用的,虽然编辑体验不是很好,但是做一些简单的修改,然后点击预览,导出都是可用的。如果要上传图片的话,可以长按 sidebar ,会触发 contextmenu 事件,展示一个上传按钮
    198plus
    198plus
    Jan 15, 2025 via Android
    7
    做一个 overleaf 类似的多人写作管理吧,做好了我给你付费
    catlovemouse
    catlovemouse
    Jan 15, 2025
    8
    👍

    请问“generate pdf slides using typst and AI”,AI 是体现在哪里呀
    xcaptain
    xcaptain
    OP
    Jan 15, 2025
    9
    @catlovemouse 忘记提了,我还使用了 https://github.com/yuri2peter/codemirror-ai-enhancer 这个大佬开发的 CodeMirror AI 补齐插件,如果按下 Ctrl + J 会触发补齐,如果选中一段文字,按下 Ctrl + K 会触发 AI 改写
    xcaptain
    xcaptain
    OP
    Jan 15, 2025
    10
    @198plus 好建议,我这几天研究下,应该不难做,CodeMirror 官方已经支持协同编辑功能
    bettercallbalds
    bettercallbalds
    Jan 16, 2025
    11
    很好的工具! 大佬
    preview 要等一段时间 请问这个是本地渲染的吗 能加速吗
    xcaptain
    xcaptain
    OP
    Jan 16, 2025❤️1
    12
    @bettercallbalds 是在本地渲染的,因为 typst.ts 这个库就是将官方的 rust 编译器编译为 wasm ,然后提供了一些 js 接口让浏览器能够调用 wasm ,慢的话我目前发现可能会有以下几个原因:
    1. 要加载 2 个 wasm 文件,大概 20 多 MB
    2. 要下载一些默认字体,大概是 20 多 MB
    3. 要通过网络去 packages.typst.org 下载第三方库

    这些东西都会缓存到浏览器内,所以后面再点击应该会快很多
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1675 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:39 · PVG 07:39 · LAX 15:39 · JFK 18:39
    ♥ Do have faith in what you're doing.