Skip to content

Commit

Permalink
[Done] Fix documentation errors (#7)
Browse files Browse the repository at this point in the history
* docs: add public instance

* docs: fix getting started

* docs: fix public instances

* docs: fix faqs

* docs: fix parameters

* docs: fix parameters again

* docs: fix deploy

* docs: fix start-code

* docs: fix submit-route

* docs: fix new-radar

* docs: fix advanced-feed

* docs: fix minor link issues
  • Loading branch information
wudifeixue authored Apr 1, 2024
1 parent d2eb94b commit 253c095
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 64 deletions.
6 changes: 6 additions & 0 deletions .vitepress/theme/components/InstanceList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ const instances = [{
location: '🇩🇪',
maintainer: 'Vincent Yang',
maintainerUrl: 'https://missuo.me',
},
{
url: 'https://rss.wudifeixue.com',
location: '🇨🇦',
maintainer: 'wudifeixue',
maintainerUrl: 'https://github.com/wudifeixue',
}
]
Expand Down
6 changes: 3 additions & 3 deletions src/deploy/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Access code is the md5 generated based on the access key + route, eg:

:::tip New Config Format

We are currently testing out a new format, providing end-user with more flexibility. For more info, please refer to [Parameters->Multimedia processing](/parameter#multimedia-processing).
We are currently testing out a new format, providing end-user with more flexibility. For more info, please refer to [Parameters->Multimedia processing](/guide/parameters#multimedia-processing).

When using our new config, please leave the following environment vairable blank. By default, image hotlink template will be forced when present.

Expand Down Expand Up @@ -192,9 +192,9 @@ Configs in this sections are in beta stage, and **are turn off by default**. Ple

:::

`ALLOW_USER_HOTLINK_TEMPLATE`: [Parameters->Multimedia processing](/parameter#multimedia-processing)
`ALLOW_USER_HOTLINK_TEMPLATE`: [Parameters->Multimedia processing](/guide/parameters#multimedia-processing)

`FILTER_REGEX_ENGINE`: Define Regex engine used in [Parameters->filtering](/parameter#filtering). Valid value are `[re2, regexp]`. Default value is `re2`. We suggest public instance should leave this value to default, and this option right now is mainly for backward compatibility.
`FILTER_REGEX_ENGINE`: Define Regex engine used in [Parameters->filtering](/guide/parameters#filtering). Valid value are `[re2, regexp]`. Default value is `re2`. We suggest public instance should leave this value to default, and this option right now is mainly for backward compatibility.

`ALLOW_USER_SUPPLY_UNSAFE_DOMAIN`: allow users to provide a domain as a parameter to routes that are not in their allow list, respectively. Public instances are suggested to leave this value default, as it may lead to [Server-Side Request Forgery (SSRF)](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)

Expand Down
4 changes: 2 additions & 2 deletions src/deploy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ Automatic updates are included.

3. [Sign up for Fly.io](https://fly.io/app/sign-up) and install the [flyctl CLI](https://fly.io/docs/hands-on/install-flyctl/);
4. Run `fly launch` and choose a unique name and region to deploy;
5. Use `fly secrets set KEY=VALUE` to [configure some modules](#configuration-route-specific-configurations);
5. Use `fly secrets set KEY=VALUE` to [configure some modules](config#route-specific-configurations);
6. [Set up automatic deployment via GitHub Actions](https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/);
7. (Optional) Use `fly certs add your domain` to configure a custom domain, and follow the instructions to configure the related domain resolution at your DNS service provider (you can check the domain configuration status on the Dashboard Certificate page).

Expand All @@ -503,7 +503,7 @@ Upgrade: On the homepage of your Forked repository, click "Sync fork - Update Br
```

Depending on the actual situation, you may want to use other image tags, please read the relevant content of [Docker Image](#docker-image);
4. Modify the `[env]` section in fly.toml or use `fly secrets set KEY=VALUE` to [configure some modules](#configuration-route-specific-configurations);
4. Modify the `[env]` section in fly.toml or use `fly secrets set KEY=VALUE` to [configure some modules](config#route-specific-configurations);
5. Execute `fly deploy` to start the application;
6. (Optional) Use `fly certs add your domain` to configure a custom domain, and follow the instructions to configure the related domain resolution at your DNS service provider (you can check the domain configuration status on the Dashboard Certificate page).

Expand Down
4 changes: 2 additions & 2 deletions src/guide/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
**A:** RSSHub fetches and respects the original image/video URLs from original sites, in which some are behind anti-hotlink filters. `referrerpolicy="no-referrer"` attribute is added to all images to solve the issues caused by cross-domain requests. Third party RSS service providers such as Feedly and Inoreader, strip this attribute off, resulting in cross-domain requests being blocked. Meanwhile, the attribute is not available for videos yet, resulting in most RSS readers unable to pass the anti-hotlink check. Here are some workarounds:

1. Migrate to RSS readers that do not send Referer,such as [Inoreader for Web](https://www.inoreader.com/) with a [user script disabling Referer](https://greasyfork.org/en/scripts/376884), [fix-image-error at inoreader](https://greasyfork.org/scripts/463461-fix-image-error-at-inoreader), [RSS to Telegram Bot](https://github.com/Rongronggg9/RSS-to-Telegram-Bot), etc. If your RSS reader can bypass the anti-hotlink check successfully and play embedded videos, it's an RSS reader that do not send Referer. Please consider adding it to the documentation to help more people.
2. Set up a reverse proxy, refer to [Parameters->Multimedia processing](/parameter#multimedia-processing) for more details.
2. Set up a reverse proxy, refer to [Parameters->Multimedia processing](/guide/parameters#multimedia-processing) for more details.
3. Navigate back to the original site.

**Q: The website I want is not supported QAQ**

**A:** If you are a JavaScript developer, please follow [this guide](/joinus/quick-start) for submitting a pull request, otherwise, follow the issue template to [submit a new issue](https://github.com/DIYgod/RSSHub/issues/new?template=rss_request_en.md), and patiently wait for Santa Claus. For priority responses, consider [sponsoring us](/support).
**A:** If you are a JavaScript developer, please follow [this guide](/joinus/#quick-start) for submitting a pull request, otherwise, follow the issue template to [submit a new issue](https://github.com/DIYgod/RSSHub/issues/new?template=rss_request_en.md), and patiently wait for Santa Claus. For priority responses, consider [sponsoring us](/sponsor).

**Q: Where do I get the changelog for RSSHub?**

Expand Down
6 changes: 3 additions & 3 deletions src/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ To subscribe to a Twitter user's timeline, first look at the route document of [

The demo instance will generate an RSS feed at `https://rsshub.app/twitter/user/DIYgod`, use your own domain name when applicable. This feed should work with all RSS readers conforming to the RSS Standard.

You can replace the domain name `https://rsshub.app` with your [self-hosted instance](/install) or any [public instance](/instances).
You can replace the domain name `https://rsshub.app` with your [self-hosted instance](/deploy) or any [public instance](/guide/instances).

RSSHub supports additional parameters such as content filtering and full-text extraction, refer to [Parameters](/parameter) for details.
RSSHub supports additional parameters such as content filtering and full-text extraction, refer to [Parameters](/parameters) for details.

## Contribute a New Route

Our thriving community is the key to RSSHub's success, we invite everyone to join us and [contribute new routes](/joinus/quick-start) for all kinds of interesting sources.
Our thriving community is the key to RSSHub's success, we invite everyone to join us and [contribute new routes](/joinus/#quick-start) for all kinds of interesting sources.

## Use as a npm Package

Expand Down
2 changes: 1 addition & 1 deletion src/guide/instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Although the official instances are already stable enough, in order to achieve decentralization, we encourage users to host their own RSSHub instances or use other public RSSHub instances.

If you are willing to contribute your own instance for others to use, please edit [this file](https://github.com/DIYgod/RSSHub/tree/master/website/src/components/InstanceList.tsx) and submit a PR to add your instance to the list.
If you are willing to contribute your own instance for others to use, please edit [this file](https://github.com/RSSNext/rsshub-docs/edit/main/.vitepress/theme/components/InstanceList.vue) and submit a PR to add your instance to the list.

## Official

Expand Down
4 changes: 2 additions & 2 deletions src/guide/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ E.g. Bilibili article [https://rsshub.app/bilibili/user/article/334958638?mode=f

## Access Control

Set `key` or `code` to grant access to requests. See [Access Control Configuration](install/#configuration-access-control-configuration-access-key-code).
Set `key` or `code` to grant access to requests. See [Access Control Configuration](/deploy/config#access-control-configurations).

## Telegram Instant View

Expand Down Expand Up @@ -127,7 +127,7 @@ This is an experimental API
- `multimedia_hotlink_template`: the same as `image_hotlink_template` but apply to audio and video. Note: the service must follow redirects, allow reverse-proxy for audio and video, and must drop the `Referer` header when reverse-proxying. [Here is an easy-to-deploy project that fits these requirements](https://github.com/Rongronggg9/rsstt-img-relay). The project accepts simple URL concatenation, e.g. `https://example.com/${href}`, in which `example.com` should be replaced with the domain name of the service you've deployed
- `wrap_multimedia_in_iframe`: wrap audio and video in `<iframe>` to prevent the reader from sending `Referer` header. This workaround is only compatible with a few readers, such as RSS Guard and Akregator, which may not support the previous method. You can try this method in such a case

There are more details in the [FAQ](/faq).
There are more details in the [FAQ](/guide/faq).

## Output Formats

Expand Down
4 changes: 2 additions & 2 deletions src/joinus/advanced/advanced-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 1

This guide is intended for advanced users who want to know how to create an RSS feed in detail. If you're new to creating RSS feeds, we recommend reading [Create Your Own RSSHub Route](/joinus/new-rss/start-code) first.

Once you have collected the data you want to include in your RSS feed, you can pass it to `ctx.set('data', obj)`. RSSHub's middleware [`template.ts`](https://github.com/DIYgod/RSSHub/blob/master/lib/middleware/template.ts) will then process the data and render the RSS output in the required format (which is RSS 2.0 by default). In addition to the fields mentioned in [Create your own RSSHub route](/joinus/new-rss/start-code), you can customize your RSS feed further using the following fields.
Once you have collected the data you want to include in your RSS feed, you can pass it to `ctx.set('data', obj)`. RSSHub's middleware [`template.tsx`](https://github.com/DIYgod/RSSHub/blob/master/lib/middleware/template.tsx) will then process the data and render the RSS output in the required format (which is RSS 2.0 by default). In addition to the fields mentioned in [Create your own RSSHub route](/joinus/new-rss/start-code), you can customize your RSS feed further using the following fields.

It's important to note that not all fields are applicable to all output formats since RSSHub supports multiple output formats. The table below shows which fields are compatible with different output formats. We use the following symbols to denote compatibility: `A` for Atom, `J` for JSON Feed, `R` for RSS 2.0.

Expand Down Expand Up @@ -97,7 +97,7 @@ By setting the `supportBT` attribute to `"1"`, you'll be able to update your doc

## Create a Journal Feed

RSSHub supports creating journal feeds that can replace `item.link` with a Sci-hub link if users provide the [common parameter](/parameter#sci-hub-link) `scihub`. To create a journal feed, you'll need to include an **additional** field in your RSS feed:
RSSHub supports creating journal feeds that can replace `item.link` with a Sci-hub link if users provide the [common parameter](/guide/parameters#sci-hub-link) `scihub`. To create a journal feed, you'll need to include an **additional** field in your RSS feed:

```js
ctx.set('data', {
Expand Down
6 changes: 3 additions & 3 deletions src/joinus/new-radar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following document is the old version standard, please refer [/lib/types.ts#

:::

If you want to see the results, we suggest you install the browser extension. You can download it for your browser on the [Join Us](/joinus/quick-start#submit-new-rsshub-radar-rules-before-you-start) page.
If you want to see the results, we suggest you install the browser extension. You can download it for your browser on the [Join Us](/joinus/) page.

## Code the rule

Expand Down Expand Up @@ -117,7 +117,7 @@ The title is a *required* field and should be the same as the level 3 heading (`

The documentation link is also a *required* field. In this case, the documentation link for `GitHub Repo Issues` will be `https://docs.rsshub.app/routes/programming#github`.

Note that the hash should be positioned to the level 2 heading (`##`), and not `https://docs.rsshub.app/routes/programming#github-repo-issues`.
Note that the hash should be positioned to the level 2 heading (`##`), and not `https://docs.rsshub.app/routes/programming#repo-issues`.

### `source`

Expand Down Expand Up @@ -227,7 +227,7 @@ Here's an example radar rule that you can play with:
})
```

:::note Extra examples
:::note Other Examples

```js
({
Expand Down
10 changes: 5 additions & 5 deletions src/joinus/new-rss/start-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GitHub provides some official RSS feeds:

Once you have created a namespace for the route, the next step is to create a route file to register the route.

For example, if you are making an RSS feed for [GitHub Repo Issues]((/routes/programming#github-yong-hu-cang-ku)), and assume that you want users to enter the GitHub username and repo name, if they do not enter the repo name, they will return to RSSHub. You can register your new RSS route in /lib/routes/github/issue.ts, the file needs to return an object that conforms to the Route type through route. The definition of Route is at [/lib/types.ts](https://github.com/DIYgod/RSSHub/blob/master/lib/types.ts#L86)
For example, if you are making an RSS feed for [GitHub Repo Issues](/routes/programming#repo-issues), and assume that you want users to enter the GitHub username and repo name, if they do not enter the repo name, they will return to RSSHub. You can register your new RSS route in /lib/routes/github/issue.ts, the file needs to return an object that conforms to the Route type through route. The definition of Route is at [/lib/types.ts](https://github.com/DIYgod/RSSHub/blob/master/lib/types.ts#L86)

- path: The route path, using [Hono routing](https://hono.dev/api/routing) syntax
- name: The human-readable name of the route, which will be used as the title of the document
Expand Down Expand Up @@ -100,11 +100,11 @@ In the above example, `issue` is an exact match, `:user` is a required parameter

The handler function will be passed a parameter ctx. By the end of the function, it needs to return an object that contains the information required for RSS.

You can see the APIs available for ctx to use in the [Hono context documentation]((https://hono.dev/api/context))
You can see the APIs available for ctx to use in the [Hono context documentation](https://hono.dev/api/context)

The type of the return value is defined here: [/lib/types.ts#L37](https://github.com/DIYgod/RSSHub/blob/master/lib/types.ts#L37)

As mentioned earlier, we will create an RSS feed for [GitHub Repo Issues](/routes/programming#github-repo-issues) as an example. We will show all four data collection methods mentioned:
As mentioned earlier, we will create an RSS feed for [GitHub Repo Issues](/routes/programming#repo-issues) as an example. We will show all four data collection methods mentioned:

1. [Via API](#via-api)
2. [Via HTML web page using got](#via-html-web-page-using-got)
Expand Down Expand Up @@ -193,7 +193,7 @@ Both of these code snippets do the same thing. The first one uses object destruc
### Getting data from the API
After we have the user input, we can use it to make a request to the API. In most cases, you will need to use `got` from `@/utils/got` (a customized got wrapper) to make HTTP requests. For more information, please refer to the [got documentation](https://github.com/sindresorhus/got/tree/v11#usage).
After we have the user input, we can use it to make a request to the API. In most cases, you will need to use `got` from `@/utils/got` (a customized got wrapper) to make HTTP requests. For more information, please refer to the [got documentation](https://github.com/sindresorhus/got/tree/v11.8.6?tab=readme-ov-file#usage).
<Tabs groupId="jsStyle">
<TabItem value="Object destructuring" label="Object destructuring" default>
Expand Down Expand Up @@ -408,7 +408,7 @@ In this code, `user` will be set to the value of `user` parameter, and `repo` wi
### Getting data from the web page
After receiving the user input, we need to make a request to the web page to retrieve the information we need. In most cases, we'll use `got` from `@/utils/got` (a customized [got](https://www.npmjs.com/package/got) wrapper) to make HTTP requests. You can find more information on how to use got in the [got documentation](https://github.com/sindresorhus/got/tree/v11#usage).
After receiving the user input, we need to make a request to the web page to retrieve the information we need. In most cases, we'll use `got` from `@/utils/got` (a customized [got](https://www.npmjs.com/package/got) wrapper) to make HTTP requests. You can find more information on how to use got in the [got documentation](https://github.com/sindresorhus/got/tree/v11.8.6?tab=readme-ov-file#usage).
To begin, we'll make an HTTP GET request to the API and load the HTML response into Cheerio, a library that helps us parse and manipulate HTML.
Expand Down
10 changes: 5 additions & 5 deletions src/joinus/new-rss/submit-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ If your changes are not related to route, please fill in `routes` section with `
## New RSS Route Checklist / 新 RSS 路由检查表

- [ ] New Route / 新的路由
- [ ] Follows [Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard)
- [ ] Follows [Script Standard](https://docs.rsshub.app/joinus/advanced/script-standard) / 跟随 [路由规范](https://docs.rsshub.app/zh/joinus/advanced/script-standard)
- [ ] Documentation / 文档说明
- [ ] Full text / 全文获取
- [ ] Use cache / 使用缓存
- [ ] Use cache / 使用缓存
- [ ] Anti-bot or rate limit / 反爬/频率限制
- [ ] If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
- [ ] If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
- [ ] [Date and time](https://docs.rsshub.app/joinus/advanced/pub-date) / [日期和时间](https://docs.rsshub.app/zh/joinus/advanced/pub-date)
- [ ] Parsed / 可以解析
- [ ] Correct time zone / 时区正确
- [ ] Parsed / 可以解析
- [ ] Correct time zone / 时区正确
- [ ] New package added / 添加了新的包
- [ ] `Puppeteer`

Expand Down
6 changes: 3 additions & 3 deletions src/zh/deploy/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ RSSHub 支持使用访问密钥 / 码进行访问控制。开启将会激活全

:::tip 新配置方式

我们正在试验新的,更灵活的配置方式。如果有需要,请转到 [通用参数 -> 多媒体处理](/zh/parameter#多媒体处理) 了解更多。
我们正在试验新的,更灵活的配置方式。如果有需要,请转到 [通用参数 -> 多媒体处理](/zh/guide/parameters#多媒体处理) 了解更多。

在使用新配置时,请将下方环境变量留空。否则默认图片模版会继续遵循下方配置。

Expand Down Expand Up @@ -190,9 +190,9 @@ RSSHub 支持使用访问密钥 / 码进行访问控制。开启将会激活全

:::

`ALLOW_USER_HOTLINK_TEMPLATE`: [通用参数 -> 多媒体处理](/zh/parameter#多媒体处理)特性控制
`ALLOW_USER_HOTLINK_TEMPLATE`: [通用参数 -> 多媒体处理](/zh/guide/parameters#多媒体处理)特性控制

`FILTER_REGEX_ENGINE`: 控制 [通用参数 -> 内容过滤](/zh/parameter#内容过滤) 使用的正则引擎。可选`[re2, regexp]`,默认`re2`。我们推荐公开实例不要调整这个选项,这个选项目前主要用于向后兼容。
`FILTER_REGEX_ENGINE`: 控制 [通用参数 -> 内容过滤](/zh/guide/parameters#内容过滤) 使用的正则引擎。可选`[re2, regexp]`,默认`re2`。我们推荐公开实例不要调整这个选项,这个选项目前主要用于向后兼容。

`ALLOW_USER_SUPPLY_UNSAFE_DOMAIN`: 允许用户为路由提供域名作为参数。建议公共实例不要调整此选项,开启后可能会导致 [服务端请求伪造(SSRF)](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)

Expand Down
Loading

0 comments on commit 253c095

Please sign in to comment.