Browse Source

website: Remove Plugins subsection, create Contributing subsection (#1435)

Kevin van Zonneveld 6 years ago
parent
commit
0553c2022e

+ 2 - 2
website/src/docs/contributing.md

@@ -1,8 +1,8 @@
 ---
 title: "Contributing"
 type: docs
-order: 5
-category: 'Docs'
+order: 0
+category: 'Contributing'
 ---
 
 <!-- md contributing.md -->

+ 61 - 0
website/src/docs/plugin-common-options.md

@@ -0,0 +1,61 @@
+---
+title: "Common Plugin Options"
+type: docs
+permalink: docs/plugins/
+order: 4
+category: 'Docs'
+---
+
+Each plugin can have any number of options (please see specific plugins for details), but these are shared between some:
+
+### `id`
+
+A unique string identifying the plugin. By default, the plugin's name is used, so usually it does not need to be configured manually. Use this if you need to add multiple plugins of the same type.
+
+### `target`
+
+Can be a `string` CSS selector, a DOM element, or a Plugin class. Consider the following example, where `DragDrop` plugin will be rendered into a `body` element:
+
+```js
+const Uppy = require('@uppy/core')
+const DragDrop = require('@uppy/drag-drop')
+const uppy = Uppy()
+uppy.use(DragDrop, { target: 'body' })
+// or: uppy.use(DragDrop, { target: document.body })
+```
+
+While in this one, we are using the `@uppy/dashboard` plugin, which can act as a host target for other plugins:
+
+```js
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const GoogleDrive = require('@uppy/google-drive')
+const uppy = Uppy()
+uppy.use(Dashboard, {
+  trigger: '#uppyModalOpener'
+})
+uppy.use(GoogleDrive, {target: Dashboard})
+```
+
+In the example above, the `Dashboard` gets rendered into an element with ID `uppy`, while `GoogleDrive` is rendered into the `Dashboard` itself.
+
+### `locale: {}`
+
+Same as with Uppy.Core’s setting above, this allows you to override plugin’s locale string, so that instead of `Select files` in English, your users will see `Выберите файлы` in Russian. Example:
+
+```js
+.use(FileInput, {
+  target: 'body',
+  locale: {
+    strings: { selectToUpload: 'Выберите файл для загрузки' }
+  }
+})
+```
+
+See plugin documentation pages for other plugin-specific options.
+
+<!-- Keep this heading, it is here to avoid breaking existing URLs -->
+<!-- Previously the content that is now at /docs/providers was here -->
+## Provider Plugins
+
+See the [Provider Plugins](/docs/providers) documentation page for information on provider plugins.

+ 3 - 59
website/src/docs/plugins.md

@@ -1,9 +1,9 @@
 ---
-title: "List & Common Options"
+title: "List of Plugins"
 type: docs
 permalink: docs/plugins/
-order: 0
-category: 'Plugins'
+order: 3
+category: 'Docs'
 ---
 
 Plugins are what makes Uppy useful: they help select, manipulate and upload files.
@@ -34,59 +34,3 @@ Plugins are what makes Uppy useful: they help select, manipulate and upload file
   <!-- TODO document? -->
   - @uppy/thumbnail-generator — generate preview thumbnails for images to be uploaded [documentation not yet available]
   - [@uppy/golden-retriever](/docs/golden-retriever) — restore files and continue uploading after a page refresh or a browser crash
-
-## Common options
-
-Each plugin can have any number of options (please see specific plugins for details), but these are shared between some:
-
-### `id`
-
-A unique string identifying the plugin. By default, the plugin's name is used, so usually it does not need to be configured manually. Use this if you need to add multiple plugins of the same type.
-
-### `target`
-
-Can be a `string` CSS selector, a DOM element, or a Plugin class. Consider the following example, where `DragDrop` plugin will be rendered into a `body` element:
-
-```js
-const Uppy = require('@uppy/core')
-const DragDrop = require('@uppy/drag-drop')
-const uppy = Uppy()
-uppy.use(DragDrop, { target: 'body' })
-// or: uppy.use(DragDrop, { target: document.body })
-```
-
-While in this one, we are using the `@uppy/dashboard` plugin, which can act as a host target for other plugins:
-
-```js
-const Uppy = require('@uppy/core')
-const Dashboard = require('@uppy/dashboard')
-const GoogleDrive = require('@uppy/google-drive')
-const uppy = Uppy()
-uppy.use(Dashboard, {
-  trigger: '#uppyModalOpener'
-})
-uppy.use(GoogleDrive, {target: Dashboard})
-```
-
-In the example above, the `Dashboard` gets rendered into an element with ID `uppy`, while `GoogleDrive` is rendered into the `Dashboard` itself.
-
-### `locale: {}`
-
-Same as with Uppy.Core’s setting above, this allows you to override plugin’s locale string, so that instead of `Select files` in English, your users will see `Выберите файлы` in Russian. Example:
-
-```js
-.use(FileInput, {
-  target: 'body',
-  locale: {
-    strings: { selectToUpload: 'Выберите файл для загрузки' }
-  }
-})
-```
-
-See plugin documentation pages for other plugin-specific options.
-
-<!-- Keep this heading, it is here to avoid breaking existing URLs -->
-<!-- Previously the content that is now at /docs/providers was here -->
-## Provider Plugins
-
-See the [Provider Plugins](/docs/providers) documentation page for information on provider plugins.

+ 1 - 1
website/src/docs/stores.md

@@ -1,6 +1,6 @@
 ---
 type: docs
-order: 3
+order: 5
 title: "Custom Stores"
 permalink: docs/stores/
 category: 'Docs'

+ 2 - 2
website/src/docs/writing-plugins.md

@@ -2,8 +2,8 @@
 type: docs
 title: "Writing Plugins"
 permalink: docs/writing-plugins/
-order: 1
-category: 'Plugins'
+order: 8
+category: 'Contributing'
 ---
 
 There are already a few useful Uppy plugins out there, but there might come a time when you will want to build your own. Plugins can hook into the upload process or render a custom UI, typically to:

+ 2 - 2
website/src/stats.ejs

@@ -2,10 +2,10 @@
 title: Stats
 type: docs
 layout: stats
-category: 'Docs'
+category: 'Contributing'
 permalink: docs/stats/
 alias:
   - guide/stats/
   - stats/
-order: 6
+order: 9
 ---

+ 1 - 1
website/themes/uppy/layout/partials/sidebar.ejs

@@ -4,13 +4,13 @@ var categories = []
 if (page.type === 'docs') {
   categories = [
     { category: 'Docs', path: 'docs/', link: true, hidden: true },
-    { category: 'Plugins', path: 'docs/plugins/', link: true },
     { category: 'UI Elements', path: 'docs/dashboard/', link: false },
     { category: 'Sources', path: 'docs/drag-drop/', link: false },
     { category: 'Destinations', path: 'docs/tus/', link: false },
     { category: 'File Processing', path: 'docs/robodog/', link: true },
     { category: 'Miscellaneous', path: 'docs/form/', link: false },
     { category: 'React', path: 'docs/react/', link: true },
+    { category: 'Contributing', path: 'docs/contributing/', link: true },
     ]
   } else if (page.type === 'examples') {
     categories = [