feat(web): add zero-dependency static report reader - #99
Open
Vik1n9 wants to merge 1 commit into
Open
Conversation
Standalone reading front-end for reports/ — company-grouped browsing, full-text search, type filtering, and continuous reading for 《系列》 series articles. Pure Python stdlib index builder (no PyYAML), pure JS front-end (no framework/bundler). UI text matches this repo's existing Simplified Chinese convention. Includes scripts/add_frontmatter.py to backfill YAML frontmatter on reports that don't have any yet (dry-run by default, --apply to write).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
给
reports/加了一个纯静态、零依赖的阅读前端(web/),本地起个 HTTP server 就能用:新增文件
web/index.htmlweb/app.jsweb/md-render.js— 前端scripts/build_report_index.py— 建索引scripts/add_frontmatter.py— 给没有 frontmatter 的报告补company/type/date等字段(默认 dry-run,只打印会改什么;--apply才写入)web/reports— 指回../reports的 symlink(Pythonhttp.server --directory web只服务web/底下的内容,靠这个 symlink 让报告内容"看起来"也在web/底下)说明
web/index.html不能用file://直接打开(报告全文是即时 fetch 原始.md渲染的,CORS 会挡),必须用上面的 HTTP serverTest plan
python3 scripts/build_report_index.py跑过 2295 篇真实报告,索引产出正常(no_date=0)