{"id":16973833,"url":"https://github.com/tiansh/reader","last_synced_at":"2025-04-04T11:08:25.109Z","repository":{"id":55068006,"uuid":"244350621","full_name":"tiansh/reader","owner":"tiansh","description":"tReader，网页 TXT 文本阅读器，Web App；TXT file reader on webpage","archived":false,"fork":false,"pushed_at":"2025-02-26T14:48:37.000Z","size":5653,"stargazers_count":186,"open_issues_count":1,"forks_count":53,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T10:07:09.389Z","etag":null,"topics":["book","bookreader","novel","pwa","txt","txtreader","web-app"],"latest_commit_sha":null,"homepage":"https://tiansh.github.io/reader","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiansh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-02T11:10:07.000Z","updated_at":"2025-03-28T09:47:01.000Z","dependencies_parsed_at":"2024-10-27T12:47:23.483Z","dependency_job_id":"f3d6a8d8-d308-4d33-a3d7-987df926ec77","html_url":"https://github.com/tiansh/reader","commit_stats":{"total_commits":268,"total_committers":2,"mean_commits":134.0,"dds":"0.011194029850746245","last_synced_commit":"7b573b875bdba5d2ba4f381e24cb2acde25df9bf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansh%2Freader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansh%2Freader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansh%2Freader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansh%2Freader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiansh","download_url":"https://codeload.github.com/tiansh/reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166166,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["book","bookreader","novel","pwa","txt","txtreader","web-app"],"created_at":"2024-10-14T01:03:46.953Z","updated_at":"2025-04-04T11:08:25.090Z","avatar_url":"https://github.com/tiansh.png","language":"JavaScript","readme":"# tReader\n\nhttps://tiansh.github.io/reader\n\n又一个 TXT 文本阅读器：支持按词语的繁简转换，及利用浏览器内置语音朗读，阅读功能全面；配色字体到其他排版布局高度可定制化；同时界面简洁帮助阅读免于打扰。\n\n## 使用\n\n* 访问 https://tiansh.github.io/reader ，点击左上角加号添加文件即可使用。\n* 支持纯文本文件（.txt）和经过 gzip 压缩的纯文本文件（.txt.gz）。建议使用 UTF-8 编码以避免乱码。\n* 一些浏览器支持将应用“安装”或“添加到主屏幕”，选择对应选项后可以安装应用。应用无需安装即可使用，但安装后可以支持在不连接到互联网时继续使用。\n* 具体的使用帮助请参考 https://tiansh.github.io/reader/help/zh_cn.html 。\n* 除了下载和检查更新外，应用不包括联网功能。您的设置、小说等内容都存储在您的设备上，不会发送给任何人。具体的隐私协议请参考 https://tiansh.github.io/reader/help/privacy.html 。\n（另请注意，使用在线的语音朗读时，浏览器或操作系统提供的语音合成工具可能连接互联网。这些语音合成工具并非由阅读器本身提供，使用时请参考对应的隐私协议。）\n\n### 高级设置\n\n有部分不适合放在设置中的琐碎可调整项目，放在了高级设置中。高级设置输入框接受一个 ini 格式的配置，具体格式如下。\n\n```ini\n[appearance]\n; 当屏幕宽度达到如下值时，目录信息使用侧栏显示\nscreen_width_side_index=960\n; （仅翻页模式）当屏幕宽度达到如下值时，使用两栏模式显示\nscreen_width_two_column=960\n; （仅翻页模式）当屏幕宽度达到如下值时，即便显示了侧边栏目录，仍然使用两栏模式显示\nscreen_width_two_column_index=1260\n; （仅滚动模式）在屏幕外预加载的文本数量，设置更大的数字以加载更多文本\nscroll_buffer_factor=3\n; （仅滚动模式）文本区域的最大宽度\nscroll_max_text_width=800\n; （仅滚动模式）自动滚动的默认速度，数字越大速度越快\nscroll_speed=20.0\n; 允许使用鼠标第四键第五键翻页（使用 Chrome 安装后可用）\nmouse_paging=false\n; 添加自定义 CSS\ncustom_css=\n\n[reader]\n; 翻页模式时点击左中右侧的操作\n; 半角逗号分隔，可选值 `prev`, `next`, `menu`, `noop`\nflip_touch_action=prev,menu,next\n; 滚动模式时点击上中下侧的操作\n; 半角逗号分隔，可选值 `prev`, `next`, `menu`, `noop`\nscroll_touch_action=prev,menu,next\n\n[text]\n; 逐个尝试以下字符编码读取 txt 文件\n; 如果遇到解析错误会自动尝试下一种字符编码\n; 使用最后一种字符编码解析时，如果遇到错误会解析成豆腐字符\n; 该项设置仅影响导入 txt 时的行为，对导入完成的 txt 无影响\nencoding=utf-8,gbk,big5,utf-8\n; 生成目录时，仅考虑长度不超过如下值的行\ncontents_max_length=100\n; 生成目录时，如果识别到的目录条目数量超过如下限制，会拒绝生成目录\ncontents_size_limit=5000\n; 搜索时用户输入识别方式\n; 支持取值 text, wildcard, regex\nsearch_mode=text\n; 搜索时正则的标志，i 为忽略大小写\nsearch_flags=iu\n\n[speech]\n; 语音朗读时，单条语音最多的字数\nmax_char_length=1000\n; 语音朗读时，预先调度的语音条数\nqueue_size=10\n; 显示媒体会话界面\nmedia_session_enable=false\n; 语音朗读忽略满足如下正则（ECMAScript）的文本行\nskip_text_regex=/^\\s*$/u\n; 语音朗读遇到文章结尾时自动从开头重读\nloop_enable=false\n; 页面切换到后台时暂停朗读\npause_on_hidden=false\n; 在每段末尾追加朗读的文本\nextra_suffix=\n```\n\n请谨慎配置高级设置功能，错误配置可能造成显示错误甚至完全无法使用。\n\n## 开发\n\n### 分支管理\n\n目前 master 分支是实际部署使用的代码版本。 beta 分支是正在开发的任何功能。 gh-pages 分支用于部署 GitHub Pages。\n\n如果你希望贡献代码，可以根据当前 beta 分支的内容，考虑在 master 或 beta 分支基础上进行修改。\n\n### 本地调试\n\n项目本身没有使用构建工具，或者说并没有编译的必要。检出代码后，直接在 src 目录下运行任意的 HTTP 服务器即可开始调试。利用常见的简单本地 HTTP 服务器如 [NPM 的 node-static](https://www.npmjs.com/package/node-static) 或 [Python 的 http.server](https://docs.python.org/3/library/http.server.html) 等工具服务 src 目录下的文件，即可在浏览器中打开并调试。\n\n因为项目使用了 ServiceWorker 提供离线使用支持，在浏览器刷新网页可能会获取到 ServiceWorker 缓存的历史版本。所以调试时可以考虑禁用浏览器的 ServiceWorker 支持。\n\n### 希望添加某某功能\n\n因为 Web APP 的限制，以下功能 iOS 上目前没法支持：\n\n* 旋转锁定\u003csup\u003e[\\[MDN\\]](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation)\u003c/sup\u003e\n* 背光亮度调整\n* 隐藏手机顶部的信号与电量信息\n* 切换应用时隐藏屏幕快照\n\n所以如上相关的各种问题就不用再问我了。\n\n但如果你要针对 Android 做任何上述功能，还是欢迎 PR。\n\n### 繁简转换\n\n项目的繁简转换规则基于 OpenCC 的词典整理而来。为了满足自己的使用，有一些自己的修改。\n\n* 繁简转换包含单字转换和词转换两个词典；\n* 此外整合了部分地区用字习惯的规则；\n* 在上述基础上去掉了四个字以上的转换规则，部分人名条目，和一些冗余的规则；\n* 此外还有一些另行添加或修改的规则项目。\n\n繁简转换的词典见 `./han/` 目录。繁简转换相关逻辑请参考 https://github.com/tiansh/opencc-fsm 项目。\n\n## Open Source Credits\n\n* normalize.css: from normalize v8.0.1\n    * MIT License; https://github.com/necolas/normalize.css\n* icon.svg / icon.woff based on Feather\n    * MIT License; https://github.com/feathericons/feather\n* pako: JavaScript port of zlib\n    * MIT License, ZLIB License: https://github.com/nodeca/pako\n* s2t.json, t2s.json Chinese traditional / simplified translation tables based on OpenCC\n    * Apache License 2.0; https://github.com/BYVoid/OpenCC\n    * For more details about the modification, see https://github.com/tiansh/opencc-fsm\n\n## About\n\nCopyright (C) 2020-2025 田生\n\nThis project is released under the Mozilla Public License 2.0 with no copyleft exception. You may checkout LICENSE file for more detail.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiansh%2Freader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiansh%2Freader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiansh%2Freader/lists"}