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

Commit 370df78

Browse files
authoredSep 24, 2020
Merge pull request #8 from material-docs/prod
Material Docs Documentation v0.1.4
2 parents 6c23ee3 + 2183e75 commit 370df78

File tree

18 files changed

+212
-23
lines changed

18 files changed

+212
-23
lines changed
 

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@material-docs/material-docs-documentation",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"private": false,
55
"description": "Documentation for Material Docs. material-docs - react framework for easy creating documentation site in material design style.",
66
"homepage": "http://material-docs.com/",
@@ -30,7 +30,7 @@
3030
"license": "MIT",
3131
"dependencies": {
3232
"@craco/craco": "^5.6.4",
33-
"@material-docs/core": "^0.4.5",
33+
"@material-docs/core": "^0.4.6",
3434
"@material-docs/react-components-docs-extension": "^0.2.0",
3535
"@material-ui/core": "^4.11.0",
3636
"@material-ui/icons": "^4.9.1",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from "react";
2+
import DemoWithCode from "@material-docs/core/components/DemoWithCode";
3+
4+
function Component () {
5+
return (
6+
<div style={{padding: 30}}>
7+
I am a test component
8+
<br />
9+
<br />
10+
And I displayed in 2 DemoWithCode blocks.
11+
</div>
12+
);
13+
}
14+
15+
const code = `
16+
function Component () {
17+
return (
18+
<div style={{padding: 30}}>
19+
I am a test component
20+
<br />
21+
<br />
22+
And I displayed in 2 DemoWithCode blocks.
23+
</div>
24+
);
25+
}
26+
`.trim();
27+
28+
export default function DemoWithCodeExample() {
29+
return (
30+
<DemoWithCode
31+
name={"I am a DemoWithCode component"}
32+
theme={"darcula"}
33+
code={code}
34+
paperContainer
35+
>
36+
<Component />
37+
</DemoWithCode>
38+
);
39+
}

‎src/locale/EN.json

+35
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
"label": "English",
44
"locale": {
55
"pages": {
6+
"TablesDemo": {
7+
"searchDescription": "Demo of Table parts components.",
8+
"searchTags": {
9+
"demo": "demo",
10+
"table": "table",
11+
"row": "row",
12+
"cell": "cell",
13+
"demonstration": "demonstration"
14+
},
15+
"simpleTableHeader": "Simple Table",
16+
"simpleTableSummary": "Tables are needed to showcase a lot of structured data.",
17+
"tablesWithMarkdownHeader": "Tables with markdown",
18+
"tablesWithMarkdownSummary": "You can use the __Markdown__ component to customize tables. Don't forget to set the ```typographyInheritSize``` and ```inline``` props in the __Markdown__ component",
19+
"moreInfoHeader": "More info",
20+
"moreInfoSummary": "You can find more info about tables usage [here](https://material-ui.com/components/tables/)."
21+
},
622
"CodeDemo": {
723
"searchDescription": "Demo of Code showers components.",
824
"searchTags": {
@@ -138,6 +154,7 @@
138154
"searchDescription": "Description text, displayed in search result if page match search requirements.",
139155
"noGenerateAutoSearch": "If true, page will not generate search items from pages automatically.",
140156
"noAutoMenu": "If true, page will not participate in auto menu generation.",
157+
"order": "As lower order as higher will be displayed menu item.",
141158
"children": "Children of an element."
142159
},
143160
"css": {
@@ -165,6 +182,8 @@
165182
"noTag": "If true and name prop is defined - header with name will not generate tag for content tab.",
166183
"paperContainer": "If true - demo content will be wrapped in Paper component.",
167184
"actions": "Array of additional actions. The actions will be displayed in the dropdown menu when you click the ExpandMore icon button.",
185+
"p": "Padding of demo block in theme.spacing units.",
186+
"m": "Margin of demo block in theme.spacing units.",
168187
"children": "Children of an element. Will be placed in demo block."
169188
},
170189
"css": {
@@ -205,6 +224,7 @@
205224
"props": {
206225
"name": "Name of the group. Will be displayed on button in menu.",
207226
"getData": "Callback, provided to get group data without context usage.",
227+
"order": "As lower order as higher will be displayed menu item.",
208228
"children": "Children of an element."
209229
},
210230
"css": {}
@@ -345,6 +365,19 @@
345365
"italic": "Styles applied to the root element, provides italic text styling."
346366
}
347367
},
368+
"ItalicAPI": {
369+
"searchDescription": "Italic - react component, designed to make text italic.",
370+
"searchTags": {
371+
"locale": "locale",
372+
"lang": "lang",
373+
"api": "api"
374+
},
375+
"props": {
376+
"path": "Path to the data in the Lang.locale. Exampele: __\"hello/darkness/my\"__.",
377+
"children": "Children of the component. Will be displayed by default if can not load data from Lang."
378+
},
379+
"css": {}
380+
},
348381
"ListAPI": {
349382
"searchDescription": "List - react component, designed to show code in monospace font inside inline code block.",
350383
"searchTags": {
@@ -407,6 +440,8 @@
407440
"props": {
408441
"inline": "If true, markdown container will be inline.",
409442
"data": "Data structure, used as storage to store components or other data, which can not describe via markdown.",
443+
"typographyInheritSize": "Paragraph Typography component will inherit font settings.",
444+
"locale": "Locale path to get data from. Example: __\"where/is/my/data\"__. Path starts from _Lang.locale_.",
410445
"children": "Markdown based notation. Used to generate visual elements."
411446
},
412447
"css": {

‎src/locale/RU.json

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
"label": "Русский",
44
"locale": {
55
"pages": {
6+
"TablesDemo": {
7+
"searchDescription": "Demo of Table parts components.",
8+
"searchTags": {
9+
"demo": "demo",
10+
"table": "table",
11+
"row": "row",
12+
"cell": "cell",
13+
"demonstration": "demonstration",
14+
"table_ru": "таблицф",
15+
"demo_ru": "думо"
16+
},
17+
"simpleTableHeader": "Простая таблица",
18+
"simpleTableSummary": "Таблицы нужны для демонстрации большого количества структурированных данных.",
19+
"tablesWithMarkdownHeader": "Таблицы с markdown",
20+
"tablesWithMarkdownSummary": "Для кастомизации таблиц вы можете использовать компонент __Markdown__. Не забудьте выставить пропы ```typographyInheritSize``` и ```inline``` в компоненте __Markdown__",
21+
"moreInfoHeader": "Больше информации",
22+
"moreInfoSummary": "Вы можете узнать больше информации о настройке таблиц [тут](https://material-ui.com/components/tables/)."
23+
},
624
"CodeDemo": {
725
"searchDescription": "Демонстрация космпонентов Code showers",
826
"searchTags": {

‎src/pages/APIs/DemoWithCodeAPI/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default function DemoWithCodeAPI() {
2929
{name: "noTag", type: "boolean", default: "false", description: locale.props.noTag},
3030
{name: "paperContainer", type: "boolean", default: "false", description: locale.props.paperContainer},
3131
{name: "actions", type: "DemoCodeAction[]", default: "", description: locale.props.actions},
32+
{name: "p", type: "number", default: "0", description: locale.props.p},
33+
{name: "m", type: "number", default: "0", description: locale.props.m},
3234
{name: "children", type: "node", default: "", description: locale.props.children},
3335
]}
3436
css={[

‎src/pages/APIs/DocsPageAPI/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default function DocsPageAPI() {
2727
{name: "searchDescription", type: "string", default: "", description: locale.props.searchDescription},
2828
{name: "noGenerateAutoSearch", type: "boolean", default: "false", description: locale.props.noGenerateAutoSearch},
2929
{name: "noAutoMenu", type: "boolean", default: "false", description: locale.props.noAutoMenu},
30+
{name: "order", type: "number", default: "", description: locale.props.code},
3031
{name: "children", type: "node", default: "", description: locale.props.children},
3132
]}
3233
css={[
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {Locale} from "@material-docs/core";
2+
// or
3+
import Locale from "@material-docs/core/components/Locale";

‎src/pages/APIs/LocaleAPI/index.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Author: Andrieiev Danil | danssg08@gmail.com | https://github.com/DanilAndreev
3+
* Copyright (C) 2020.
4+
*/
5+
6+
import React from "react";
7+
8+
import {H2, List, ListItem, useLang} from "@material-docs/core";
9+
import ApiPage from "../../../components/ApiPage";
10+
import Link from "@material-docs/core/components/Link/Link";
11+
12+
import importCode from "./importCode.md";
13+
14+
export default function LocaleAPI() {
15+
const {lang} = useLang();
16+
const locale = lang.locale.pages.ListItemContainedAPI;
17+
18+
return (
19+
<ApiPage
20+
name={"Locale"}
21+
localeName={"LocaleAPI"}
22+
overrideName={"MatDoc-Locale"}
23+
importCode={importCode}
24+
properties={[
25+
{name: "path", type: "string", default: "", description: locale.props.path},
26+
{name: "children", type: "node", default: "", description: locale.props.children},
27+
]}
28+
enableCss={false}
29+
>
30+
<H2>Demos</H2>
31+
<List>
32+
<ListItem><Link page={["Components", "Lists"]}>Lists</Link></ListItem>
33+
</List>
34+
</ApiPage>
35+
);
36+
}

‎src/pages/APIs/MarkdownAPI/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export default function MarkdownAPI() {
2424
properties={[
2525
{name: "inline", type: "boolean", default: "false", description: locale.props.inline},
2626
{name: "data", type: "object", default: "{}", description: locale.props.data},
27+
{name: "typographyInheritSize", type: "boolean", default: "false", description: locale.props.typographyInheritSize},
28+
{name: "locale", type: "string", default: "", description: locale.props.locale},
2729
{name: "children", type: "node", default: "", description: locale.props.children},
2830
]}
2931
css={[

‎src/pages/APIs/PagesGroupAPI/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default function PagesGroupAPI() {
2424
properties={[
2525
{name: "name", type: "string", default: "", description: locale.props.name},
2626
{name: "getData", type: "function(data: PagesGroupData): void", default: "", description: locale.props.code},
27+
{name: "order", type: "number", default: "", description: locale.props.code},
2728
{name: "children", type: "node", default: "", description: locale.props.children},
2829
]}
2930
enableCss={false}

‎src/pages/Components/CodeDemo/index.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import ExpansionCodeExample from "../../../examples/Code/ExpansionCodeExample";
2323

2424
import {TaggingContext} from "@material-docs/core/hooks/useTags"
2525

26-
import demoWithCodeCode from "../../../examples/Code/expansionCodeExample.md";
26+
import demoWithCodeCode from "../../../examples/Code/demoWithCodeExampleCode.md";
2727
import DemoWithCodeExample from "../../../examples/Code/DemoWithCodeExpample";
2828
import H2 from "@material-docs/core/components/H2";
2929

@@ -48,6 +48,10 @@ export default function CodeDemo() {
4848
theme={"darcula"}
4949
paperContainer
5050
actions={[{label: "Source code", link: ""}]}
51+
actions={[{
52+
label: "GitHub source",
53+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/CodeExample.js"
54+
}]}
5155
>
5256
<Box p={1}>
5357
<CodeExample />
@@ -60,6 +64,10 @@ export default function CodeDemo() {
6064
theme={"darcula"}
6165
paperContainer
6266
actions={[{label: "Source code", link: ""}]}
67+
actions={[{
68+
label: "GitHub source",
69+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/ExpansionCodeExample.js"
70+
}]}
6371
>
6472
<Box p={1}>
6573
<TaggingContext.Provider value={{setTag: () => {}, removeTag: () => {}}}>
@@ -72,9 +80,11 @@ export default function CodeDemo() {
7280
<DemoWithCode
7381
code={demoWithCodeCode}
7482
theme={"darcula"}
75-
actions={[{label: "Source code", link: ""}]}
7683
paperContainer
77-
actions={[{label: "Source code", link: ""}]}
84+
actions={[{
85+
label: "GitHub source",
86+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/DemoWithCodeExpample.js"
87+
}]}
7888
>
7989
<Box p={1}>
8090
<TaggingContext.Provider value={{setTag: () => {}, removeTag: () => {}}}>

‎src/pages/Components/HeadersDemo/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export default function HeadersDemo() {
3838
theme={"darcula"}
3939
defaultExpanded
4040
name={locale.headersExample}
41+
actions={[{
42+
label: "GitHub source",
43+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Headers/AllHeaders.js"
44+
}]}
4145
>
4246
<Box p={2}>
4347
<TaggingContext.Provider value={{

‎src/pages/Components/ImagesDemo/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default function ImagesDemo() {
3333
theme={"darcula"}
3434
paperContainer
3535
defaultExpanded
36+
actions={[{
37+
label: "GitHub source",
38+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Images/ImagesOverview.js"
39+
}]}
3640
>
3741
<ImagesOverview/>
3842
</DemoWithCode>

‎src/pages/Components/ListsDemo/index.js

+29-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,17 @@ export default function ListsDemo() {
3636
can contain
3737
its content and nested list items inside ```ListItemContained``` component.
3838
</Markdown>
39-
<DemoWithCode code={simpleListCode} paperContainer theme={"darcula"} name={"Simple list"} defaultExpanded>
39+
<DemoWithCode
40+
code={simpleListCode}
41+
paperContainer
42+
theme={"darcula"}
43+
name={"Simple list"}
44+
defaultExpanded
45+
actions={[{
46+
label: "GitHub source",
47+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/SimpleList.js"
48+
}]}
49+
>
4050
<Box p={2}>
4151
<SimpleList/>
4252
</Box>
@@ -46,15 +56,30 @@ export default function ListsDemo() {
4656
You can create __nested lists__ inside ```ListItem``` component. Just place __nested items__ inside
4757
```ListItemContained``` component in ```ListItem```.
4858
</Markdown>
49-
<DemoWithCode code={listWithNestedItemsCode} paperContainer theme={"darcula"}
50-
name={"List with nested items"}>
59+
<DemoWithCode
60+
code={listWithNestedItemsCode}
61+
paperContainer theme={"darcula"}
62+
name={"List with nested items"}
63+
actions={[{
64+
label: "GitHub source",
65+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/ListWithNestedItems.js"
66+
}]}
67+
>
5168
<Box p={2}>
5269
<ListWithNestedItems/>
5370
</Box>
5471
</DemoWithCode>
5572

5673
<Markdown>Lists can be __decorated__ with several points type.</Markdown>
57-
<DemoWithCode code={decoratedListCode} paperContainer theme={"darcula"} name={"List with items decoration"}>
74+
<DemoWithCode
75+
code={decoratedListCode}
76+
paperContainer theme={"darcula"}
77+
name={"List with items decoration"}
78+
actions={[{
79+
label: "GitHub source",
80+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/DecoratedList.js"
81+
}]}
82+
>
5883
<Box p={2}>
5984
<DecoratedList/>
6085
</Box>

‎src/pages/Components/MarkdownDemo/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import codeBlockExample from "../../../examples/Markdown/CodeMD.md"
3131

3232

3333
const codeBlockExamples = {
34-
"expansion-code": {code: expansionCodeBlockExample, demo: <ExpansionCodeMD/>},
35-
"demo-with-code": {code: demoWithCodeBlockExample, demo: <DemoWithCodeMD/>},
36-
"code": {code: codeBlockExample, demo: <CodeMD/>},
34+
"expansion-code": {code: expansionCodeBlockExample, demo: <ExpansionCodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/ExpansionCodeMD.js"},
35+
"demo-with-code": {code: demoWithCodeBlockExample, demo: <DemoWithCodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/DemoWithCodeMD.js"},
36+
"code": {code: codeBlockExample, demo: <CodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/CodeMD.js"},
3737
}
3838

3939
export default function MarkdownDemo() {
@@ -56,6 +56,7 @@ export default function MarkdownDemo() {
5656
paperContainer
5757
defaultExpanded
5858
name={locale.overviewExample}
59+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/MarkdownOverview.js"}]}
5960
>
6061
<Box p={2}>
6162
<TaggingContext.Provider value={{
@@ -82,6 +83,7 @@ export default function MarkdownDemo() {
8283
code={demo.code}
8384
theme={"darcula"}
8485
paperContainer
86+
actions={[{label: "GitHub source", link: demo.page}]}
8587
>
8688
<Box p={2}>
8789
<TaggingContext.Provider value={{

0 commit comments

Comments
 (0)
This repository has been archived.