FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(mdx): use mdx for docs by redallen · Pull Request #1753 · patternfly/patternfly-react · GitHub

feat(mdx): use mdx for docs - #1753

Merged
redallen merged 16 commits into
patternfly:masterfrom
redallen:feat/mdx-docs
Apr 15, 2019
Merged

feat(mdx): use mdx for docs#1753
redallen merged 16 commits into
patternfly:masterfrom
redallen:feat/mdx-docs

Conversation

redallen commented Apr 11, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

What: Use MDX for docs instead of markdown-remark with our own custom plugins.

  • .md files are now hot-reloaded
  • Anything can be imported into a .md file, like per-example CSS!
  • <pre> tags have been replaced with <div> tags (towards PF4 docs #1724 )

Additional issues: If you're a doc maintainer, now your docs are now MDX files. MDX is JSX in markdown, so you have a full-fledged React component to work with inside your MDX file. The minimum to get your examples working is this:

---
title: 'title'
cssPrefix: 'pf-c-prefix'
---
// Add imports below (need newlines before + after)...

import { Avatar } from '@patternfly/react-core';
import avatarImg from './examples/avatarImg.svg';

## Simple Avatar Example
```js
// The following imports are used to make copy-pasting examples possible. They have no effect.
import React from 'react';
import { Avatar } from '@patternfly/react-core';
import avatarImg from './examples/avatarImg.svg';

// You can have raw JSX, a function, or class rendered here using react-live
<Avatar src={avatarImg} alt="avatar"></Avatar>
```
// You can even render the component outside of the code block to appear inline in the docs!
<Avatar src={avatarImg} alt="avatar"></Avatar>

codecov-io commented Apr 12, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1753 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1753   +/-   ##
=======================================
  Coverage   82.75%   82.75%           
=======================================
  Files         601      601           
  Lines        6645     6645           
  Branches       72       72           
=======================================
  Hits         5499     5499           
  Misses       1119     1119           
  Partials       27       27
Flag Coverage Δ
#patternfly3 84.87% <ø> (ø) ⬆️
#patternfly4 79.42% <ø> (ø) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 892b68a...e847c9b. Read the comment docs.

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://1753-pr-patternfly-react-patternfly.surge.sh

jschuler mentioned this pull request Apr 12, 2019
12 tasks
redallen self-assigned this Apr 12, 2019

mcoker commented Apr 12, 2019

Copy link
Copy Markdown
Contributor

Looks good to me visually. Removing the <pre> solved a lot of typography and spacing issues. Let me know if there is something specific you'd like me to review.

Copy link
Copy Markdown
Contributor Author

That's all I wanted, verifying the <pre> changes did something. Thanks!

mcoker previously approved these changes Apr 12, 2019

mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🥇

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://1753-pr-patternfly-react-patternfly.surge.sh

Copy link
Copy Markdown
Contributor Author

@tlabaj Can you check if your recent DataList changes work in the doc preview that just deployed?

mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

redallen merged commit a03ecd0 into patternfly:master Apr 15, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL