Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

Commit 4e9d436

Browse files
committed
[Component Pages] Moved code to external md files.
1 parent 119f73e commit 4e9d436

File tree

20 files changed

+274
-314
lines changed

20 files changed

+274
-314
lines changed

src/examples/Code/code.md

Whitespace-only changes.

src/examples/Headers/AllHeaders.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import {H1, H2, H3, H4, H5, H6} from "@material-docs/core/components";
3+
4+
export default function AllHeaders() {
5+
return (
6+
<React.Fragment>
7+
<H1> I am H1 header. I am the biggest.</H1>
8+
<H2> I am H2 header. I am so pretty.</H2>
9+
<H3> I am H3 header.</H3>
10+
<H4> I am H4 header. I have no underline.</H4>
11+
<H5> I am H5 header. Also I don't create item in page navigation list.</H5>
12+
<H6> I am H6 header. I am the smallest.</H6>
13+
</React.Fragment>
14+
);
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react";
2+
import Image from "@material-docs/core/components/Image";
3+
import image from "./images/GithubBannerWide.png";
4+
5+
export default function ImagesOverview() {
6+
return (
7+
<Image src={image} alt={"overview image"} fullWidth/>
8+
);
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
import List from "@material-docs/core/components/List";
3+
import ListItem from "@material-docs/core/components/ListItem";
4+
5+
export default function DecoratedList() {
6+
return (
7+
<React.Fragment>
8+
<List>
9+
<ListItem type={"circle"}>I am list item with circle styling</ListItem>
10+
<ListItem type={"square"}>I am list item with square styling</ListItem>
11+
<ListItem type={"upper-roman"}>I am list item with upper-roman styling</ListItem>
12+
<ListItem type={"lower-alpha"}>I am list item with lower-alpha styling</ListItem>
13+
<ListItem type={"none"}>I am list item without styling</ListItem>
14+
</List>
15+
</React.Fragment>
16+
);
17+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from "react";
2+
import List from "@material-docs/core/components/List";
3+
import ListItem from "@material-docs/core/components/ListItem";
4+
import ListItemContained from "@material-docs/core/components/ListItemContained/ListItemContained";
5+
6+
export default function ListWithNestedItems() {
7+
return (
8+
<React.Fragment>
9+
<List>
10+
<ListItem>
11+
Web
12+
<ListItemContained>
13+
<ListItem>Front-end</ListItem>
14+
<ListItem>Back-end</ListItem>
15+
</ListItemContained>
16+
</ListItem>
17+
<ListItem>
18+
<ListItemContained>
19+
<ListItem>Engine programmer</ListItem>
20+
<ListItem>Level designer</ListItem>
21+
<ListItem>Character artist</ListItem>
22+
</ListItemContained>
23+
Gamedev
24+
</ListItem>
25+
<ListItem>Data science</ListItem>
26+
</List>
27+
</React.Fragment>
28+
);
29+
}

src/examples/Lists/SimpleList.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from "react";
2+
import List from "@material-docs/core/components/List";
3+
import ListItem from "@material-docs/core/components/ListItem";
4+
import {H4} from "@material-docs/core/components";
5+
6+
export default function SimpleList() {
7+
return (
8+
<React.Fragment>
9+
<H4 noTag>Buy</H4>
10+
<List>
11+
<ListItem>Carrot x3</ListItem>
12+
<ListItem>Potato 3kg</ListItem>
13+
<ListItem>Apples 1kg</ListItem>
14+
<ListItem>Strawberry 1kg</ListItem>
15+
</List>
16+
</React.Fragment>
17+
);
18+
}

src/examples/Markdown/CodeMD.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from "react";
2+
import Markdown from "@material-docs/core/components/Markdown";
3+
4+
const markdown = `
5+
\`\`\`{"type": "code", "theme": "darcula"}
6+
import React from "react";
7+
8+
function test() {
9+
console.log("I am function in code element.");
10+
return null;
11+
}
12+
\`\`\`
13+
`.trim();
14+
15+
export default function CodeMD() {
16+
return (
17+
<Markdown>
18+
{markdown}
19+
</Markdown>
20+
);
21+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react";
2+
import Markdown from "@material-docs/core/components/Markdown";
3+
4+
function HelloWorld() {
5+
return (
6+
<div>
7+
<h1>Hello darkness my old friend</h1>
8+
</div>
9+
);
10+
}
11+
12+
const markdown = `
13+
\`\`\`{"type": "demo-with-code", "theme": "darcula", "name": "DemoWithCode in markdown", "demo": "exampleFunction"}
14+
import React from "react";
15+
16+
function HelloWorld() {
17+
return (
18+
<div>
19+
<h1>Hello darkness my old friend</h1>
20+
</div>
21+
);
22+
}
23+
\`\`\`
24+
`.trim();
25+
26+
export default function DemoWithCodeMD() {
27+
return (
28+
<Markdown data={{exampleFunction: <HelloWorld/>}}>
29+
{markdown}
30+
</Markdown>
31+
);
32+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from "react";
2+
import Markdown from "@material-docs/core/components/Markdown";
3+
4+
const markdown = `
5+
\`\`\`{"type": "expansion-code", "theme": "darcula", "name": "ExpansionCode in markdown"}
6+
import React from "react";
7+
8+
function test() {
9+
console.log("I am function in expansion code element.");
10+
return null;
11+
}
12+
\`\`\`
13+
`.trim();
14+
15+
export default function ExpansionCodeMD() {
16+
return (
17+
<Markdown>
18+
{markdown}
19+
</Markdown>
20+
);
21+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
import Markdown from "@material-docs/core/components/Markdown";
3+
4+
const markdown = `
5+
# This is an overview markdown example
6+
### It generated from markdown text and rendered using Material Docs elements
7+
> You can change styling by providing theme overrides!
8+
9+
| Hello darkness my old friend | Здравствуй, ночь, моя старая подруга! |
10+
|----------------------------------|---------------------------------------|
11+
| I've come to talk with you again | Я пришел снова побеседовать с тобой |
12+
`.trim();
13+
14+
export default function MarkdownOverview() {
15+
return (
16+
<Markdown>
17+
{markdown}
18+
</Markdown>
19+
);
20+
}

0 commit comments

Comments
 (0)