Skip to content

Commit

Permalink
feat(templates): add templates package to versions.json (patternfly#3902
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
kmcfaul authored and nicolethoen committed Mar 28, 2024
1 parent ca5b485 commit 7b80a71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/documentation-framework/scripts/md/parseMD.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 })
Expand Down
6 changes: 6 additions & 0 deletions packages/documentation-framework/templates/mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const MDXChildTemplate = ({
optIn,
beta,
deprecated,
template,
newImplementationLink,
functionDocumentation = []
} = Component.getPageData();
Expand Down Expand Up @@ -84,6 +85,11 @@ const MDXChildTemplate = ({
{' '}To learn more about the process, visit our <Link to="/get-started/about#major-release-cadence">about page</Link>.
</InlineAlert>
)}
{(template || source === 'react-template') && (
<InlineAlert title="Templates" variant="info">
{`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.`}
</InlineAlert>
)}
</React.Fragment>
);
// Create dynamic component for @reach/router
Expand Down
9 changes: 6 additions & 3 deletions packages/documentation-framework/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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"
}
},
{
Expand All @@ -65,7 +66,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"
}
},
{
Expand All @@ -89,7 +91,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",
Expand Down

0 comments on commit 7b80a71

Please sign in to comment.