From 2cb76c827a14c11aa402bffbf36ee691b4352e22 Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Tue, 27 Feb 2024 10:46:01 -0500 Subject: [PATCH 1/4] feat(templates): add templates package to versions.json for docs build --- packages/documentation-framework/versions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/documentation-framework/versions.json b/packages/documentation-framework/versions.json index 529dc3baa6..5183f58f09 100644 --- a/packages/documentation-framework/versions.json +++ b/packages/documentation-framework/versions.json @@ -69,7 +69,8 @@ "@patternfly/react-topology": "5.2.1", "@patternfly/react-user-feedback": "5.0.0", "@patternfly/react-virtualized-extension": "5.0.0", - "@patternfly/quickstarts": "5.0.0" + "@patternfly/quickstarts": "5.0.0", + "@patternfly/react-templates": "^1.0.0-alpha.0" } },{ "name": "5.1.0", From c326d00f46b588537054aeea0147d23b9d2ee7cc Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Tue, 27 Feb 2024 16:16:15 -0500 Subject: [PATCH 2/4] add support for template inline alert --- packages/documentation-framework/scripts/md/parseMD.js | 2 ++ packages/documentation-framework/templates/mdx.js | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/packages/documentation-framework/scripts/md/parseMD.js b/packages/documentation-framework/scripts/md/parseMD.js index 1e02e8653f..78fbf50747 100644 --- a/packages/documentation-framework/scripts/md/parseMD.js +++ b/packages/documentation-framework/scripts/md/parseMD.js @@ -105,6 +105,7 @@ function toReactComponent(mdFilePath, source, buildMode) { section: frontmatter.section || '', subsection: frontmatter.subsection || '', deprecated: frontmatter.deprecated || false, + template: frontmatter.template || false, beta: frontmatter.beta || false, demo: frontmatter.demo || false, newImplementationLink: frontmatter.newImplementationLink || false, @@ -295,6 +296,7 @@ function sourceMDFile(file, source, buildMode) { ...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }), ...(pageData.beta && { beta: pageData.beta }), ...(pageData.deprecated && { deprecated: pageData.deprecated }), + ...(pageData.template && { template: pageData.template }), ...(pageData.demo && { demo: pageData.demo }), ...(pageData.sortValue && { sortValue: pageData.sortValue }), ...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue }) diff --git a/packages/documentation-framework/templates/mdx.js b/packages/documentation-framework/templates/mdx.js index c40f543407..ab4ddb8594 100644 --- a/packages/documentation-framework/templates/mdx.js +++ b/packages/documentation-framework/templates/mdx.js @@ -23,6 +23,7 @@ const MDXChildTemplate = ({ optIn, beta, deprecated, + template, newImplementationLink, functionDocumentation = [] } = Component.getPageData(); @@ -84,6 +85,12 @@ const MDXChildTemplate = ({ {' '}To learn more about the process, visit our about page. )} + {(template || source === 'react-template') && ( + + {`This section showcases templates for the ${id} component. A template is a wrapped ${id} component use case that has built in logic with a streamlined API, and some limited customization. + For custom use cases that fall outside of a template's design, please use the ${id} component suite directly.`} + + )} ); // Create dynamic component for @reach/router From 0cec4f955bd1b0c024bfb0763dce27b6b3264e02 Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Thu, 14 Mar 2024 12:00:03 -0400 Subject: [PATCH 3/4] add to patch version, update wording --- packages/documentation-framework/templates/mdx.js | 3 +-- packages/documentation-framework/versions.json | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/documentation-framework/templates/mdx.js b/packages/documentation-framework/templates/mdx.js index ab4ddb8594..e9c222bcee 100644 --- a/packages/documentation-framework/templates/mdx.js +++ b/packages/documentation-framework/templates/mdx.js @@ -87,8 +87,7 @@ const MDXChildTemplate = ({ )} {(template || source === 'react-template') && ( - {`This section showcases templates for the ${id} component. A template is a wrapped ${id} component use case that has built in logic with a streamlined API, and some limited customization. - For custom use cases that fall outside of a template's design, please use the ${id} component suite directly.`} + {`This page showcases templates for the ${id.toLowerCase()} component. A template consists of the component and additional logic supporting the use case, and has a streamlined API with some limited customization.`} )} diff --git a/packages/documentation-framework/versions.json b/packages/documentation-framework/versions.json index 5183f58f09..4091c8d880 100644 --- a/packages/documentation-framework/versions.json +++ b/packages/documentation-framework/versions.json @@ -21,7 +21,8 @@ "@patternfly/react-topology": "5.2.1", "@patternfly/react-user-feedback": "5.0.0", "@patternfly/react-virtualized-extension": "5.0.0", - "@patternfly/quickstarts": "5.0.0" + "@patternfly/quickstarts": "5.0.0", + "@patternfly/react-templates": "^1.0.0-alpha.0" } }, { @@ -45,7 +46,8 @@ "@patternfly/react-topology": "5.2.1", "@patternfly/react-user-feedback": "5.0.0", "@patternfly/react-virtualized-extension": "5.0.0", - "@patternfly/quickstarts": "5.0.0" + "@patternfly/quickstarts": "5.0.0", + "@patternfly/react-templates": "^1.0.0-alpha.0" } }, { From 9c0b013a3ffab2aa7e81b3af817396052e2f2ff2 Mon Sep 17 00:00:00 2001 From: Katie McFaul Date: Mon, 18 Mar 2024 10:28:22 -0400 Subject: [PATCH 4/4] update wording --- packages/documentation-framework/templates/mdx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation-framework/templates/mdx.js b/packages/documentation-framework/templates/mdx.js index e9c222bcee..34c1d5f53f 100644 --- a/packages/documentation-framework/templates/mdx.js +++ b/packages/documentation-framework/templates/mdx.js @@ -87,7 +87,7 @@ const MDXChildTemplate = ({ )} {(template || source === 'react-template') && ( - {`This page showcases templates for the ${id.toLowerCase()} component. A template consists of the component and additional logic supporting the use case, and has a streamlined API with some limited customization.`} + {`This page showcases templates for the ${id.toLowerCase()} component. A template combines a component with logic that supports a specific use case, with a streamlined API that offers additional, limited customization.`} )}