diff --git a/.changeset/chilly-chicken-fix.md b/.changeset/chilly-chicken-fix.md new file mode 100644 index 0000000000..451789a56f --- /dev/null +++ b/.changeset/chilly-chicken-fix.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch +--- + +Added example for the `confluence:transform:markdown` that will show in the installed actions list diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.examples.ts b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.examples.ts new file mode 100644 index 0000000000..29249d2dc3 --- /dev/null +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.examples.ts @@ -0,0 +1,43 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TemplateExample } from '@backstage/plugin-scaffolder-node'; +import yaml from 'yaml'; + +export const examples: TemplateExample[] = [ + { + description: + 'Downloads content from provided Confluence URLs and converts it to Markdown.', + example: yaml.stringify({ + steps: [ + { + action: 'confluence:transform:markdown', + id: 'confluence-transform-markdown', + name: 'Transform Confluence content to Markdown', + input: { + confluenceUrls: [ + 'https://confluence.example.com/display/SPACEKEY/Page+Title', + 'https://confluence.example.com/prefix/display/PREFIXSPACEKEY/Prefix+Page+Title', + 'https://example.atlassian.net/wiki/spaces/CLOUDSPACEKEY/pages/1234567/Cloud+Page+Title', + ], + repoUrl: + 'https://github.com/organization-name/repo-name/blob/main/mkdocs.yml', + }, + }, + ], + }), + }, +]; diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts index 71a3af11ae..e88f42e39c 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts @@ -33,6 +33,7 @@ import { createConfluenceVariables, getConfluenceConfig, } from './helpers'; +import { examples } from './confluenceToMarkdown.examples'; /** * @public @@ -53,6 +54,8 @@ export const createConfluenceToMarkdownAction = (options: { repoUrl: string; }>({ id: 'confluence:transform:markdown', + description: 'Transforms Confluence content to Markdown', + examples, schema: { input: { properties: {