Markdown handling & marked script handling
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- frontend, performance
调研方向
首先定位 fileData.extension === 'md' 的渲染路径、marked CDN 引用,以及现有的 Prettier 格式化/源代码控制。比较提议的 Markdown 查看选项和脚本加载变更;完成标准应包括就源代码/格式化视图体验达成一致,并确认 Markdown 处理不再带来不必要的加载成本。
由索引模型根据 Issue 内容生成。
描述
The way runpkg currently works, viewing a markdown (.md) file shows us the formatted version, thanks to the marked markdown parser.
Problems:
- Currently there's no way to view the source of a markdown file on
runpkg. We just render the formatted version iffileData.extension === 'md'and there's no way to disable this. - In running some lighthouse performance tests, it does seem that - although it's not the heaviest package - loading this script has a noticeable impact on performance metrics like TTI. This seems an unnecessary price to pay when it's likely that most pages viewed are not markdown.
- Bonus: is there a particular reason we're using
jsdelivroverunpkgto serve this script? If not, it seems in the spirit of this project to move from usinghttps://cdn.jsdelivr.net/npm/marked/marked.min.jstohttps://unpkg.com/[email protected]/marked.min.jsorhttps://unpkg.com/marked/marked.min.js
Proposals:
- Make formatted/source view similar to what we do for prettier. My thoughts would be to a) add a checkbox to toggle formatted/source view, b) add a button similar to the prettier formatting button to format markdown, or c) change the prettier button to be a "format markdown" button when viewing markdown (the same as b, but saving space with the downside of no markdown prettification)
- If we tackle proposal 1, we can then
defer/asyncthe script - Move to using
https://unpkg.com/[email protected]/marked.min.js
Thoughts?
- 主要语言
- JavaScript
- 星标
- 307
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FormidableLabs/runpkg 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
FormidableLabs/runpkg#209 · 4 条评论 ·
-
bug improvement
难度 4/5 3-5 天 新手友好度 28/100
FormidableLabs/runpkg#183 ·
-
Prettier enhancements: feedback/state & options可能重新可做 @kiraarghy 于 2471 天前认领,目前没有进行中的 PR。 未关闭
FormidableLabs/runpkg#176 · 1 条评论 · 已指派 3 人 ·
-
"Contributing" doc可能重新可做 @kiraarghy 于 2471 天前认领,目前没有进行中的 PR。 未关闭
FormidableLabs/runpkg#174 · 1 条评论 · 已指派 2 人 ·
-
难度 3/5 1-2 天 新手友好度 35/100
FormidableLabs/runpkg#172 · 1 条评论 ·
查看 FormidableLabs/runpkg 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Spomky-Labs/pwa-bundle#476 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
c1overzz/dsh-bili-scroll#35 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 68/100
pbakaus/impeccable#1077 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复