From b358336bc6787b62aa0ef519e30d81ae9a5e9b55 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Tue, 26 Feb 2019 23:33:22 +0800 Subject: [PATCH] refactor: address comments --- packages/@vuepress/core/lib/theme-api/index.js | 1 + packages/docs/docs/miscellaneous/glossary.md | 6 +++--- packages/docs/docs/theme/inheritance.md | 2 +- packages/docs/docs/zh/miscellaneous/glossary.md | 4 ++-- packages/docs/docs/zh/theme/inheritance.md | 2 +- packages/docs/docs/zh/theme/using-a-theme.md | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/@vuepress/core/lib/theme-api/index.js b/packages/@vuepress/core/lib/theme-api/index.js index 76c760b083..d6a38cd7e7 100644 --- a/packages/@vuepress/core/lib/theme-api/index.js +++ b/packages/@vuepress/core/lib/theme-api/index.js @@ -22,6 +22,7 @@ module.exports = class ThemeAPI { init () { const alias = { + '@theme': this.theme.path, '@current-theme': this.theme.path } if (this.existsParentTheme) { diff --git a/packages/docs/docs/miscellaneous/glossary.md b/packages/docs/docs/miscellaneous/glossary.md index 55e19b048c..86baf096df 100755 --- a/packages/docs/docs/miscellaneous/glossary.md +++ b/packages/docs/docs/miscellaneous/glossary.md @@ -48,9 +48,9 @@ That is, those titles defined by one or more `#` in `markdown`. ## themeConfig -- Access: `$site | Context.themeConfig` +- Access: `$themeConfig | Context.themeConfig` -Value of `themeConfig` in `.vuepress/config.js`, i.e., `user's theme configuration`. +Value of `themeConfig` in `.vuepress/config.js`, i.e., user's theme configuration. ## themePath @@ -70,7 +70,7 @@ Theme's configuration file - `themePath/index.js`. If the current theme is a derived theme, `parentThemePath` refers to the absolute path of the parent theme. -## parentThemeNetry +## parentThemeEntry - Access: `Context.themeAPI.parentTheme.entry` diff --git a/packages/docs/docs/theme/inheritance.md b/packages/docs/docs/theme/inheritance.md index ec346148fe..58f7603f68 100755 --- a/packages/docs/docs/theme/inheritance.md +++ b/packages/docs/docs/theme/inheritance.md @@ -138,7 +138,7 @@ On this premise, when you create a `Navbar` component in the same place in the c ::: vue theme -└── components +└── components    └── `Navbar.vue` ::: diff --git a/packages/docs/docs/zh/miscellaneous/glossary.md b/packages/docs/docs/zh/miscellaneous/glossary.md index 2c2701445a..fa60adaf73 100755 --- a/packages/docs/docs/zh/miscellaneous/glossary.md +++ b/packages/docs/docs/zh/miscellaneous/glossary.md @@ -50,7 +50,7 @@ sidebar: auto ## themeConfig -- Access: `$site | Context.themeConfig` +- Access: `$themeConfig | Context.themeConfig` 即 `.vuepress/config.js` 中 `themeConfig` 的值,是用户对当前所使用的主题的配置。 @@ -72,7 +72,7 @@ sidebar: auto 如果当前使用的主题是一个派生主题,那么 `parentThemePath` 就是指父主题的所在绝对路径。 -## parentThemeNetry +## parentThemeEntry - Access: `Context.themeAPI.parentTheme.entry` diff --git a/packages/docs/docs/zh/theme/inheritance.md b/packages/docs/docs/zh/theme/inheritance.md index 29ca46300d..cc0816b36b 100755 --- a/packages/docs/docs/zh/theme/inheritance.md +++ b/packages/docs/docs/zh/theme/inheritance.md @@ -137,7 +137,7 @@ import Home from '@theme/components/Navbar.vue' ::: vue theme -└── components +└── components    └── `Navbar.vue` ::: diff --git a/packages/docs/docs/zh/theme/using-a-theme.md b/packages/docs/docs/zh/theme/using-a-theme.md index 2554e7930e..2c4f729db8 100644 --- a/packages/docs/docs/zh/theme/using-a-theme.md +++ b/packages/docs/docs/zh/theme/using-a-theme.md @@ -2,7 +2,7 @@ 使用一个主题和使用一个插件的方式几乎一致。 -## 使用来自依赖的插件 +## 使用来自依赖的主题 一个主题可以在以 `vuepress-theme-xxx` 的形式发布到 npm,你可以这样使用它: