Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ulivz/rspress-plugin-remote-page
An Rspress plugin to seamlessly load remote markdown file (e.g. README.md) onto your website.
https://github.com/ulivz/rspress-plugin-remote-page
Last synced: 27 days ago
JSON representation
An Rspress plugin to seamlessly load remote markdown file (e.g. README.md) onto your website.
- Host: GitHub
- URL: https://github.com/ulivz/rspress-plugin-remote-page
- Owner: ulivz
- License: mit
- Created: 2023-10-25T17:54:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-26T19:16:37.000Z (about 1 year ago)
- Last Synced: 2024-08-02T13:21:55.253Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 172 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rspack - rspress-plugin-remote-page
README
rspress-plugin-remote-page
An Rspress plugin to seamlessly load remote markdown file (e.g. README.md) onto your website.## Table of Contents
- [Table of Contents](#table-of-contents)
- [Install](#install)
- [Usage](#usage)
- [Quickly load a `README.md` file from GitHub using a shortcut](#quickly-load-a-readmemd-file-from-github-using-a-shortcut)
- [Capable of loading any Markdown file from GitHub](#capable-of-loading-any-markdown-file-from-github)
- [Supports loading any remote Markdown files](#supports-loading-any-remote-markdown-files)
- [Options](#options)
- [pages](#pages)
- [remotePath](#remotepath)
- [routePath](#routepath)
- [TODOs](#todos)
- [License](#license)## Install
```bash
npm install rspress-plugin-remote-page -D
```## Usage
### Quickly load a `README.md` file from GitHub using a shortcut
```ts
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';export default defineConfig({
plugins: [remotePage({
pages: [
{
// This input will load README.md of https://github.com/ulivz/rspress-plugin-remote-page
remotePath: 'ulivz/rspress-plugin-remote-page',
routePath: '/readme',
}
]
})],
});
```### Capable of loading any Markdown file from GitHub
```ts
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';export default defineConfig({
plugins: [remotePage({
pages: [
{
remotePath: 'https://github.com/ulivz/rspress-plugin-remote-page/blob/main/README.md',
routePath: '/readme',
}
]
})],
});
```### Supports loading any remote Markdown files
```ts
// rspress.config.ts
import { remotePage } from 'rspress-plugin-remote-page';
import { defineConfig } from 'rspress/config';export default defineConfig({
plugins: [remotePage({
pages: [
{
remotePath: 'https://path/to/your-markdown.md',
routePath: '/readme',
}
]
})],
});
```## Options
### pages
#### remotePath
- **Type**: `string`
- **Required**: `true`Specify the remote path, it could be:
1. Github repository shortcut, e.g. `web-infra-dev/deep-dive-into-tla`;
2. Github repository repo path, e.g. `https://github.com/web-infra-dev/deep-dive-into-tla`;
3. Github path, e.g. `https://github.com/web-infra-dev/deep-dive-into-tla/blob/master/README-zh-CN.md`;
4. Any remote path, e.g. `https://path/to/your-markdown.md`;#### routePath
- **Type**: `string`
- **Default**: `master`Specify the generated route.
## TODOs
- Support remote `*.mdx`.
- Enhance logging output.
- Enhance error handling when fetching pages.## License
MIT © [ULIVZ](https://github.com/ulivz)