Skip to content

Commit

Permalink
docs: 📝 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
hymbz committed Jan 3, 2024
1 parent e056f14 commit 999dd01
Show file tree
Hide file tree
Showing 37 changed files with 859 additions and 130 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: updatePage

on:
push:
paths:
- '**.md'

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Build
run: pnpm run docs:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: 'comic-read-docs'
directory: 'docs/.vitepress/dist'
branch: main
6 changes: 3 additions & 3 deletions .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
run: pnpm install --no-frozen-lockfile

- name: Build
run: pnpm run build:pwa
run: pnpm run pwa:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: 'comic-read'
directory: 'src/pwa/dist'
projectName: "comic-read"
directory: "src/pwa/dist"
branch: main
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body_path: docs/LatestChange.md
body_path: docs/.other/LatestChange.md
files: |
ComicRead.user.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
dev-dist
node_modules
cache
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![页面填充示例](/docs/images/页面填充示例.webp)
![页面填充示例](/docs/public/页面填充示例.webp)

<p align="center">
<a href="https://sleazyfork.org/zh-CN/scripts/374903-comicread" target="_blank"><img src="https://img.shields.io/greasyfork/v/374903"></a>
Expand All @@ -12,7 +12,7 @@

这是一个因为目前大部分漫画站都不支持双页显示,所以每次遇到 **漫画中的跨页大图被分割成两页** 就很不爽的人为了有更好的漫画阅读体验而写的油猴脚本,为主流漫画站增加了**双页阅读模式**和各种优化体验的增强功能。

脚本会在网页右下角弹出用于 **进入阅读模式** 的悬浮按钮,其上的快捷按钮用于切换站点增强功能的开启与否。默认会开启**自动进入阅读模式**的功能,也可在这里关闭。脚本没有全局设置,所有修改都只会在当前站点生效保存。~~反正平时也就只上那几个站点~~
脚本会在网页右下角弹出用于 **进入阅读模式** 的悬浮按钮,其上的快捷按钮用于切换站点增强功能的开启与否。默认会开启**自动进入阅读模式**的功能,也可在这里关闭。脚本没有全局设置,所有修改都只会在当前站点生效保存。~~反正平时也就只上那几个站点~~

对于支持站点以外的网站,脚本也提供了「[简易阅读模式](#简易阅读模式)」,除了得手动跳转上/下一话外,和支持站点的使用体验没有区别。

Expand Down Expand Up @@ -51,7 +51,7 @@

如果你在用双页模式阅读漫画时完全没有违和感,也不追求漫画左右页位置正确,那不需要了解也完全没事。反倒是在了解后可能会因为意识到违和感的存在,并在阅读少部分漫画时因为不管怎么调整都觉得不对而浑身难受。

但如果你追求接近翻阅实体书的体验、希望了解页面填充功能,并且**不是强迫症敏感体质**那还是非常推荐点进「[详情](https://github.com/hymbz/ComicReadScript/blob/master/docs/PageFill.md)」了解一下如何判断页面的左右页位置是否正确,并顺带看下该功能的详细介绍。
但如果你追求接近翻阅实体书的体验,并且**不是强迫症敏感体质**那还是非常推荐了解一下《[如何判断漫画左右页位置是否正确?](https://comic-read-docs.pages.dev/判断左右页位置.html)

## 卷轴模式

Expand All @@ -73,8 +73,8 @@

如果需要翻页的话,可以安装:

1. 能够自动识别大部分网页的[东方永页机](https://greasyfork.org/zh-CN/scripts/438684)」(为了正确判断图片顺序不能启用 contentVisibility 功能)
2. 目前已经手动支持了超多图站、漫画网站的「[圖片全載](https://sleazyfork.org/zh-CN/scripts/463305)
1. 能够**自动识别**大部分网页的[东方永页机](https://greasyfork.org/zh-CN/scripts/438684)」(注意不能启用 contentVisibility 功能)
2. 手动支持了**超多**图站、漫画网站的「[圖片全載](https://sleazyfork.org/zh-CN/scripts/463305)
3. 等其他带有自动翻页、聚图功能的脚本

用其他脚本将多页图片聚合到一起作为图源。期间不需要手动操作,脚本会自动触发翻页脚本加载至最后一页。
Expand All @@ -93,11 +93,11 @@

也正因如此,更推荐大家使用本地部署的项目,不抢服务器资源也不需要排队。**一键翻译全部图片**的功能开关只会在使用本地版时可用,脚本的维护重心也是本地版,无法保证 Cotrans 相关 bug 的修复。具体部署方法可参考 [我的笔记](https://github.com/hymbz/ComicReadScript/blob/master/docs/manga-image-translator.md)

脚本默认本地服务器的 url 是 `http://127.0.0.1:5003`,如果部署的 url 与这个不同,请通过 `自定义服务器 URL` 功能修改
脚本默认本地服务器的 url 是 <http://127.0.0.1:5003>,如果你点开这个链接后没见到 manga-image-translator,就得在`自定义服务器 URL`设置项中输入正确的 url,否则`翻译服务`的菜单项将始终为空

Cotrans 也有自己的油猴脚本 —— 「[Cotrans 漫画/图片翻译器](https://greasyfork.org/zh-CN/scripts/437569)」,支持 Pixiv、Twitter、Misskey、Calckey,欢迎有相关需求的人安装。

![翻译功能示例](/docs/images/翻译功能示例.webp)
![翻译功能示例](/docs/public/翻译功能示例.webp)

> 如果需要翻译本地漫画,可以使用「[ComicRead PWA](https://comic-read.pages.dev/)
Expand Down Expand Up @@ -148,13 +148,13 @@ Cotrans 也有自己的油猴脚本 —— 「[Cotrans 漫画/图片翻译器](h
除了右下角的悬浮按钮外,将鼠标移动到帖子一楼的顶端也能看到一个新增的「漫画阅读」按钮

![百合会入口](/docs/images/百合会入口.jpg)
![百合会入口](/docs/public/百合会入口.jpg)

### 记录阅读进度

这个功能是用来快速回到帖子上次阅读进度的。开启后,每个帖子后面都会跟着一个跳转至上次阅读位置的TAG,点击即可跳转至上次阅读进度(阅读进度不仅包括了页数也包括了楼层数),后面跟着的数字是上次阅读后新增的回复数。

![百合会记录阅读进度功能](/docs/images/百合会记录阅读进度功能.jpg)
![百合会记录阅读进度功能](/docs/public/百合会记录阅读进度功能.jpg)

### 关闭快捷导航的跳转

Expand All @@ -170,7 +170,7 @@ Cotrans 也有自己的油猴脚本 —— 「[Cotrans 漫画/图片翻译器](h

## ehentai

![ehentai例图](/docs/images/ehentai例图.png)
![ehentai例图](/docs/public/ehentai例图.png)

除悬浮按钮外,也会在右侧边栏会增加一个「Load comic」按钮,功能和悬浮按钮一样。

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions docs/dmzj.md → docs/.other/dmzj.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
2. 目录页被删,但PC端漫画页还在。那就可以通过谷歌搜索找到进入

3. 目录页被删,但手机端漫画页还在,但提示漫画不存在。

那就只能通过 api 获取数据了,但因为 api 需要漫画 id,而 dmzj 的手机端 url 有两种,只有「https://m.dmzj.com/info/45163.html」格式的 url 才能拿到 id 正常调用接口获取数据。在以前可以通过 <https://dmzj.nsapps.cn/> 搜索找到,但现在已经上不去了。如果能搜到 id 的话,还是能通过手动构建 url 来进入
那就只能通过 api 获取数据了,但因为 api 需要漫画 id,而 dmzj 的手机端 url 有两种,只有「https://m.dmzj.com/info/45163.html」格式的 url 才能拿到 id 正常调用接口获取数据。在以前可以通过 <https://dmzj.nsapps.cn/> 搜索找到,但现在已经上不去了。如果能搜到 id 的话,还是能通过手动构建 url 来进入


> 5 级用户可以看所有隐藏漫画(被买的有版权的漫画除外),经抓包测试只需要在指定 api 加上?uid=(5 级用户的 uid) 即可获取章节列表和图片列表,无需直接登录,cookie 也不用
Expand Down
File renamed without changes.
47 changes: 47 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config

export default defineConfig({
lang: 'zh-CN',
title: 'ComicRead Script',
description: 'A VitePress Site',
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
themeConfig: {
nav: [
{
text: 'Greasy Fork',
link: 'https://sleazyfork.org/zh-CN/scripts/374903',
},
{ text: 'PWA', link: 'https://comic-read.pages.dev' },
],

outline: { level: 'deep' },

sidebar: [
{ text: '简介', link: '/index' },
{ text: '设置项说明', link: '/设置项说明' },
{ text: '判断漫画左右页位置是否正确', link: '/判断左右页位置' },

{
text: '功能',
items: [
{ text: '页面填充', link: '/功能/页面填充' },
{ text: '卷轴模式', link: '/功能/卷轴模式' },
{ text: 'PWA', link: '/功能/PWA' },
],
},

{ text: '最简单的本地部署翻译服务流程', link: '/本地部署翻译' },
{ text: '无法支持', link: '/无法支持' },
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/hymbz/ComicReadScript' },
],

docFooter: { prev: false, next: false },

externalLinkIcon: true,
},
});
10 changes: 10 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vp-doc h2:first-child {
margin-top: 0;
padding-top: 0;
border-top: unset;
}

a > img {
display: inline;
margin: 0 .1em;
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme'
import './custom.css'

export default DefaultTheme
94 changes: 0 additions & 94 deletions docs/PageFill.md

This file was deleted.

Loading

0 comments on commit 999dd01

Please sign in to comment.