diff options
author | Kim <1877318+kimsible@users.noreply.github.com> | 2020-04-20 14:51:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 14:51:24 +0200 |
commit | 8c7725dc3c01a73bf56a48c8b192d144bfdc3ffe (patch) | |
tree | b6e64c7589c7a5138116acd65c1515ef28bea5b9 /support/doc/plugins | |
parent | 2fd59d7d89d1c389446ee67838c821e2622fc8ca (diff) | |
download | PeerTube-8c7725dc3c01a73bf56a48c8b192d144bfdc3ffe.tar.gz PeerTube-8c7725dc3c01a73bf56a48c8b192d144bfdc3ffe.tar.zst PeerTube-8c7725dc3c01a73bf56a48c8b192d144bfdc3ffe.zip |
Add markdown support to plugins (#2654)
* Add markdown renderer to plugins
* Chore: add doc for markdown plugins
* Fix typing markdown plugin helpers
* Add lines between components in template
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
Diffstat (limited to 'support/doc/plugins')
-rw-r--r-- | support/doc/plugins/guide.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index e6870ce17..1bee1f611 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -149,6 +149,7 @@ registerSetting({ | |||
149 | name: 'admin-name', | 149 | name: 'admin-name', |
150 | label: 'Admin name', | 150 | label: 'Admin name', |
151 | type: 'input', | 151 | type: 'input', |
152 | // type: input | input-checkbox | input-textarea | markdown-text | markdown-enhanced | ||
152 | default: 'my super name' | 153 | default: 'my super name' |
153 | }) | 154 | }) |
154 | 155 | ||
@@ -216,6 +217,20 @@ notifier.success('Success message content.') | |||
216 | notifier.error('Error message content.') | 217 | notifier.error('Error message content.') |
217 | ``` | 218 | ``` |
218 | 219 | ||
220 | #### Markdown Renderer | ||
221 | |||
222 | To render a formatted markdown text to HTML: | ||
223 | |||
224 | ```js | ||
225 | const { markdownRenderer } = peertubeHelpers | ||
226 | |||
227 | await markdownRenderer.textMarkdownToHTML('**My Bold Text**') | ||
228 | // return <strong>My Bold Text</strong> | ||
229 | |||
230 | await markdownRenderer.enhancedMarkdownToHTML('![alt-img](http://.../my-image.jpg)') | ||
231 | // return <img alt=alt-img src=http://.../my-image.jpg /> | ||
232 | ``` | ||
233 | |||
219 | #### Custom Modal | 234 | #### Custom Modal |
220 | 235 | ||
221 | To show a custom modal: | 236 | To show a custom modal: |