From 8c7725dc3c01a73bf56a48c8b192d144bfdc3ffe Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Mon, 20 Apr 2020 14:51:24 +0200 Subject: 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 --- .../plugin-show-installed.component.html | 18 ++++++++++++++++++ client/src/app/core/plugins/plugin.service.ts | 12 ++++++++++++ client/src/types/register-client-option.model.ts | 5 +++++ 3 files changed, 35 insertions(+) (limited to 'client/src') diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html index 95dd74d31..bf135ecbd 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html @@ -8,9 +8,27 @@
+ + + + + + + + + + { + return this.markdownRenderer.textMarkdownToHTML(textMarkdown) + }, + + enhancedMarkdownToHTML: (enhancedMarkdown: string) => { + return this.markdownRenderer.enhancedMarkdownToHTML(enhancedMarkdown) + } + }, + translate: (value: string) => { return this.translationsObservable .pipe(map(allTranslations => allTranslations[npmName])) diff --git a/client/src/types/register-client-option.model.ts b/client/src/types/register-client-option.model.ts index 1c235107a..dff00e9dd 100644 --- a/client/src/types/register-client-option.model.ts +++ b/client/src/types/register-client-option.model.ts @@ -27,5 +27,10 @@ export type RegisterClientHelpers = { confirm?: { value: string, action?: () => void } }) => void + markdownRenderer: { + textMarkdownToHTML: (textMarkdown: string) => Promise + enhancedMarkdownToHTML: (enhancedMarkdown: string) => Promise + } + translate: (toTranslate: string) => Promise } -- cgit v1.2.3