Fishreadyes
卷累了?放松一下!全功能隐藏型摸🐟阅读插件
💡功能
- 特色功能
- 自动翻页
- 任意文件/位置隐藏阅读
- 支持epub/txt格式
- 其它功能
- 多级目录
- 书签
- 书内查找(支持正则表达式)
- 回退/前进
- 跳页
- 当前进度自动保存
- 切换书籍
💡预览图
💡安装
推荐VSCODE版本:> 1.90.0
💡简单示例
启动/退出插件:安装插件后,会在最下方状态栏(status bar)上显示一个播放按钮 (点击后会变成暂停按钮 ),点击后启动插件。点击第二下退出插件。
p.s. 启动后插件会自动打开预置模板代码example_copy.js (可更改,见后文更换模板说明),并自动将光标定位在第22行(可更改,见后文"{1}"书籍内容刷新标志位 说明),书籍(预置书籍为xiyouji.txt )的当前行的内容也会显示在此处。
快捷键
快捷键 |
功能 |
何时生效 |
ctrl+, |
启动/退出插件 |
- |
ctrl+f |
书内查找 |
启动插件后 |
上/下键 |
翻页 |
启动插件后 |
ctrl+左/右键 |
回退/前进 |
启动插件后 |
ctrl+t |
自动翻页 |
启动插件后 |
用户可以在File-Preference-Keyboard Shortcuts 中更改/禁用上述按键绑定。也可以为其它命令,比如打开目录、切换书籍等功能绑定快捷键。
--- 分割线(后面详细内容太长可以不看) ---
💡控制功能 - 新增
- 设置临时
书籍内容刷新标志位 (命令 Fishreadyes: Set Reading Position ):为了更灵活的阅读,用户可在任意代码文件(不限制在临时代码文件内)、任意位置设置临时书籍内容刷新标志位 。之后,插件就可以识别、并在此标志位的位置显示书籍内容。
- 操作步骤:
- 在插件设置(
Preferences: Open User Settings -Fishreadyes: Child Lock )中,去除童锁的勾选(默认童锁是勾选,即处于SafeMode的启用状态)。
- 将光标移至想要刷新书籍内容的位置,使用
ctrl+shift+p 打开命令面板,输入命令Fishreadyes: Set Reading Position 以设置临时书籍内容刷新标志位 。之后,插件就可以识别、并在此标志位的位置显示书籍内容。
- 点击状态栏的
播放按钮 启动插件开始阅读。
- 点击状态栏的
暂停按钮 退出插件并清除此临时标志位,显示的书籍内容自动隐藏。
- 注:默认童锁是启用状态(即处于SafeMode)。因为每次书籍内容更新会修改当前文件内容,所以为了防止用户误用此功能修改了自己的重要代码(其实问题不大,即使修改了,undo一下不就没事了?)。
💡控制功能
- 启动/退出插件(
命令 Fishreadyes: Run Or Stop ):安装插件后,会在最下方状态栏(status bar)上显示一个播放按钮 (点击后会变成暂停按钮 ),点击后启动插件。点击第二下退出插件。
- 启动插件后发生的事件:
- 一些默认的按键绑定会更改(见下文按键绑定更改说明)。
- 状态栏(status bar)会显示阅读工具按钮,比如翻页、目录、书内查找等等。
- 根据模板代码文件生成
临时代码文件 (在tmp文件夹下,随意修改/删除也没事),插件自动将光标定位在用户指定位置(即{1} 标志位,见后文"{1}"书籍内容刷新标志位 说明)、并在此处显示书籍内容。
- 默认打开的是上次阅读的书籍,且阅读信息包括书签和进度也会保持上次阅读的状态。
- 退出插件后发生的事件:
- 按键绑定会自动解绑。
- 状态栏(status bar)阅读工具按钮自动隐藏。
- 显示的书籍内容自动隐藏。
用户书籍目录 :使用命令 Fishreadyes: Copy Book Path 复制书籍目录地址,或使用命令 Fishreadyes: Open Book Path 打开书籍目录,在此目录添加用户书籍。p.s. 也可以直接去打开,很好找,比如在windows中,这个目录一般是C:\Users\用户名\.vscode\extensions\yctest9296.fishreadyes-版本号\doc
- 更换模板代码文件流程(
命令 Fishreadyes: Create Template )
- 先打开任意用户代码文件(假设用户想要将此代码文件作为模板)。
- 使用
ctrl+shift+p 打开命令面板,输入命令Fishreadyes: Create Template 以生成模板文件。
- 生成模板文件成功后,会在右下角弹出提示框
Create completed! Pls add identifier "{1}" manually in this template! 。
- 点击提示框中
Open and edit 按钮,会自动打开模板文件,用户在任意位置(建议选注释行)手动增加{1} 这个书籍内容刷新标志位 。之后,插件就可以识别、并在此标志位的位置显示书籍内容。
- 重置当前书籍(
命令 Fishreadyes: Soft Reset Current Book ):如果阅读时出现异常情况,用户可以尝试此命令,重置并清空当前书籍的阅读状态。
按键绑定 :
- 安装插件后,
ctrl+, 绑定为启动/退出插件 。
- 启动插件后,
ctrl+f 绑定为书内查找 ,
上/下键 绑定为翻页 ,
ctrl+左/右键 绑定为回退/前进 。
- 退出插件后,插件会自动解绑上述按键、恢复原功能。
- 用户可以在
File-Preference-Keyboard Shortcuts 中更改/禁用上述按键绑定,也可以为其它命令,比如自动翻页、打开目录等功能绑定快捷键。
💡阅读功能(阅读工具按钮)
- 翻页
- 按钮位于状态栏左侧。或使用
上/下键 快捷键。
- 插件规定每翻一页为刷新、显示书籍内容的一行(一行50个字符)。
- 自动翻页
- 按钮位于状态栏左侧。
- 在插件设置(
Preferences: Open User Settings -Fishreadyes: Auto Page Turning )中,可以设置自动翻页的间隔时间,单位是毫秒。默认是1000ms,即1秒翻页一次。
- 自定义多级目录
- 按钮位于状态栏左侧。
- 目录打开后会自动将光标定位至当前章节。
- 默认的设置有两级目录,用于解析预置书籍(即
xiyouji.txt )。
- 目录解析时,支持用户的自定义正则表达式或字符串:
- 在插件设置(
Preferences: Open User Settings -Fishreadyes: Chapter Split )中,用户可自己添加多级目录,不限制目录级数。
- 用户想恢复默认设置可以点击当前设置左侧的
齿轮按钮 -Reset Setting 。
- 提示:用户如果需要增加对多本书籍的目录解析,可以使用正则表达式的常见用法,比如在正则表达式中这么写:
/(解析书籍1目录的正则|解析书籍2目录的正则|等等)/ 。
- 书签
- 书内查找(支持正则)
- 按钮位于状态栏左侧。或使用
ctrl+f 快捷键。
- 用于在书内全文查找搜索,最多查找的内容为50个字符(也就是显示的一行的最大长度)。比如,正则
/.{0,50}/ 返回的搜索结果为书籍每一行,而/.{51}/ 超出50字符的限制就返回搜索内容为空。
- 支持跨一行搜索。
- 搜索的结果列表中,优先定位在离当前阅读位置最近的结果。
- 提示一下,返回搜索结果列表的最上方也有一个输入框(在这个输入框的placeholder中,我标记了
Optional: input to screen result ),这个输入框是vscode默认功能,在此输入框输入内容默认为筛选当前搜索结果。
- 回退/前进
- 按钮位于状态栏左侧。或使用
ctrl+左/右键 快捷键。
- 插件会自动记录页码历史,比如用户从当前页5跳到页10,按
回退按钮 则会回退到页5,再按前进按钮 则会前进到页10。
- 最多保存100个页码历史。
- 当前进度
- 按钮位于状态栏右侧。
- 显示为
当前页码/总页码 。
- 点击则触发
跳页 功能。
- 切换书籍
- 当前阅读书名
- 跳页
- 点击
当前进度按钮 ,在输入框输入目标页码,按回车键确认跳转。
- 阅读状态信息
- 阅读状态信息包括当前书名、阅读进度,和书签。
- 每次页码变化或书签更新,插件会自动保存当前的阅读状态信息。
- 关于epub格式书籍解析
- 解析逻辑:用户首次选择阅读epub格式书籍,插件会自动解析、并缓存其为同名txt文本到同目录下。再次阅读则直接使用此同名txt文件。
- 添加脚注序号功能(默认关闭):在插件设置(
Preferences: Open User Settings -Fishreadyes: Parse Epub Footnote )中,可选择打开添加脚注序号功能。因为epub解析后为纯文本,无法使用原epub的脚注链接跳转,那么插件自动添加脚注序号以便于定位脚注的位置,添加的脚注序号格式为[fn序号] 。
- 只支持同一章节内跳转的脚注。
- 见已知问题3,如果用户epub内书籍内容的格式不规范,那么添加脚注序号可能会出现异常。
💡已知问题
- 修改当前阅读中使用的临时代码文件(一般也不会有人修改。p.s. 修改或删除都没事),有可能会让书籍内容显示异常。解决方法:关闭临时代码文件,并点击
播放按钮 两次(即退出再启动插件)即可自动恢复。
- 如果用户使用python脚本作为模板代码,有时会有
1 file to analysis 的提示出现在状态栏(status bar)左侧,影响用户体验(其实也还好)。可能是因为python的pylance插件检查到了代码变动并花费一定时间分析(推测和用户模板代码长度或电脑性能相关)。解决方法:用户阅读时可以手动将pylance暂时禁用。
- 为epub书籍添加脚注时,如果用户epub内书籍内容的格式不规范,那么添加脚注序号可能会出现异常。比如,epub书籍中的某一章节html中包含
<a href="xxx"><p>内容</p></a> (p元素直接嵌套在a元素内是不合规的),则会重复添加多个脚注。
💡本插件仅供学习参考
Fishreadyes
Take a break and have a read! All-in-One "Slacking" Reading Extension.
Function
- Cool Features
- auto page turning
- reading in any code file, at any location
- support epub/txt format book
- Others
- multi-level directories
- bookmarks
- in-book search (with regex support)
- back/forward navigation
- jumping to specific pages
- automatic saving of current progress
- switch books
Installation
Recommended VSCODE Version:> 1.90.0
Author
yctest9296
Quick Start
Start/Stop Function: After installing, a Play Button (that turns into a Pause Button upon click) appears on the bottom status bar. Click it to start the extension and click again to stop.
p.s. Upon starting, the extension automatically opens the predefined template code example_copy.js (modifiable, see Template Replacement Instructions) and positions the cursor at line 22 (modifiable, see "{1}" Book Content Refresh Placeholder). The content of the current line of the book (default is xiyouji.txt ) will also be displayed here.
Preview
Multi-Level Directories Preview PNG
Auto-PageTurning Function Preview GIF
Keybindings
Keybindings |
Function |
When functional |
ctrl+, |
Start/stop extension |
- |
ctrl+f |
In-book search |
After extension started |
up/down |
Flip Pages |
After extension started |
ctrl+left/right |
Go back/forward |
After extension started |
ctrl+t |
auto page turning |
After extension started |
Users can modify/disable these bindings or assign new shortcuts to functions, like open table of content and change reading book in File-Preference-Keyboard Shortcuts .
Control Functions - New added
- Set Temporary Book Content Refresh location (
Command: Fishreadyes: Set Reading Position ): For more flexible reading, users can set a temporary book content refresh location in any code file, at any location.The extension will then display book content at this new location.
- Steps:
- Disable the Child Lock in extension settings (
Preferences: Open User Settings - Fishreadyes: Child Lock ).
- Move the cursor to the desired location, open the Command Palette with
ctrl+shift+p , and input Fishreadyes: Set Reading Position to set the temporary location. The extension will then display book content at this new location.
- Start reading by click
Play Button in status bar.
- Stop the extension by click
Pause Button in status bar to hide displayed content and auto-clear this temporary location.
- Note: Child Lock is enabled by default to prevent accidental modifications to important user code.
Control Functions
Start/Stop Function (Command: Fishreadyes: Run Or Stop ): After installation, a Play Button appears on the status bar. Click to start the extension and click again to stop.
- After Starting:
- Default keybindings are altered (see Keybind Changes).
- Reading tool buttons appear on the status bar, such as for flipping pages, accessing directories, and searching within the book.
- A
Temporary Code File (in the tmp folder, safe to modify/delete) is generated based on the template code file. The extension automatically positions the cursor at the {1} placeholder (see "{1}" Book Content Refresh Placeholder) and displays the book content there.
- The last read book is opened by default, with bookmarks and progress preserved.
- After Stopping:
- Keybindings are automatically unbound.
- Reading tool buttons on the status bar hide.
- Displayed book content disappears.
User Book Directory : Use Command: Fishreadyes: Copy Book Path to copy the book directory path, or Command: Fishreadyes: Open Book Path to open it and add user books. Alternatively, navigate to the directory directly (e.g., in Windows, it's typically C:\Users\Username\.vscode\extensions\yctest9296.fishreadyes-version\doc ).
Replace Template Code File (Command: Fishreadyes: Create Template )
- Open any user code file (intended to be used as a template).
- Use
ctrl+shift+p to open the Command Palette, input Fishreadyes: Create Template to generate the template file.
- After successful generation, a prompt appears in the bottom-right corner, instructing to add
{1} manually as the book content refresh placeholder in the template.
- Click
Open and edit to automatically open the template file. Manually add {1} at any location (preferably a comment line). The extension will then recognize and display book content at this placeholder.
Reset Current Book (Command: Fishreadyes: Soft Reset Current Book ): In case of reading issues, use this command to reset and clear the current book's reading state.
Keybindings
- After installation,
ctrl+, is bound to Start/Stop Extension .
- When the extension is active:
ctrl+f is bound to Search Within Book ,
Up/Down Arrows are bound to Flip Pages ,
ctrl+Left/Right Arrows are bound to Back/Forward Navigation .
- Upon stopping the extension, bindings are automatically unbound, restoring original functions.
- Users can modify/disable these bindings or assign new shortcuts in
File-Preference-Keyboard Shortcuts .
Flip Pages: Located on the left side of the status bar or use Up/Down Arrows . Each page flip displays one line of book content (50 characters per line).
Auto-PageTurning: Located on the left side of the status bar. Set the interval in milliseconds in extension settings (Preferences: Open User Settings - Fishreadyes: Auto Page Turning ). Default is 1000ms (1 second).
Custom Multi-Level Directories:
- The button is located on the left side of the status bar.
- When the directory is opened, the cursor will automatically be positioned to the current chapter.
- The default setting includes a two-level directory for parsing pre-installed books (e.g.,
xiyouji.txt ).
- During directory parsing, custom regular expressions or strings are supported for users:
- In the plugin settings (
Preferences: Open User Settings -> Fishreadyes: Chapter Split ), users can add multi-level directories themselves without any limitation on the number of levels.
- If users want to restore the default settings, they can click the
Gear Button on the left side of the current settings and select Reset Setting .
- Tip: If users need to add directory parsing for multiple books, they can utilize common practices of regular expressions, for example, writing something like this in the regular expression:
/(regular expression for parsing book 1's directory|regular expression for parsing book 2's directory|etc.)/ .
Bookmarks: Located on the left side of the status bar. Supports adding/batch deleting bookmarks.
In-Book Search (with Regex):
- The button is located on the left side of the status bar, or you can use the
Ctrl+F shortcut key.
- Perform a search within the whole book, with a maximum search content limit of 50 characters (which is the maximum length of a displayed line). For example, the regex
/.{0,50}/ will return search results for every line of the book, whereas /.{51}/ exceeds the 50-character limit and will return an empty search result.
- Cross-line search is supported.
- In the search results list, priority is given to locating the result closest to the current reading position.
- As a reminder, there is also an input box at the top of the search results list (I have labeled the placeholder as
Optional: input to screen result ), which is a default feature of VS Code. Entering content in this input box will by default filter the current search results.
Back/Forward Navigation: Located on the left side of the status bar or use ctrl+Left/Right Arrows . Automatically saves up to 100 page history entries.
Current Progress: Located on the right side of the status bar. Displays Current Page/Total Pages and triggers the jump-to-page function upon click.
Open Book: Located on the right side of the status bar. Selects user books. Can add/remove books from the User Book Directory.
Current Book Title: Hover over the Open Book button to display.
Jump to Page: Click the Current Progress button, input the target page number, and press Enter to jump.
Reading State Information: Includes current book title, reading progress, and bookmarks. Automatically saved upon page changes or bookmark updates.
Known Issues
- Modifying the Temporary Code File during reading (unlikely) may cause display issues. Solution: Close the file, click the
Play Button twice (stop and then start the extension) to restore.
- Using Python scripts as template code may sometimes display "1 file to analysis" in the status bar, affecting the user experience (minor). This may be due to the pylance extension analyzing code changes. Solution: Temporarily disable pylance during reading.
This extension is for learning and reference only
| |