From c7c727c717d5cc3c031f4f3c52070ffc6164e5d6 Mon Sep 17 00:00:00 2001 From: kmcfaul <45077788+kmcfaul@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:58:03 -0400 Subject: [PATCH] feat(templates): add templates package to versions.json (#3902) * feat(templates): add templates package to versions.json for docs build * add support for template inline alert * add to patch version, update wording * update wording --- packages/documentation-framework/scripts/md/parseMD.js | 2 ++ packages/documentation-framework/templates/mdx.js | 6 ++++++ packages/documentation-framework/versions.json | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) 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..34c1d5f53f 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,11 @@ const MDXChildTemplate = ({ {' '}To learn more about the process, visit our about page. )} + {(template || source === 'react-template') && ( + + {`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.`} + + )} ); // Create dynamic component for @reach/router diff --git a/packages/documentation-framework/versions.json b/packages/documentation-framework/versions.json index 529dc3baa6..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" } }, { @@ -69,7 +71,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",