* [Translate](#translate)
* [Give your feedback](#give-your-feedback)
* [Write documentation](#write-documentation)
- * [Develop](#develop)
* [Improve the website](#improve-the-website)
+ * [Develop](#develop)
+ * [Write a plugin or a theme](#plugins--themes)
## Translate
Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`.
Note that only instance 2 has transcoding enabled.
+
+## Plugins & Themes
+
+See the dedicated documentation: https://docs.joinpeertube.org/#/contribute-plugins
import { ServerConfigPlugin } from '@shared/models'
import { ServerService } from '@app/core/server/server.service'
import { ClientScript } from '@shared/models/plugins/plugin-package-json.model'
+import { ClientScript as ClientScriptModule } from '../../../types/client-script.model'
import { environment } from '../../../environments/environment'
import { ReplaySubject } from 'rxjs'
import { first, shareReplay } from 'rxjs/operators'
console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name)
return import(/* webpackIgnore: true */ clientScript.script)
- .then(script => script.register({ registerHook, peertubeHelpers }))
+ .then((script: ClientScriptModule) => script.register({ registerHook, peertubeHelpers }))
.then(() => this.sortHooksByPriority())
}
--- /dev/null
+import { RegisterClientOptions } from './register-client-option.model'
+
+export interface ClientScript {
+ register: (options: RegisterClientOptions) => Promise<any>
+
+ unregister: () => Promise<any>
+}
--- /dev/null
+import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
+
+export type RegisterClientOptions = {
+ registerHook: (options: RegisterClientHookOptions) => void
+
+ peertubeHelpers: {
+ getBaseStaticRoute: () => string
+ }
+}
and republish it on NPM. Remember that the PeerTube index will take into account your new plugin/theme version after ~24 hours.
+## Plugin & Theme hooks/helpers API
+
+See the dedicated documentation: https://docs.joinpeertube.org/#/api-plugins
+
+
## Tips
### Compatibility with PeerTube