Skip to content

Commit

Permalink
feat(docs): fix for missing props tables (#3981)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed May 2, 2024
1 parent 6a627ec commit 11963b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const path = require('path');
const path = require("path");

module.exports = (sourceMD, sourceProps) => {
/** Parse source content for props so that we can display them. You must source props before sourcing the markdown
files, otherwise the props table won't be rendered.
*/
const propsIgnore = ['**/*.test.tsx', '**/examples/*.tsx'];
const extensionPath = path.join(__dirname, '../src');
sourceProps(path.join(extensionPath, '/**/*.tsx'), propsIgnore);
const propsIgnore = ["/**/*.test.tsx", "/**/examples/*.tsx"];
const extensionPath = path.join(__dirname, "../src");
sourceProps(path.join(extensionPath, "/**/*.tsx"), propsIgnore);

// Parse md files
const contentBase = path.join(__dirname, './content');
sourceMD(path.join(contentBase, 'extensions/**/*.md'), 'extensions');
// Parse md files
const contentBase = path.join(__dirname, "./content");
sourceMD(path.join(contentBase, "extensions/**/*.md"), "extensions");

/**
If you want to parse content from node_modules instead of providing a relative/absolute path,
Expand All @@ -23,4 +23,4 @@ module.exports = (sourceMD, sourceProps) => {
sourceMD(path.join(extensionPath, '../patternfly-docs/**\/demos/*.md'), 'react-demos');
sourceMD(path.join(extensionPath, '../patternfly-docs/**\/design-guidelines/*.md'), 'design-guidelines');
*/
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ module.exports = (sourceMD, sourceProps, sourceFunctionDocs) => {

// Content md
const contentBase = path.join(__dirname, "../patternfly-docs/content");
const reactPropsIgnore = ["**/*.test.tsx", "**/examples/*.tsx"];
const reactPropsIgnore = [
"/**/examples/**",
"/**/__mocks__/**",
"/**/__tests__/**",
"/**/*.test.tsx",
];
sourceMD(path.join(contentBase, "extensions/**/*.md"), "extensions");
if (!(process.env.EXTENSIONS_ONLY === "true")) {
sourceMD(path.join(contentBase, "contribute/**/*.md"), "pages-contribute");
Expand Down

0 comments on commit 11963b6

Please sign in to comment.