Skip to content

Commit

Permalink
fix: source paths in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jun 19, 2020
1 parent f5dd7e5 commit 322c055
Show file tree
Hide file tree
Showing 20 changed files with 2,979 additions and 2,264 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,10 @@ Some of the guiding design goals for this library:

Component controls commonly used UI components.

Some of the guiding design goals for this library:

- Use theme-ui/system-ui as an foundation for a react UI library.
- As much as possible possible, avoid using components with css dependencies.
An ecclectic collection of [theme-ui](https://theme-ui.com)-based components that are used throughout `component-controls`.

Third-party libraries used in no particular order:

- [theme-ui](https://theme-ui.com) as the theming and components foundation.
- [prism](https://prismjs.com) for source code syntax highlighting, rendered with [prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer).
- [markdown-to-jsx](https://probablyup.com/markdown-to-jsx/) to transform markdown to JSX at runtime.
- [react-table](https://github.com/tannerlinsley/react-table) to display tabular data.
Expand Down
1 change: 1 addition & 0 deletions core/loader/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class LoaderPlugin {
placeholderPos,
placeholderPos + placeholder.length - 1,
newContent,
file,
);
compilation.assets[file] = newSource;
}
Expand Down
14 changes: 7 additions & 7 deletions integrations/gatsby-theme-stories/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ in `gatsby-config.js`:

Store class used to query the stories and exchange information between processes

_Store [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/index.ts)_
_Store [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/index.ts)_

## <ins>GatsbyLink</ins>

_GatsbyLink [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/components/GatsbyLink.tsx)_
_GatsbyLink [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/components/GatsbyLink.tsx)_

### properties

Expand All @@ -81,7 +81,7 @@ _GatsbyLink [source code](https:/github.com/ccontrols/component-controls/tree/ma

## <ins>Layout</ins>

_Layout [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/components/Layout.tsx)_
_Layout [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/components/Layout.tsx)_

### properties

Expand All @@ -92,7 +92,7 @@ _Layout [source code](https:/github.com/ccontrols/component-controls/tree/master

## <ins>CategoryList</ins>

_CategoryList [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/CategoryList.tsx)_
_CategoryList [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/CategoryList.tsx)_

### properties

Expand All @@ -102,7 +102,7 @@ _CategoryList [source code](https:/github.com/ccontrols/component-controls/tree/

## <ins>CategoryPage</ins>

_CategoryPage [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/CategoryPage.tsx)_
_CategoryPage [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/CategoryPage.tsx)_

### properties

Expand All @@ -112,7 +112,7 @@ _CategoryPage [source code](https:/github.com/ccontrols/component-controls/tree/

## <ins>DocPage</ins>

_DocPage [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/DocPage.tsx)_
_DocPage [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/DocPage.tsx)_

### properties

Expand All @@ -122,7 +122,7 @@ _DocPage [source code](https:/github.com/ccontrols/component-controls/tree/maste

## <ins>PageList</ins>

_PageList [source code](https:/github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/PageList.tsx)_
_PageList [source code](https://github.com/ccontrols/component-controls/tree/master/integrations/gatsby-theme-stories/src/templates/PageList.tsx)_

### properties

Expand Down
100 changes: 50 additions & 50 deletions integrations/storybook/README.md

Large diffs are not rendered by default.

82 changes: 0 additions & 82 deletions misc/storybook-custom-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
- [Simple page](#simple-page)
- [Render story](#render-story)
- [API](#api)
- [getCurrentStoryId](#getcurrentstoryid)
- [getGlobalOptions](#getglobaloptions)
- [useContext](#usecontext)
- [useStoryId](#usestoryid)
- [CustomPageDef](#custompagedef)
- [CustomPageRenderFnParams](#custompagerenderfnparams)
- [CustomPageRenderFn](#custompagerenderfn)

# In action

Expand Down Expand Up @@ -127,79 +120,4 @@ export default {

<!-- START-TSDOC-TYPESCRIPT -->

## getCurrentStoryId

function returning the current story id

_defined in [@component-controls/storybook-custom-docs/src/index.tsx](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/index.tsx#L25)_

**function** getCurrentStoryId(): string | undefined;

## getGlobalOptions

function returning the global options
parameters and decorators

_defined in [@component-controls/storybook-custom-docs/src/index.tsx](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/index.tsx#L11)_

**function** getGlobalOptions(): any;

## useContext

React hook - returns a context similar (but not identical) that can be used as an input attribute to \`&lt;DocsContainer />\`

_defined in [@component-controls/storybook-custom-docs/src/index.tsx](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/index.tsx#L64)_

**function** useContext(): any;

## useStoryId

React hook hook that tracks the changes to the current story and returns it's id

_defined in [@component-controls/storybook-custom-docs/src/index.tsx](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/index.tsx#L43)_

**function** useStoryId(): string;

## CustomPageDef

_defined in [@component-controls/storybook-custom-docs/src/types.ts](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/types.ts#L29)_



### properties

| Name | Type | Description |
| --------- | ----------------------------------------- | ------------------------------ |
| `key*` | string | key used for router navigation |
| `render*` | [CustomPageRenderFn](#custompagerenderfn) | react render function. |
| `title*` | string | title of the page's tab |

## CustomPageRenderFnParams

Custom page default export
example:

_defined in [@component-controls/storybook-custom-docs/src/types.ts](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/types.ts#L18)_



### properties

| Name | Type | Description |
| --------- | ------- | -------------------------------------------- |
| `active*` | boolean | is the page active (visible) or not (hidden) |

## CustomPageRenderFn

_defined in [@component-controls/storybook-custom-docs/src/types.ts](https://github.com/ccontrols/component-controls/tree/master/misc/storybook-custom-docs/src/types.ts#L25)_

**function** (`params`\*: [CustomPageRenderFnParams](#custompagerenderfnparams)): [React.ReactNode](#react.reactnode);

### parameters

| Name | Type | Description |
| --------- | ----------------------------------------------------- | ----------- |
| `params*` | [CustomPageRenderFnParams](#custompagerenderfnparams) | |
| `returns` | [React.ReactNode](#react.reactnode) | |

<!-- END-TSDOC-TYPESCRIPT -->
32 changes: 16 additions & 16 deletions plugins/axe-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,42 +77,42 @@ export const TestingCustomePage= () => (

Story block container that displays displays the [axe](https://github.com/dequelabs/axe-core) ally test results

_AxeAllyBlock [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/index.tsx)_
_AxeAllyBlock [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/index.tsx)_

### properties

| Name | Type | Description |
| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `axeOptions` | _Spec_ | |
| `id` | _string_ | id of the story optional id to be used for the block if no id is provided, one will be calculated automatically from the title. |
| `name` | _string_ | alternatively you can use the name of a story to load from an external file |
| `title` | _string_ | optional section title for the block. |
| `description` | _string_ | optional markdown description. |
| `collapsible` | _boolean_ | if false, will nothave a collapsible frame. |
| `sxStyle` | _SystemStyleObject_ | theme-ui styling object for Block Box |
| Name | Type | Description |
| ------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `axeOptions` | _Spec_ | |
| `id` | _string_ | id of the story optional id to be used for the block if no id is provided, one will be calculated automatically from the title. |
| `name` | _string_ | alternatively you can use the name of a story to load from an external file |
| `title` | _string_ | optional section title for the block. |
| `description` | _string_ | optional markdown description. |
| `collapsible` | _boolean_ | if false, will nothave a collapsible frame. |
| `sxStyle` | _ThemeUIStyleObject_ | theme-ui styling object for Block Box |

## <ins>AxeContextProvider</ins>

_AxeContextProvider [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_
_AxeContextProvider [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_

## <ins>SelectionContextProvider</ins>

_SelectionContextProvider [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_
_SelectionContextProvider [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_

## <ins>isTagSelected</ins>

_isTagSelected [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_
_isTagSelected [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/context.tsx)_

## <ins>isSelected</ins>

_isSelected [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/recoil.tsx)_
_isSelected [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/recoil.tsx)_

## <ins>isTagSelected</ins>

_isTagSelected [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/recoil.tsx)_
_isTagSelected [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/state/recoil.tsx)_

## <ins>overview</ins>

_overview [source code](https:/github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/stories/AllyBlock.stories.tsx)_
_overview [source code](https://github.com/ccontrols/component-controls/tree/master/plugins/axe-plugin/src/stories/AllyBlock.stories.tsx)_

<!-- END-REACT-DOCGEN-TYPESCRIPT -->
2 changes: 2 additions & 0 deletions props-info/react-docgen-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ _defined in [react-docgen-typescript/lib/parser.d.ts](https://github.com/stylegu
| `propFilter` | [StaticPropFilter](#staticpropfilter) \| [PropFilter](#propfilter) | |
| `savePropValueAsString` | boolean | |
| `shouldExtractLiteralValuesFromEnum` | boolean | |
| `shouldExtractValuesFromUnion` | boolean | |
| `shouldRemoveUndefinedFromOptional` | boolean | |

## Method

Expand Down
14 changes: 7 additions & 7 deletions props-info/react-docgen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ object

## ParserOptions

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_



Expand Down Expand Up @@ -192,19 +192,19 @@ _defined in [@component-controls/react-docgen-info/src/types.ts](https://github.

## ParserPlugin

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_

'asyncGenerators' | 'bigInt' | 'classPrivateMethods' | 'classPrivateProperties' | 'classProperties' | 'decorators' | 'decorators-legacy' | 'doExpressions' | 'dynamicImport' | 'estree' | 'exportDefaultFrom' | 'exportNamespaceFrom' | 'flow' | 'flowComments' | 'functionBind' | 'functionSent' | 'importMeta' | 'jsx' | 'logicalAssignment' | 'nullishCoalescingOperator' | 'numericSeparator' | 'objectRestSpread' | 'optionalCatchBinding' | 'optionalChaining' | 'partialApplication' | 'pipelineOperator' | 'placeholders' | 'throwExpressions' | 'topLevelAwait' | 'typescript' | 'v8intrinsic' | [ParserPluginWithOptions](#parserpluginwithoptions)
'asyncGenerators' | 'bigInt' | 'classPrivateMethods' | 'classPrivateProperties' | 'classProperties' | 'decorators' | 'decorators-legacy' | 'doExpressions' | 'dynamicImport' | 'estree' | 'exportDefaultFrom' | 'exportNamespaceFrom' | 'flow' | 'flowComments' | 'functionBind' | 'functionSent' | 'importMeta' | 'jsx' | 'logicalAssignment' | 'moduleAttributes' | 'nullishCoalescingOperator' | 'numericSeparator' | 'objectRestSpread' | 'optionalCatchBinding' | 'optionalChaining' | 'partialApplication' | 'pipelineOperator' | 'placeholders' | 'privateIn' | 'throwExpressions' | 'topLevelAwait' | 'typescript' | 'v8intrinsic' | [ParserPluginWithOptions](#parserpluginwithoptions)

## ParserPluginWithOptions

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_

\['decorators', [DecoratorsPluginOptions](#decoratorspluginoptions)] \| \['pipelineOperator', [PipelineOperatorPluginOptions](#pipelineoperatorpluginoptions)] \| \['flow', [FlowPluginOptions](#flowpluginoptions)]

## DecoratorsPluginOptions

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_



Expand All @@ -216,7 +216,7 @@ _defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_

## PipelineOperatorPluginOptions

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_



Expand All @@ -228,7 +228,7 @@ _defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_

## FlowPluginOptions

_defined in [@babel/parser/typings/babel-parser.d.ts](https://github)_
_defined in [@babel/parser/typings/babel-parser.d.ts](https://github.com/babel/babel/tree/master/packages/babel-parser)_



Expand Down
8 changes: 5 additions & 3 deletions scripts/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,25 @@ export const traverseDirs = (
getDirectories(
path.join(folder, entry.name),
excludeFiles,
path.join(repoDir, entry.name),
`${repoDir}/${entry.name}`,
newNodes,
),
);
};
if (attributes) {
const file = attributes.find(attribute => attribute[0] === 'path');
const sourcePath = file ? file[1] : './src';
const { repo = '' } = getRepoPath(sourcePath) || './src';
const { repo = '' } = getRepoPath(sourcePath) || {};

const excludeFiles = attributes.find(
attribute => attribute[0] === 'exclude',
);
const newNodes: Node[] = [];
const url = new URL(repo);
getDirectories(
path.resolve(sourcePath),
excludeFiles ? excludeFiles[1].split(',') : ['index.ts'],
path.join(repo, sourcePath),
`${url.origin}${path.join(url.pathname, sourcePath)}`,
newNodes,
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'path';
import remark from 'remark';
import {
withDefaultConfig,
Expand Down Expand Up @@ -109,7 +108,7 @@ export const insertReactDocgenTypescript = (
propTables.forEach(propTable => {
const propNodes = propsToMDNodes(
propTable,
path.join(repoFolder, name),
`${repoFolder}/${name}`,
);
newNodes.push.apply(newNodes, propNodes);
});
Expand Down
Loading

0 comments on commit 322c055

Please sign in to comment.