Skip to content

Commit

Permalink
[docs] Fix ROADMAP page issues (mui#8008)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Sep 1, 2017
1 parent b7604e9 commit 585783e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
3 changes: 1 addition & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ That conversation could start on one of the following [issues](https://github.co

### How do I know if a component still needs to be migrated `v1-beta`?

We have [Github project](https://github.com/callemall/material-ui/projects/1) to **coordinate** the work toward the `v1-beta` release.
You can check the *Component to migrate* column to know the ones needing to be migrated to `v1-beta`.
We have [some open issues](https://github.com/callemall/material-ui/issues?q=is%3Aopen+is%3Aissue+label%3ARefactoring+label%3Av1) to **coordinate** the work toward the `v1.0.0` release.

### How do I start migrating components to the `v1-beta` branch?

Expand Down
30 changes: 18 additions & 12 deletions docs/src/modules/components/MarkdownDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,25 @@ const demoRegexp = /^demo='(.*)'$/;
const SOURCE_CODE_ROOT_URL = 'https://github.com/callemall/material-ui/tree/v1-beta';

function MarkdownDocs(props, context) {
const { classes, demos, markdown } = props;
const { classes, demos, markdown, sourceLocation: sourceLocationProp } = props;
const contents = getContents(markdown);
const components = getComponents(markdown);

let sourceLocation = context.activePage.pathname;
// Hack for handling the nested demos
if (sourceLocation.indexOf('/demos') === 0) {
const token = sourceLocation.split('/');
token.push(token[token.length - 1]);
sourceLocation = token.join('/');
}
let sourceLocation = sourceLocationProp || context.activePage.pathname;

if (!sourceLocationProp) {
// Hack for handling the nested demos
if (sourceLocation.indexOf('/demos') === 0) {
const token = sourceLocation.split('/');
token.push(token[token.length - 1]);
sourceLocation = token.join('/');
}

if (sourceLocation.indexOf('/api') === 0) {
sourceLocation = `/pages/${sourceLocation}.md`;
} else {
sourceLocation = `/docs/src/pages${sourceLocation}.md`;
if (sourceLocation.indexOf('/api') === 0) {
sourceLocation = `/pages/${sourceLocation}.md`;
} else {
sourceLocation = `/docs/src/pages${sourceLocation}.md`;
}
}

return (
Expand Down Expand Up @@ -85,6 +88,9 @@ MarkdownDocs.propTypes = {
classes: PropTypes.object.isRequired,
demos: PropTypes.object,
markdown: PropTypes.string.isRequired,
// You can define the direction location of the markdown file.
// Otherwise, we try to determine it with an heuristic.
sourceLocation: PropTypes.string,
};

MarkdownDocs.contextTypes = {
Expand Down
2 changes: 1 addition & 1 deletion pages/discover-more/roadmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from '../../ROADMAP.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
return <MarkdownDocs markdown={markdown} sourceLocation="/ROADMAP.md" />;
}

export default withRoot(Page);

0 comments on commit 585783e

Please sign in to comment.