Skip to content

Commit 7b80a71

Browse files
kmcfaulnicolethoen
authored andcommitted
feat(templates): add templates package to versions.json (patternfly#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
1 parent ca5b485 commit 7b80a71

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

packages/documentation-framework/scripts/md/parseMD.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function toReactComponent(mdFilePath, source, buildMode) {
105105
section: frontmatter.section || '',
106106
subsection: frontmatter.subsection || '',
107107
deprecated: frontmatter.deprecated || false,
108+
template: frontmatter.template || false,
108109
beta: frontmatter.beta || false,
109110
demo: frontmatter.demo || false,
110111
newImplementationLink: frontmatter.newImplementationLink || false,
@@ -295,6 +296,7 @@ function sourceMDFile(file, source, buildMode) {
295296
...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }),
296297
...(pageData.beta && { beta: pageData.beta }),
297298
...(pageData.deprecated && { deprecated: pageData.deprecated }),
299+
...(pageData.template && { template: pageData.template }),
298300
...(pageData.demo && { demo: pageData.demo }),
299301
...(pageData.sortValue && { sortValue: pageData.sortValue }),
300302
...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue })

packages/documentation-framework/templates/mdx.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const MDXChildTemplate = ({
2323
optIn,
2424
beta,
2525
deprecated,
26+
template,
2627
newImplementationLink,
2728
functionDocumentation = []
2829
} = Component.getPageData();
@@ -84,6 +85,11 @@ const MDXChildTemplate = ({
8485
{' '}To learn more about the process, visit our <Link to="/get-started/about#major-release-cadence">about page</Link>.
8586
</InlineAlert>
8687
)}
88+
{(template || source === 'react-template') && (
89+
<InlineAlert title="Templates" variant="info">
90+
{`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.`}
91+
</InlineAlert>
92+
)}
8793
</React.Fragment>
8894
);
8995
// Create dynamic component for @reach/router

packages/documentation-framework/versions.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"@patternfly/react-topology": "5.2.1",
4242
"@patternfly/react-user-feedback": "5.0.0",
4343
"@patternfly/react-virtualized-extension": "5.0.0",
44-
"@patternfly/quickstarts": "5.0.0"
44+
"@patternfly/quickstarts": "5.0.0",
45+
"@patternfly/react-templates": "^1.0.0-alpha.0"
4546
}
4647
},
4748
{
@@ -65,7 +66,8 @@
6566
"@patternfly/react-topology": "5.2.1",
6667
"@patternfly/react-user-feedback": "5.0.0",
6768
"@patternfly/react-virtualized-extension": "5.0.0",
68-
"@patternfly/quickstarts": "5.0.0"
69+
"@patternfly/quickstarts": "5.0.0",
70+
"@patternfly/react-templates": "^1.0.0-alpha.0"
6971
}
7072
},
7173
{
@@ -89,7 +91,8 @@
8991
"@patternfly/react-topology": "5.2.1",
9092
"@patternfly/react-user-feedback": "5.0.0",
9193
"@patternfly/react-virtualized-extension": "5.0.0",
92-
"@patternfly/quickstarts": "5.0.0"
94+
"@patternfly/quickstarts": "5.0.0",
95+
"@patternfly/react-templates": "^1.0.0-alpha.0"
9396
}
9497
},{
9598
"name": "5.1.0",

0 commit comments

Comments
 (0)