-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin-rtl): add rtl plugin (#49)
- Loading branch information
1 parent
7389d32
commit 4a50404
Showing
17 changed files
with
300 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# rtl | ||
|
||
<NpmBadge package="@vuepress/plugin-rtl" /> | ||
|
||
This plugin will set direction to rtl on configured locales. | ||
|
||
## Usage | ||
|
||
```bash | ||
npm i -D @vuepress/plugin-rtl@next | ||
``` | ||
|
||
```ts | ||
import { rtlPlugin } from '@vuepress/plugin-rtl' | ||
|
||
export default { | ||
plugins: [ | ||
rtlPlugin({ | ||
// options | ||
locales: ['/ar/'], | ||
}), | ||
], | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
### locales | ||
|
||
- Type: `string[]` | ||
- Default: `['/']` | ||
- Details: | ||
Locale path to enable rtl. | ||
|
||
### selector | ||
|
||
- Type: `SelectorOptions` | ||
|
||
```ts | ||
interface SelectorOptions { | ||
[element: string]: { | ||
[attrs: string]: string | ||
} | ||
} | ||
``` | ||
|
||
- Default: `{ 'html': { dir: 'rtl' } }` | ||
|
||
- Details: | ||
|
||
Selector to enable rtl. | ||
|
||
The default settings mean that the `dir` attribute of the `html` element will be set to `rtl` in rtl locales. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# rtl | ||
|
||
<NpmBadge package="@vuepress/plugin-rtl" /> | ||
|
||
此插件会在配置的语言上设置 rtl 方向。 | ||
|
||
## 使用方法 | ||
|
||
```bash | ||
npm i -D @vuepress/plugin-rtl@next | ||
``` | ||
|
||
```ts | ||
import { rtlPlugin } from '@vuepress/plugin-rtl' | ||
|
||
export default { | ||
plugins: [ | ||
rtlPlugin({ | ||
// 配置项 | ||
locales: ['/ar/'], | ||
}), | ||
], | ||
} | ||
``` | ||
|
||
## 选项 | ||
|
||
### locales | ||
|
||
- 类型:`string[]` | ||
- 默认值:`['/']` | ||
- 详情: | ||
开启 RTL 布局的多语言路径。 | ||
|
||
### selector | ||
|
||
- 类型:`SelectorOptions` | ||
|
||
```ts | ||
interface SelectorOptions { | ||
[element: string]: { | ||
[attrs: string]: string | ||
} | ||
} | ||
``` | ||
|
||
- 默认值:`{ 'html': { dir: 'rtl' } }` | ||
|
||
- 详情: | ||
|
||
开启 RTL 的选择器。 | ||
|
||
默认设置意味着在 RTL 多语言中,`html` 元素的 `dir` 属性将被设置为 `rtl`。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
## hostname | ||
|
||
- 类型:`string` | ||
- 必填: 是 | ||
- 必填:是 | ||
- 详情: | ||
|
||
当前网站部署到的域名,插件需要此选项才能工作。 | ||
|
Oops, something went wrong.