Added example for confluece to markdown action

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2023-07-28 15:35:25 -05:00
parent ea706fd0f3
commit 0a9b3b14e9
3 changed files with 51 additions and 0 deletions
+5
View File
@@ -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
@@ -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',
},
},
],
}),
},
];
@@ -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: {