@patternfly/documentation-framework 2.0.0-alpha.20 → 2.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 2.0.0-alpha.21 (2023-04-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * clean up references to katacoda ([#3491](https://github.com/patternfly/patternfly-org/issues/3491)) ([5de986b](https://github.com/patternfly/patternfly-org/commit/5de986b917ee7edf9c476bb2df2f2ee4d454a7e1))
12
+
13
+
14
+
15
+
16
+
6
17
  # 2.0.0-alpha.20 (2023-04-14)
7
18
 
8
19
  **Note:** Version bump only for package @patternfly/documentation-framework
package/app.js CHANGED
@@ -16,7 +16,7 @@ import './components/sideNav/sideNav.css';
16
16
  import './components/topNav/topNav.css';
17
17
  import './layouts/sideNavLayout/sideNavLayout.css';
18
18
 
19
- const AppRoute = ({ child, katacodaLayout, title, path }) => {
19
+ const AppRoute = ({ child, title, path }) => {
20
20
  const pathname = useLocation().pathname;
21
21
  if (typeof window !== 'undefined' && window.gtag) {
22
22
  gtag('config', process.env.googleAnalyticsID, {
@@ -31,7 +31,7 @@ const AppRoute = ({ child, katacodaLayout, title, path }) => {
31
31
  return (
32
32
  <React.Fragment>
33
33
  {child}
34
- {!katacodaLayout && process.env.hasFooter && <Footer />}
34
+ {process.env.hasFooter && <Footer />}
35
35
  </React.Fragment>
36
36
  );
37
37
  }
@@ -39,18 +39,17 @@ const AppRoute = ({ child, katacodaLayout, title, path }) => {
39
39
  const SideNavRouter = () => {
40
40
  const pathname = useLocation().pathname.replace(process.env.pathPrefix, '');
41
41
  const componentsData = process?.env?.componentsData;
42
- const navOpen = !routes[pathname] || !routes[pathname].katacodaLayout;
42
+ const navOpen = !routes[pathname];
43
43
  return (
44
44
  <SideNavLayout groupedRoutes={groupedRoutes} navOpen={navOpen} >
45
45
  <Router id="ws-page-content-router">
46
46
  {Object.entries(routes)
47
- .map(([path, { Component, title, sources, katacodaLayout, id }]) => Component
47
+ .map(([path, { Component, title, sources, id }]) => Component
48
48
  ? <AppRoute
49
49
  key={path}
50
50
  path={path}
51
51
  default={path === '/404'}
52
52
  child={<Component />}
53
- katacodaLayout={katacodaLayout}
54
53
  title={title}
55
54
  />
56
55
  : <AppRoute
@@ -65,7 +64,6 @@ const SideNavRouter = () => {
65
64
  componentsData={componentsData}
66
65
  />
67
66
  }
68
- katacodaLayout={katacodaLayout}
69
67
  title={title}
70
68
  />
71
69
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "2.0.0-alpha.20",
4
+ "version": "2.0.0-alpha.21",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -89,5 +89,5 @@
89
89
  "react": "^17.0.0 || ^18.0.0",
90
90
  "react-dom": "^17.0.0 || ^18.0.0"
91
91
  },
92
- "gitHead": "421584878eaf3a8b4bce4f8ac45238c6b2c3557c"
92
+ "gitHead": "527165f722646aff84364fd888e6c676da746a77"
93
93
  }
package/routes.js CHANGED
@@ -30,7 +30,7 @@ const isNull = o => o === null || o === undefined;
30
30
  const groupedRoutes = Object.entries(routes)
31
31
  .filter(([_slug, { id, section }]) => !isNull(id) && !isNull(section))
32
32
  .reduce((accum, [slug, pageData]) => {
33
- const { section, subsection = null, id, title, source, katacodaLayout, hideNavItem, relPath, sortValue = null, subsectionSortValue = null } = pageData;
33
+ const { section, subsection = null, id, title, source, hideNavItem, relPath, sortValue = null, subsectionSortValue = null } = pageData;
34
34
  pageData.slug = slug;
35
35
  // add section to groupedRoutes obj if not yet created
36
36
  accum[section] = accum[section] || {};
@@ -42,7 +42,6 @@ const groupedRoutes = Object.entries(routes)
42
42
  title,
43
43
  slug: makeSlug(source, section, id, true, subsection),
44
44
  sources: [],
45
- katacodaLayout,
46
45
  hideNavItem,
47
46
  relPath,
48
47
  ...(sortValue && { sortValue }),
@@ -118,12 +118,6 @@ function toReactComponent(mdFilePath, source, buildMode) {
118
118
  ? frontmatter.cssPrefix
119
119
  : [frontmatter.cssPrefix];
120
120
  }
121
- if (frontmatter.katacodaBroken) {
122
- pageData.katacodaBroken = frontmatter.katacodaBroken;
123
- }
124
- if (frontmatter.katacodaLayout) {
125
- pageData.katacodaLayout = frontmatter.katacodaLayout;
126
- }
127
121
  if (frontmatter.hideNavItem) {
128
122
  pageData.hideNavItem = frontmatter.hideNavItem;
129
123
  }
@@ -274,7 +268,6 @@ function sourceMDFile(file, source, buildMode) {
274
268
  subsection: pageData.subsection,
275
269
  source: pageData.source,
276
270
  tabName: pageData.tabName,
277
- ...(pageData.katacodaLayout && { katacodaLayout: pageData.katacodaLayout }),
278
271
  ...(pageData.hideNavItem && { hideNavItem: pageData.hideNavItem }),
279
272
  ...(pageData.sortValue && { sortValue: pageData.sortValue }),
280
273
  ...(pageData.subsectionSortValue && { subsectionSortValue: pageData.subsectionSortValue })
package/templates/mdx.css CHANGED
@@ -297,11 +297,6 @@
297
297
  max-width: 832px;
298
298
  }
299
299
 
300
- .ws-mdx-content-katacoda {
301
- flex-grow: 1;
302
- padding: 0;
303
- }
304
-
305
300
  /* Overlay the footer */
306
301
  .ws-back-to-top {
307
302
  z-index: 2;
package/templates/mdx.js CHANGED
@@ -19,9 +19,7 @@ const MDXChildTemplate = ({
19
19
  sourceLink,
20
20
  cssPrefix = [],
21
21
  optIn,
22
- beta,
23
- katacodaBroken,
24
- katacodaLayout
22
+ beta
25
23
  } = Component.getPageData();
26
24
  const cssVarsTitle = cssPrefix.length > 0 && 'CSS variables';
27
25
  const propsTitle = propComponents.length > 0 && 'Props';
@@ -59,11 +57,6 @@ const MDXChildTemplate = ({
59
57
  To learn more about the process, visit our <Link to="/get-started/about#beta-components">about page</Link> or our <a href="https://github.com/patternfly/patternfly-org/tree/main/beta-component-promotion">Beta components</a> page on GitHub.
60
58
  </InlineAlert>
61
59
  )}
62
- {katacodaBroken && (
63
- <InlineAlert variant="warning" title="Down for maintenance">
64
- The embedded version of our tutorials are broken, but you can still access our tutorials on <a href="https://www.katacoda.com/patternfly">Katacoda.com <ExternalLinkAltIcon /></a>.
65
- </InlineAlert>
66
- )}
67
60
  </React.Fragment>
68
61
  );
69
62
  // Create dynamic component for @reach/router
@@ -72,8 +65,8 @@ const MDXChildTemplate = ({
72
65
  {toc.length > 1 && (
73
66
  <TableOfContents items={toc} />
74
67
  )}
75
- <div className={katacodaLayout? "ws-mdx-content-katacoda" : "ws-mdx-content"}>
76
- <div className={katacodaLayout ? "" : "ws-mdx-content-content"}>
68
+ <div className="ws-mdx-content">
69
+ <div className="ws-mdx-content-content">
77
70
  {InlineAlerts}
78
71
  <Component />
79
72
  {propsTitle && (
@@ -100,7 +93,7 @@ const MDXChildTemplate = ({
100
93
  <CSSVariables prefix={cssPrefix} />
101
94
  </React.Fragment>
102
95
  )}
103
- {!katacodaLayout && sourceLink && (
96
+ {sourceLink && (
104
97
  <React.Fragment>
105
98
  <br />
106
99
  <a href={sourceLink} target="_blank" onClick={() => trackEvent('view_source_click', 'click_event', source.toUpperCase())}>View source on GitHub</a>
@@ -167,7 +160,6 @@ export const MDXTemplate = ({
167
160
  (e) => e.includes("pages") || e.includes("training")
168
161
  );
169
162
  const { pathname } = useLocation();
170
- const { katacodaLayout } = sources[0].Component.getPageData();
171
163
  let activeSource = pathname.replace(/\/$/, '').split('/').pop();
172
164
  // get summary text, convert to JSX to display above tabs on component pages
173
165
  const componentDasherized = id.split(' ').join('-').toLowerCase();
@@ -209,7 +201,7 @@ export const MDXTemplate = ({
209
201
  isWidthLimited
210
202
  >
211
203
  <TextContent>
212
- {!katacodaLayout && <Title headingLevel='h1' size='4xl' id="ws-page-title">{title}</Title>}
204
+ <Title headingLevel='h1' size='4xl' id="ws-page-title">{title}</Title>
213
205
  {isComponent && summary && (<SummaryComponent />)}
214
206
  </TextContent>
215
207
  </PageSection>