Browse Source

Add doc pages for methods

Renée Kooi 6 years ago
parent
commit
208ac230e1

+ 8 - 0
website/src/docs/transloadit-preset-form.md

@@ -0,0 +1,8 @@
+---
+type: docs
+title: "Form API Documentation"
+permalink: docs/transloadit-preset/form/
+hidden: true
+---
+
+

+ 19 - 0
website/src/docs/transloadit-preset-picker.md

@@ -0,0 +1,19 @@
+---
+type: docs
+title: "File Picker API Documentation"
+permalink: docs/transloadit-preset/picker/
+hidden: true
+---
+
+```js
+transloadit.pick(target, options)
+```
+
+## `target`
+
+DOM element or CSS selector to place the modal element in. `document.body` is usually fine in this case because the modal is absolutely positioned on top of everything anyway.
+
+<!-- This supports the same options as the Transloadit plugin … should we inline the documentation somehow? Or just link to it? -->
+## `options.params`
+
+The Assembly paramaters to use for the upload. [see here](https://uppy.io/docs/transloadit#params)

+ 34 - 0
website/src/docs/transloadit-preset-upload.md

@@ -0,0 +1,34 @@
+---
+type: docs
+title: "Upload API Documentation"
+permalink: docs/transloadit-preset/upload/
+hidden: true
+---
+
+
+Upload files straight to Transloadit from your own custom UI. Give us an array of files, and we'll give you an array of results!
+
+```js
+const resultPromise = transloadit.upload(files, {
+  params: {
+    auth: { key: '' },
+    template_id: ''
+  }
+})
+```
+
+## `files`
+
+An array of [File][file] objects, obtained from an `<input type="file">` or elsewhere.
+
+These can also be [Blob][blob]s with a `.name` property. That way you can upload files that were created using JavaScript.
+
+## Options
+
+This method supports all the options of the [Transloadit Plugin][tl-options].
+
+TODO inline them here probably
+
+[file]: https://developer.mozilla.org/en-US/docs/Web/API/File
+[blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
+[tl-options]: /docs/transloadit#options

+ 8 - 0
website/src/docs/transloadit-preset.md

@@ -44,6 +44,10 @@ const resultPromise = transloadit.pick('body', {
 })
 ```
 
+**ADD IMAGE OR GIF HERE**
+
+<a class="MoreButton" href="/docs/transloadit-preset/picker">View Documentation</a>
+
 ## Form
 
 Add resumable uploads and Transloadit's processing to your existing HTML form uploads.
@@ -57,6 +61,8 @@ transloadit.form('form#myForm', {
 })
 ```
 
+<a class="MoreButton" href="/docs/transloadit-preset/form">View Documentation</a>
+
 ## Programmatic Uploads
 
 Upload files straight to Transloadit from your own custom UI. Give us an array of files, and we'll give you an array of results!
@@ -70,6 +76,8 @@ const resultPromise = transloadit.upload(files, {
 })
 ```
 
+<a class="MoreButton" href="/docs/transloadit-preset/upload">View Documentation</a>
+
 [transloadit]: https://transloadit.com/
 [browserify]: https://browserify.org
 [webpack]: https://webpack.js.org

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

@@ -30,6 +30,7 @@ var categories = [
     </h2>
     <ul class="menu-root">
       <% site.pages.find({ type }).sort('order').each((p) => { %>
+        <% if (p.hidden) return; %>
         <% var path = p.path.replace(/index\.html$/, ''); %>
         <% var category = categories.find((c) => c.path === path) %>
         <% // see https://github.com/vuejs/vuejs.org/blob/master/themes/vue/layout/partials/toc.ejs %>