• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xieyuheng
V2EX  ›  程序员

我的嵌入在浏览器里的编辑器帅吗?

  •  
  •   xieyuheng ·
    xieyuheng · Oct 16, 2023 · 4773 views
    This topic created in 965 days ago, the information mentioned may be changed or developed.

    打开浏览器就能用(只支持 chrome 系的浏览器),可以编辑本地文件,可以预览 markdown 。

    源代码: https://github.com/xieyuheng/x-editor

    Supplement 1  ·  Oct 16, 2023
    甚至还支持 markdown 的图片(因为用 iframe 做预览,所以还挺难实现的)。

    ![]( https://gcdnb.pbrd.co/images/0bCS7crFW28s.png)
    Supplement 2  ·  Oct 16, 2023

    修复 post 格式:

    Supplement 3  ·  Oct 17, 2023

    它现在可以听 mp3。

    Supplement 4  ·  Oct 17, 2023

    它还可以看视频。

    Supplement 5  ·  Oct 17, 2023
    我无语了。

    我只能说 web 是个牛逼的平台。
    24 replies    2023-10-21 10:25:04 +08:00
    Chefback
        1
    Chefback  
       Oct 16, 2023   ❤️ 1
    Cool 加星了
    xieyuheng
        2
    xieyuheng  
    OP
       Oct 16, 2023
    @Chefback 嘿嘿,多谢啦。
    codehz
        3
    codehz  
       Oct 16, 2023
    说的好,我选择 vscode.dev (划掉)
    编辑本地文件用的是 filesystem api 做的吧
    话说文件名底下的横线是啥意思
    xieyuheng
        4
    xieyuheng  
    OP
       Oct 16, 2023
    @codehz 哈哈哈,又是你!

    横线 是 scrollbar
    xieyuheng
        5
    xieyuheng  
    OP
       Oct 16, 2023
    @codehz 是 filesystem api ,只有 chrome 系的支持。
    xieyuheng
        6
    xieyuheng  
    OP
       Oct 16, 2023
    levelworm
        7
    levelworm  
       Oct 16, 2023 via Android   ❤️ 1
    不错,看起来挺酷的~加油!
    Ajunie
        8
    Ajunie  
       Oct 16, 2023
    希望可以渲染 markdown 文件里的 html 标记
    hellcer
        9
    hellcer  
       Oct 16, 2023
    可以考虑加上打开来自 WebDAV 之类的远程文件吗?
    xieyuheng
        10
    xieyuheng  
    OP
       Oct 16, 2023 via Android
    @Ajunie 有发现不支持的 HTML 标记,欢迎来开 issue 。我也不知道哪些是目前不支持的。
    xieyuheng
        11
    xieyuheng  
    OP
       Oct 16, 2023 via Android
    @hellcer 我才听说这个 protocol 等等我研究一下。
    xieyuheng
        12
    xieyuheng  
    OP
       Oct 16, 2023
    预览 markdown 的实现方式是:把解析好的 markdown 发给 iframe 。

    在 markdown 预览本地图片的功能比较有意思,
    因为要在解析 markdown 的时候遍历 markdown 的节点,
    把里面的图片节点的 src 都替换为 base64 的 data URL ,
    再发给 iframe 。
    yustation
        13
    yustation  
       Oct 17, 2023
    帅😎
    SeanTheSheep
        14
    SeanTheSheep  
       Oct 17, 2023
    起猛了,看成了在浏览器里写嵌入式 ( ̄_ ̄|||)
    xieyuheng
        15
    xieyuheng  
    OP
       Oct 17, 2023
    我仔细思考了以下,其实只是 web 这个平台帅。
    我感觉这根本就不是我写的程序,只是 web 平台本身而已。
    lingeo
        16
    lingeo  
       Oct 17, 2023
    视频这块能播放 h264 编码视频?
    proxytoworld
        17
    proxytoworld  
       Oct 17, 2023
    怎么看起来像是一个脉脉上的腾讯老哥 天天吹他写的基于浏览器的啥啥 IDE
    supersu
        18
    supersu  
       Oct 17, 2023 via Android
    可以渲染 HTML 文本么,可以的话就爱了爱了,另外可以加一个 grep 搜索么~
    xieyuheng
        19
    xieyuheng  
    OP
       Oct 17, 2023
    @supersu 搜索可以加。等我之后加上。
    xieyuheng
        20
    xieyuheng  
    OP
       Oct 17, 2023
    @proxytoworld 我不用脉脉,也不是腾讯的。
    xieyuheng
        21
    xieyuheng  
    OP
       Oct 17, 2023
    @lingeo 就是调用浏览器本身的视频功能而已。浏览器能支持的话就能。
    supersu
        22
    supersu  
       Oct 18, 2023 via Android
    @xieyuheng 不要全文索引哦,我发现文本搜索只有 grep 这种暴力搜索才靠谱
    xieyuheng
        23
    xieyuheng  
    OP
       Oct 18, 2023 via Android
    @supersu 好的,就 substring 的搜索对吗?
    supersu
        24
    supersu  
       Oct 21, 2023 via Android
    @xieyuheng 嗯嗯是的,最好也支持一下忽略大小写,以及支持带空格的多关键词搜索~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2672 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 10:54 · PVG 18:54 · LAX 03:54 · JFK 06:54
    ♥ Do have faith in what you're doing.