diff --git a/packages/docs/docs/.vuepress/config.js b/packages/docs/docs/.vuepress/config.js index 8e03d8a316..00df9c30d0 100755 --- a/packages/docs/docs/.vuepress/config.js +++ b/packages/docs/docs/.vuepress/config.js @@ -1,5 +1,3 @@ -const { fs, path } = require('@vuepress/shared-utils') - module.exports = ctx => ({ dest: '../../vuepress', locales: { @@ -43,10 +41,11 @@ module.exports = ctx => ({ lastUpdated: 'Last Updated', nav: require('./nav/en'), sidebar: { - '/api/': getApiSidebar(), '/guide/': getGuideSidebar('Guide', 'Advanced'), - '/plugin/': getPluginSidebar('Plugin', 'Introduction', 'Official Plugins'), - '/theme/': getThemeSidebar('Theme', 'Introduction'), + '/plugin/market/': getPluginMarketSidebar(), + '/plugin/': getPluginSidebar('Plugin', 'Introduction'), + '/theme/market/': getPluginMarketSidebar(), + '/theme/': getThemeSidebar('Theme', 'Introduction') } }, '/zh/': { @@ -56,9 +55,10 @@ module.exports = ctx => ({ lastUpdated: '上次更新', nav: require('./nav/zh'), sidebar: { - '/zh/api/': getApiSidebar(), '/zh/guide/': getGuideSidebar('指南', '深入'), - '/zh/plugin/': getPluginSidebar('插件', '介绍', '官方插件'), + '/zh/plugin/market/': getPluginMarketSidebar('/zh'), + '/zh/plugin/': getPluginSidebar('插件', '介绍'), + '/zh/theme/market/': getPluginMarketSidebar('/zh'), '/zh/theme/': getThemeSidebar('主题', '介绍') } } @@ -77,28 +77,18 @@ module.exports = ctx => ({ ['container', { type: 'vue', before: '
',
-      after: '
', + after: '' }], ['container', { type: 'upgrade', before: info => ``, - after: '', - }], + after: '' + }] ], - extraWatchFiles: [ - '.vuepress/nav/en.js', - '.vuepress/nav/zh.js', - ] -}) - -function getApiSidebar () { - return [ - 'cli', - 'node' - ] -} + extraWatchFiles: ['.vuepress/nav/en.js', '.vuepress/nav/zh.js'] +}); -function getGuideSidebar (groupA, groupB) { +function getGuideSidebar(groupA, groupB) { return [ { title: groupA, @@ -112,7 +102,7 @@ function getGuideSidebar (groupA, groupB) { 'markdown', 'using-vue', 'i18n', - 'deploy', + 'deploy' ] }, { @@ -125,15 +115,10 @@ function getGuideSidebar (groupA, groupB) { 'global-computed' ] } - ] + ]; } -const officalPlugins = fs - .readdirSync(path.resolve(__dirname, '../plugin/official')) - .map(filename => 'official/' + filename.slice(0, -3)) - .sort() - -function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) { +function getPluginSidebar(pluginTitle, pluginIntro) { return [ { title: pluginTitle, @@ -146,16 +131,74 @@ function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) { 'option-api', 'context-api' ] + } + ]; +} + +function getPluginMarketSidebar( + lang = '', + Plugins = 'Plugins', + Themes = 'Themes', + Official = 'Official', + Community = 'Community' +) { + return [ + { + title: Plugins, + collapsable: true, + children: [ + { + title: Official, + collapsable: true, + children: [ + lang + '/plugin/market/official/plugin-active-header-links', + lang + '/plugin/market/official/plugin-back-to-top', + lang + '/plugin/market/official/plugin-google-analytics', + lang + '/plugin/market/official/plugin-last-updated', + lang + '/plugin/market/official/plugin-medium-zoom', + lang + '/plugin/market/official/plugin-nprogress', + lang + '/plugin/market/official/plugin-pwa', + lang + '/plugin/market/official/plugin-register-components', + lang + '/plugin/market/official/plugin-search' + ] + }, + { + title: Community, + collapsable: true, + children: [ + [ + lang + '/plugin/market/before-writing-plugin', + 'You want to create a plugin ?' + ] + ] + } + ] }, { - title: officialPluginTitle, - collapsable: false, - children: officalPlugins, + title: Themes, + collapsable: true, + children: [ + { + title: Official, + collapsable: true, + children: [lang + '/theme/market/official/default-theme'] + }, + { + title: Community, + collapsable: true, + children: [ + [ + lang + '/theme/market/before-writing-theme', + 'You want to create a theme ?' + ] + ] + } + ] } - ] + ]; } -function getThemeSidebar (groupA, introductionA) { +function getThemeSidebar(groupA, introductionA) { return [ { title: groupA, @@ -169,6 +212,6 @@ function getThemeSidebar (groupA, introductionA) { 'default-theme-config', 'inheritance' ] - }, - ] + } + ]; } diff --git a/packages/docs/docs/.vuepress/nav/en.js b/packages/docs/docs/.vuepress/nav/en.js index f595c641e1..19ab635375 100644 --- a/packages/docs/docs/.vuepress/nav/en.js +++ b/packages/docs/docs/.vuepress/nav/en.js @@ -1,67 +1,49 @@ module.exports = [ { - text: "Guide", - link: "/guide/" + text: 'Guide', + link: '/guide/' }, { - text: "Config Reference", - link: "/config/" + text: 'Plugins / Themes', + link: '/plugin/market/official/plugin-active-header-links' }, { - text: "Plugin", - link: "/plugin/" - }, - { - text: "Theme", - link: "/theme/" - }, - { - text: "Learn More", + text: 'Learn More', items: [ { - text: "API", - items: [ - { - text: "CLI", - link: "/api/cli.html" - }, - { - text: "Node", - link: "/api/node.html" - } - ] + text: 'Config reference', + link: '/config/index.html' }, { - text: "Contributing Guide", - items: [ - { - text: "Local Development", - link: "/miscellaneous/local-development.html" - }, - { - text: "Design Concepts", - link: "/miscellaneous/design-concepts.html" - }, - { - text: "FAQ", - link: "/faq/" - }, - { - text: "Glossary", - link: "/miscellaneous/glossary.html" - } - ] + text: 'Cli', + link: '/api/cli.html' + }, + { + text: 'Create a plugin', + link: '/plugin/index.html' + }, + { + text: 'Create a theme', + link: '/theme/index.html' + }, + { + text: 'NodeJS Api', + link: '/api/node.html' + }, + { + text: 'Contributing Guide', + link: '/miscellaneous/local-development.html' }, { - text: "Miscellaneous", + text: 'Miscellaneous', items: [ { - text: "Migrate from 0.x", - link: "/miscellaneous/migration-guide.html" + text: 'Migrate from 0.x', + link: '/miscellaneous/migration-guide.html' }, { - text: "Changelog", - link: "https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" + text: 'Changelog', + link: 'https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md' } ] } diff --git a/packages/docs/docs/.vuepress/nav/zh.js b/packages/docs/docs/.vuepress/nav/zh.js index 0b8aae539e..bc26f1c350 100644 --- a/packages/docs/docs/.vuepress/nav/zh.js +++ b/packages/docs/docs/.vuepress/nav/zh.js @@ -1,67 +1,53 @@ module.exports = [ { - text: "指南", - link: "/zh/guide/" + text: '指南', + link: '/zh/guide/' }, + // { + // text: "配置", + // link: "/zh/config/" + // }, { - text: "配置", - link: "/zh/config/" + text: '插件 / 主题', + link: '/zh/plugin/market/official/plugin-active-header-links' }, { - text: "插件", - link: "/zh/plugin/" - }, - { - text: "主题", - link: "/zh/theme/" - }, - { - text: "了解更多", + text: '了解更多', items: [ { - text: "API", - items: [ - { - text: "CLI", - link: "/zh/api/cli.html" - }, - { - text: "Node", - link: "/zh/api/node.html" - } - ] + text: 'Config reference', + link: '/zh/config/index.html' }, { - text: "开发指南", - items: [ - { - text: "Local Development", - link: "/miscellaneous/local-development.html" - }, - { - text: "设计理念", - link: "/zh/miscellaneous/design-concepts.html" - }, - { - text: "FAQ", - link: "/zh/faq/" - }, - { - text: "术语", - link: "/zh/miscellaneous/glossary.html" - } - ] + text: 'Cli', + link: '/zh/api/cli.html' + }, + { + text: 'Create a plugin', + link: '/zh/plugin/index.html' + }, + { + text: 'Create a theme', + link: '/zh/theme/index.html' + }, + { + text: 'NodeJS Api', + link: '/zh/api/node.html' + }, + { + text: 'Contributing Guide', + link: '/zh/miscellaneous/local-development.html' }, { - text: "其他", + text: 'Miscellaneous', items: [ { - text: "从 0.x 迁移", - link: "/zh/miscellaneous/migration-guide.html" + text: '从 0.x 迁移', + link: '/zh/miscellaneous/migration-guide.html' }, { - text: "Changelog", - link: "https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" + text: 'Changelog', + link: 'https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md' } ] } diff --git a/packages/docs/docs/api/cli.md b/packages/docs/docs/api/cli.md index 54cbff90cf..222af786ce 100644 --- a/packages/docs/docs/api/cli.md +++ b/packages/docs/docs/api/cli.md @@ -1,5 +1,11 @@ +--- +sidebar: auto +--- + # Command-line Interface + + ## Usage ```bash @@ -11,22 +17,29 @@ vuepress targetDir [options] Build dir as a static site. ### -p, --port `` + See [port](../config/README.md#port). ### -t, --temp `` + See [temp](../config/README.md#temp). ### -c, --cache `[cache]` + ### --no-cache + See [cache](../config/README.md#cache). ### --dest `` + See [dest](../config/README.md#dest). ### --debug + Start development server in debug mode. ### --silent + Start development server in silent mode. ## dev @@ -34,12 +47,15 @@ Start development server in silent mode. Start a development server. All options from `vuepress build` are available. And there are several options specifically for dev: ### --host `` + See [host](../config/README.md#host). ### --open + Open browser when ready. ### --no-clear-screen + Do not clear screen when dev server is ready. ## eject diff --git a/packages/docs/docs/api/node.md b/packages/docs/docs/api/node.md index 55db476a6a..dd1c0a6647 100644 --- a/packages/docs/docs/api/node.md +++ b/packages/docs/docs/api/node.md @@ -1,9 +1,15 @@ +--- +sidebar: auto +--- + # Node.js API + + ## Usage ```js -const { createApp, dev, build, eject } = require('vuepress') +const { createApp, dev, build, eject } = require("vuepress"); ``` ## Methods @@ -24,16 +30,15 @@ Launch a dev process with current app context. Launch a build process with current app context. - ### dev(\[options]): Promise\ Start a development server, actually it’s implemented by `createApp`: ```js -async function dev (options) { - const app = createApp(options) - await app.process() - return app.dev() +async function dev(options) { + const app = createApp(options); + await app.process(); + return app.dev(); } ``` @@ -42,10 +47,10 @@ async function dev (options) { Build your source files as a static site, actually it’s implemented by `createApp`: ```js -async function build (options) { - const app = createApp(options) - await app.process() - return app.build() +async function build(options) { + const app = createApp(options); + await app.process(); + return app.build(); } ``` @@ -53,7 +58,6 @@ async function build (options) { Copy the default theme into `{targetDir}/.vuepress/theme` for customization. - ## Options ### sourceDir diff --git a/packages/docs/docs/plugin/README.md b/packages/docs/docs/plugin/README.md index ecc063ccee..24e1ecc6cf 100644 --- a/packages/docs/docs/plugin/README.md +++ b/packages/docs/docs/plugin/README.md @@ -1,5 +1,7 @@ # Plugin + + Plugins generally add global-level functionality to VuePress. There is no strictly defined scope for a plugin - there are typically several types of plugins: 1. Extend the page’s metadata generated at compile time. For example [@vuepress/plugin-last-updated](./official/plugin-last-updated.md); diff --git a/packages/docs/docs/plugin/market/before-writing-plugin.md b/packages/docs/docs/plugin/market/before-writing-plugin.md new file mode 100644 index 0000000000..b53886d6e8 --- /dev/null +++ b/packages/docs/docs/plugin/market/before-writing-plugin.md @@ -0,0 +1,26 @@ +# What you should know before creating a plugin + + + +First thank's for think about help us to improve this awesome community ! + +If you want to want to create a plugin you may want to know how vuepress is working with [Plugins](/plugin/) + +You should considering to respect that checklist: + +- Create a [Pull Request](https://github.com/vuejs/vuepress/pulls). +- Adding a description that explaining what your plugins will do. +- Wait for validation from the team. +- Create a .md inside @packages/docs/plugin/market/community folder. It should respect your-plugin-name.md. +- Copy the same md into @packages/docs/zh/plugin/market/community folder. +- It should have : + - a description + - the link of the github repository + - how to install it + - how to use it + - how to run tests + +- You should add the corresponding nav into. + + +Of course we will follow you during the process and will answer to your questions in your pull request diff --git a/packages/docs/docs/plugin/official/plugin-active-header-links.md b/packages/docs/docs/plugin/market/official/plugin-active-header-links.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-active-header-links.md rename to packages/docs/docs/plugin/market/official/plugin-active-header-links.md diff --git a/packages/docs/docs/plugin/official/plugin-back-to-top.md b/packages/docs/docs/plugin/market/official/plugin-back-to-top.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-back-to-top.md rename to packages/docs/docs/plugin/market/official/plugin-back-to-top.md diff --git a/packages/docs/docs/plugin/official/plugin-google-analytics.md b/packages/docs/docs/plugin/market/official/plugin-google-analytics.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-google-analytics.md rename to packages/docs/docs/plugin/market/official/plugin-google-analytics.md diff --git a/packages/docs/docs/plugin/official/plugin-last-updated.md b/packages/docs/docs/plugin/market/official/plugin-last-updated.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-last-updated.md rename to packages/docs/docs/plugin/market/official/plugin-last-updated.md diff --git a/packages/docs/docs/plugin/official/plugin-medium-zoom.md b/packages/docs/docs/plugin/market/official/plugin-medium-zoom.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-medium-zoom.md rename to packages/docs/docs/plugin/market/official/plugin-medium-zoom.md diff --git a/packages/docs/docs/plugin/official/plugin-nprogress.md b/packages/docs/docs/plugin/market/official/plugin-nprogress.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-nprogress.md rename to packages/docs/docs/plugin/market/official/plugin-nprogress.md diff --git a/packages/docs/docs/plugin/official/plugin-pwa.md b/packages/docs/docs/plugin/market/official/plugin-pwa.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-pwa.md rename to packages/docs/docs/plugin/market/official/plugin-pwa.md diff --git a/packages/docs/docs/plugin/official/plugin-register-components.md b/packages/docs/docs/plugin/market/official/plugin-register-components.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-register-components.md rename to packages/docs/docs/plugin/market/official/plugin-register-components.md diff --git a/packages/docs/docs/plugin/official/plugin-search.md b/packages/docs/docs/plugin/market/official/plugin-search.md similarity index 100% rename from packages/docs/docs/plugin/official/plugin-search.md rename to packages/docs/docs/plugin/market/official/plugin-search.md diff --git a/packages/docs/docs/theme/market/before-writing-theme.md b/packages/docs/docs/theme/market/before-writing-theme.md new file mode 100644 index 0000000000..8ae2fc008c --- /dev/null +++ b/packages/docs/docs/theme/market/before-writing-theme.md @@ -0,0 +1,5 @@ +# What you should know before creating a theme + + + +Work in progress diff --git a/packages/docs/docs/theme/market/official/default-theme.md b/packages/docs/docs/theme/market/official/default-theme.md new file mode 100644 index 0000000000..b6d1bb84a3 --- /dev/null +++ b/packages/docs/docs/theme/market/official/default-theme.md @@ -0,0 +1,5 @@ +# default theme + + + +Work in progress diff --git a/packages/docs/docs/zh/api/node.md b/packages/docs/docs/zh/api/node.md index b85e884da2..8b38c5aa02 100644 --- a/packages/docs/docs/zh/api/node.md +++ b/packages/docs/docs/zh/api/node.md @@ -1,5 +1,11 @@ +--- +sidebar: auto +--- + # Node.js API + + ## 使用 ```js diff --git a/packages/docs/docs/zh/plugin/market/before-writing-plugin.md b/packages/docs/docs/zh/plugin/market/before-writing-plugin.md new file mode 100644 index 0000000000..b53886d6e8 --- /dev/null +++ b/packages/docs/docs/zh/plugin/market/before-writing-plugin.md @@ -0,0 +1,26 @@ +# What you should know before creating a plugin + + + +First thank's for think about help us to improve this awesome community ! + +If you want to want to create a plugin you may want to know how vuepress is working with [Plugins](/plugin/) + +You should considering to respect that checklist: + +- Create a [Pull Request](https://github.com/vuejs/vuepress/pulls). +- Adding a description that explaining what your plugins will do. +- Wait for validation from the team. +- Create a .md inside @packages/docs/plugin/market/community folder. It should respect your-plugin-name.md. +- Copy the same md into @packages/docs/zh/plugin/market/community folder. +- It should have : + - a description + - the link of the github repository + - how to install it + - how to use it + - how to run tests + +- You should add the corresponding nav into. + + +Of course we will follow you during the process and will answer to your questions in your pull request diff --git a/packages/docs/docs/zh/plugin/official/plugin-active-header-links.md b/packages/docs/docs/zh/plugin/market/official/plugin-active-header-links.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-active-header-links.md rename to packages/docs/docs/zh/plugin/market/official/plugin-active-header-links.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-back-to-top.md b/packages/docs/docs/zh/plugin/market/official/plugin-back-to-top.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-back-to-top.md rename to packages/docs/docs/zh/plugin/market/official/plugin-back-to-top.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-google-analytics.md b/packages/docs/docs/zh/plugin/market/official/plugin-google-analytics.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-google-analytics.md rename to packages/docs/docs/zh/plugin/market/official/plugin-google-analytics.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-last-updated.md b/packages/docs/docs/zh/plugin/market/official/plugin-last-updated.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-last-updated.md rename to packages/docs/docs/zh/plugin/market/official/plugin-last-updated.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-medium-zoom.md b/packages/docs/docs/zh/plugin/market/official/plugin-medium-zoom.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-medium-zoom.md rename to packages/docs/docs/zh/plugin/market/official/plugin-medium-zoom.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-nprogress.md b/packages/docs/docs/zh/plugin/market/official/plugin-nprogress.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-nprogress.md rename to packages/docs/docs/zh/plugin/market/official/plugin-nprogress.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-pwa.md b/packages/docs/docs/zh/plugin/market/official/plugin-pwa.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-pwa.md rename to packages/docs/docs/zh/plugin/market/official/plugin-pwa.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-register-components.md b/packages/docs/docs/zh/plugin/market/official/plugin-register-components.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-register-components.md rename to packages/docs/docs/zh/plugin/market/official/plugin-register-components.md diff --git a/packages/docs/docs/zh/plugin/official/plugin-search.md b/packages/docs/docs/zh/plugin/market/official/plugin-search.md similarity index 100% rename from packages/docs/docs/zh/plugin/official/plugin-search.md rename to packages/docs/docs/zh/plugin/market/official/plugin-search.md diff --git a/packages/docs/docs/zh/theme/market/before-writing-theme.md b/packages/docs/docs/zh/theme/market/before-writing-theme.md new file mode 100644 index 0000000000..8ae2fc008c --- /dev/null +++ b/packages/docs/docs/zh/theme/market/before-writing-theme.md @@ -0,0 +1,5 @@ +# What you should know before creating a theme + + + +Work in progress diff --git a/packages/docs/docs/zh/theme/market/official/default-theme.md b/packages/docs/docs/zh/theme/market/official/default-theme.md new file mode 100644 index 0000000000..b6d1bb84a3 --- /dev/null +++ b/packages/docs/docs/zh/theme/market/official/default-theme.md @@ -0,0 +1,5 @@ +# default theme + + + +Work in progress