Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fbb81dd
minimum working docs
redallen Mar 21, 2019
ec89997
add nav
redallen Mar 21, 2019
2f18aed
prettier props and token rendering
redallen Mar 21, 2019
8837ea1
refactor
redallen Mar 21, 2019
3ce9dba
live editing
redallen Mar 22, 2019
307e231
acorn fail
redallen Mar 22, 2019
7a4ea4d
sloppy dynamic imports
redallen Mar 25, 2019
1a752d2
Convert react-core docs to markdown
redallen Mar 26, 2019
5ae2f00
react-core layouts and demos
redallen Mar 26, 2019
18ea826
#### to ##
redallen Mar 27, 2019
744872a
navbar
redallen Mar 27, 2019
fde5f1c
titles
redallen Mar 27, 2019
698a8a0
pretty css variables
redallen Mar 27, 2019
2dc4b52
chart docs
redallen Mar 27, 2019
2ceaa6c
table docs
redallen Mar 27, 2019
e4ce974
icon docs
redallen Mar 28, 2019
08e8371
remember to super
redallen Mar 28, 2019
4c38f39
add static assets
redallen Mar 28, 2019
58d4383
add prop description
redallen Mar 28, 2019
881cc83
change build target
redallen Mar 28, 2019
83825ae
Merge upstream/master
redallen Mar 28, 2019
5665dba
clean
redallen Mar 28, 2019
2358f95
make static copy (cleaner)
redallen Mar 28, 2019
e9b276f
order is very important
redallen Mar 28, 2019
4cb2af0
pretty fullscreen links that will never conflict
redallen Mar 28, 2019
808dc7b
fix bundle size
redallen Mar 28, 2019
76e89eb
axe
redallen Mar 28, 2019
0728834
add docs for new components
redallen Mar 28, 2019
eca9383
fix lerna run build
redallen Mar 28, 2019
f76a5e2
LiveEdit copy and border
redallen Mar 29, 2019
261ad53
fix nav
redallen Mar 29, 2019
d8e324c
add styled system
redallen Mar 29, 2019
52e26ca
more styling
redallen Mar 29, 2019
5d93676
Merge upstream/master
redallen Mar 29, 2019
b38abcf
versions on index page
redallen Mar 29, 2019
95f6bba
add handlebars
redallen Mar 29, 2019
ac99302
Merge upstream/master
redallen Apr 1, 2019
3d3e50f
clean + favicon
redallen Apr 1, 2019
9b3f5de
yarn.lock
redallen Apr 1, 2019
0893310
cmon circleci
redallen Apr 1, 2019
1e23167
add docs
redallen Apr 1, 2019
c8946c9
Merge upstream/master
redallen Apr 1, 2019
570d0fd
fix build
redallen Apr 1, 2019
071c653
doc updates
redallen Apr 1, 2019
2afa973
pretty table
redallen Apr 1, 2019
7046360
style
redallen Apr 1, 2019
7fd6497
remove console.log
redallen Apr 1, 2019
208478d
fix active link
redallen Apr 1, 2019
16ec63b
style index, fix nav flash?
redallen Apr 2, 2019
273075d
real nice index
redallen Apr 2, 2019
ab9f7f9
Merge upstream/master
redallen Apr 2, 2019
db3bbea
remove console.log
redallen Apr 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
command: |
yarn build:docs &&
cp -r packages/patternfly-4/react-docs/public .public/patternfly-4 &&
cp -r packages/patternfly-4/react-docs/public/assets .public/assets
cp -r .public/patternfly-4/assets .public/assets &&
cp .public/patternfly-4/favicon* .public
no_output_timeout: 30m
- run:
name: Deploy Docs
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ jobs:
- yarn build:storybook
- mv .out .public/patternfly-3
- mv packages/patternfly-4/react-docs/public .public/patternfly-4
- cp .public/patternfly-4/favicon* .public
- cp -r .public/patternfly-4/assets .public/assets
- .circleci/conditional_upload.sh
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ Please ensure that all React UI components contributed meet the following guidel
- When your stories contain multiple files, put them in a subfolder named `Stories`
- `src/**/*.stories.js` and `src/**/Stories/` are excluded from the package build output
- Documentation for PatternFly 4
- Provide documentation for your component with examples in the component's example directory. examples (e.g `Listgroup/examples/SimpleListGroup.js`)
- All examples should be added to the component's documentation file (`ComponentName.docs.js`) exports.
See the getting started guide for more information on [Adding documentation](./GETTING-STARTED.md#adding-component-documentation)
- Provide documentation for your component with a single Markdown file. (e.g., `ListGroup.md`)
See how to write documentation in the [`react-docs` README](./packages/patternfly-4/react-docs/README.md)
- When writing a component and you want to use the classnames package, be sure to import and name it `classNames`. For example - `import classNames from 'classnames'`
- When destructuring or spreading expressions , use ...props as the variable name.
- Exporting components from other libraries (without manipulating them)
Expand Down Expand Up @@ -256,9 +255,7 @@ $ git checkout -b my-branch -t upstream/master
index.js - Barrel File exporting public exports
ComponentName.js - Component Implementation
ComponentName.test.js - Component Tests
ComponentName.docs.js - Component Docs
examples/ - dir for all examples
SimpleComp
ComponentName.md - Component Docs
```

4. Develop your component. After development is complete, ensure tests and lint standards pass.
Expand Down
55 changes: 4 additions & 51 deletions GETTING-STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,16 @@ After you have written your new PatternFly component, tests, and Storybook stori

## PatternFly React Doc

PatternFly 4 React uses Gatsby. Examples are created toe demonstrate of the use of the React components. Documents are generated from these examples.

### Adding Component Documentation

Component Documentation has two parts. a `[Component].docs.js` file, and files under `[Component]/examples/`. Each file must follow a few guidelines for them to be consumed properly by the docs website.

The `docs.js` file has the following structure

```js
import SimpleExample from './examples/SimpleComponent';
import { Component, ComponentSize } from '@patternfly/react-core'; // only @patternfly/react-* imports are allowed

export default {
title: 'Component', // Title to display at the top of the docs page
description: 'description', // Opening description for the component
components: {
Component: Component // Key value pair for components to include prop documentation
},
enumValues: {
// Optional
ComponentSize: Object.values(ComponentSize) // key value pair for any enums that cannot be statically analyzed.
},
examples: [SimpleExample] // Array of examples to include on the page. They must be stored under /examples/
};
```

An example file has the following structure

```jsx
import React from 'react';
import { Component } from '@patternfly/react-core'; // only @patternfly/react-* imports are allowed
import something from './common/something'; // any directory under examples/ is ignored in page generation.
import styles from './Example.styles.js'; // any .styles.js file under examples/ is ignored in page generation

// note: this can be a function too with the title, etc, set similar to setting Component.propTypes
class Example extends React.Component {
static title = 'Simple Example'; // Sets the examples title
static description = 'description'; // Optional: Extra description for the example
static getContainerProps = () => ({
// Optional: Adds any extra props to the container. Useful for example specific styles
style: styles
});

render() {
return <Component />;
}
}

export default Example;
```
PatternFly 4 React uses Gatsby. Examples are created to demonstrate of the use of the React components. Documents are generated from these examples.
See how to write documentation in the [`react-docs` README](./packages/patternfly-4/react-docs/README.md)

Some things to keep in mind when writing examples:

1. Keep them simple. It is much easier for a person to understand what is going on.
1. Do not do any iteration of variants, sizes, etc in the render. This is easier for the developer, but it makes it much harder to reason for the consumer.
1. Keep anything you think is useful inside this file. The source view (coming soon) will only include the source of the example. If everything is broken out it will not be useful to the consumer. Remember, you are writing examples not a super optimized application.
1. Try not to add extra external dependencies. These will only be approved on a case by case basis.
1. You are unable to use experimental language features like [class properties](https://babeljs.io/docs/en/babel-plugin-proposal-class-properties) as [Buble](https://github.com/bublejs/buble) does not support them.
1. The easiest way to develop your example is by creating an empty code block and then editing it in your browser. Once your happy, copy the code back to your Markdown file.

## Testing

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading