From 8546fe878d5f92161b83517c4bc1ecb7dedf3e9d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Aug 2020 16:05:11 +0200 Subject: Update plugin guides toc --- support/doc/plugins/guide.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'support/doc/plugins/guide.md') diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 7f359d408..2bd3fb6d2 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md @@ -21,6 +21,7 @@ - [Custom Modal](#custom-modal) - [Translate](#translate) - [Get public settings](#get-public-settings) + - [Add custom fields to video form](#add-custom-fields-to-video-form) - [Publishing](#publishing) - [Write a plugin/theme](#write-a-plugintheme) - [Clone the quickstart repository](#clone-the-quickstart-repository) @@ -29,6 +30,7 @@ - [Update package.json](#update-packagejson) - [Write code](#write-code) - [Add translations](#add-translations) + - [Build your plugin](#build-your-plugin) - [Test your plugin/theme](#test-your-plugintheme) - [Publish](#publish) - [Plugin & Theme hooks/helpers API](#plugin--theme-hookshelpers-api) @@ -379,11 +381,11 @@ peertubeHelpers.getSettings() }) ``` -### Add custom fields to video form +#### Add custom fields to video form To add custom fields in the video form (in *Plugin settings* tab): -``` +```js async function register ({ registerVideoField, peertubeHelpers }) { const descriptionHTML = await peertubeHelpers.translate(descriptionSource) const commonOptions = { @@ -404,7 +406,7 @@ PeerTube will send this field value in `body.pluginData['my-field-name']` and fe So for example, if you want to store an additional metadata for videos, register the following hooks in **server**: -``` +```js async function register ({ registerHook, storageManager -- cgit v1.2.3