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

Commit 8326d4f

Browse files
committed
[RCDE] Added RCDE documentation.
1 parent d5ce33c commit 8326d4f

File tree

15 files changed

+363
-2
lines changed

15 files changed

+363
-2
lines changed

.idea/copyright/Danil_Andreev.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Documentation.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ import H4API from "./pages/APIs/H4API";
6060
import H5API from "./pages/APIs/H5API";
6161
import H6API from "./pages/APIs/H6API";
6262
import HeaderAPI from "./pages/APIs/HeaderAPI";
63+
import RCDEPropAPI from "./pages/Extensions/ReactComponentsDocsExtension/APIs/PropAPI";
64+
import RCDEReactComponentApiPageAPI
65+
from "./pages/Extensions/ReactComponentsDocsExtension/APIs/ReactComponentApiPageAPI";
66+
import RCDEStyleAPI from "./pages/Extensions/ReactComponentsDocsExtension/APIs/StyleAPI";
67+
import ReactComponentApiPageDemo
68+
from "./pages/Extensions/ReactComponentsDocsExtension/Components/ReactComponentApiPageDemo";
6369

6470

6571
export default function Documentation() {
@@ -150,7 +156,14 @@ export default function Documentation() {
150156
<CreatingMaterialDocs/>
151157
</PagesGroup>
152158
<PagesGroup name={"Extensions"}>
153-
159+
<PagesGroup name={"React Components Docs Extension"}>
160+
<ReactComponentApiPageDemo />
161+
<PagesGroup name={"Component API"}>
162+
<RCDEPropAPI />
163+
<RCDEStyleAPI />
164+
<RCDEReactComponentApiPageAPI />
165+
</PagesGroup>
166+
</PagesGroup>
154167
</PagesGroup>
155168
</DocsPages>
156169
</DocsLayout>

src/components/ApiPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function ApiPage(props, ref) {
4141
const {lang} = useLang();
4242
if (!localeName) throw new Error(`Documentation: localeName is required prop`);
4343

44-
const locale = lang.locale.pages[localeName];
44+
const locale = props.locale || lang.locale.pages[localeName];
4545
const componentAPILocale = lang.locale.common.ComponentAPI;
4646

4747
const searchTags = locale.searchTags && Object.keys(locale.searchTags).map(key => locale.searchTags[key]);

src/locale/EN.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,79 @@
846846
}
847847
}
848848
},
849+
"extensionDocs": {
850+
"ReactComponentsDocsExtension": {
851+
"pages": {
852+
"ReactComponentApiPageDemo": {
853+
"searchDescription": "Demo page of ReactComponentApiPage react component.",
854+
"searchTags": {
855+
"extension": "extension",
856+
"component": "component",
857+
"api": "api",
858+
"page": "page",
859+
"preset": "preset"
860+
}
861+
862+
863+
},
864+
"RCDEPropAPI": {
865+
"searchDescription": "API documentation of the RCDE Prop component.",
866+
"searchTags": {
867+
"extension": "extension",
868+
"api": "api",
869+
"prop": "prop"
870+
},
871+
"props": {
872+
"name": "A name of the property.",
873+
"type": "The type of the property.",
874+
"def": "Default value of the property.",
875+
"children": "A description of the property."
876+
},
877+
"css": {
878+
"typeLabel": "Styles applied to the property type span wrapper.",
879+
"nameLabel": "Styles applied to the property name span wrapper.",
880+
"defaultLabel": "Styles applied to the property default value span wrapper."
881+
}
882+
},
883+
"RCDEStyleAPI": {
884+
"searchDescription": "API documentation of the RCDE Prop component.",
885+
"searchTags": {
886+
"extension": "extension",
887+
"api": "api",
888+
"css": "css",
889+
"style": "style"
890+
},
891+
"props": {
892+
"name": "Name of the CSS rule.",
893+
"global": "Global class name.",
894+
"children": "A description of the CSS rule."
895+
},
896+
"css": {
897+
"globalLabel": "Styles applied to the rule global name span wrapper.",
898+
"nameLabel": "Styles applied to the rule name span wrapper."
899+
}
900+
},
901+
"RCDEReactComponentApiPageAPI": {
902+
"searchDescription": "API documentation of the RCDE Prop component.",
903+
"searchTags": {
904+
"extension": "extension",
905+
"api": "api",
906+
"css": "css",
907+
"style": "style"
908+
},
909+
"props": {
910+
"name": "Name of the CSS rule.",
911+
"global": "Global class name.",
912+
"children": "A description of the CSS rule."
913+
},
914+
"css": {
915+
"globalLabel": "Styles applied to the rule global name span wrapper.",
916+
"nameLabel": "Styles applied to the rule name span wrapper."
917+
}
918+
}
919+
}
920+
}
921+
},
849922
"common": {
850923
"spells": {
851924
"Props": "Props",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {Prop} from "@material-docs/react-components-docs-extension";
2+
// or
3+
import Prop from "@material-docs/react-components-docs-extension/components/Prop";
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Author: Andrieiev Danil | danssg08@gmail.com | https://github.com/DanilAndreev
3+
* Copyright (C) 2020.
4+
*/
5+
6+
import React from "react";
7+
import ApiPage from "../../../../../components/ApiPage";
8+
import importCode from "./importCode.md";
9+
import H2 from "@material-docs/core/components/H2";
10+
import List from "@material-docs/core/components/List";
11+
import ListItem from "@material-docs/core/components/ListItem";
12+
import Link from "@material-docs/core/components/Link";
13+
import {useLang} from "@material-docs/core";
14+
15+
export default function RCDEPropAPI() {
16+
const {lang} = useLang();
17+
const locale = lang.locale.extensionDocs.ReactComponentsDocsExtension.pages.RCDEPropAPI;
18+
return (
19+
<ApiPage
20+
name={"RCDE Prop"}
21+
locale={locale}
22+
overrideName={"RCDE-PropAPI"}
23+
localeName={"RCDEPropAPI"}
24+
importCode={importCode}
25+
properties={[
26+
{name: "name", type: "string | any", default: "", description: locale.props.name},
27+
{name: "type", type: "string | any", default: "", description: locale.props.type},
28+
{name: "def", type: "string | any", default: "", description: locale.props.def},
29+
{name: "children", type: "node", default: "", description: locale.props.children},
30+
]}
31+
css={[
32+
{name: "typeLabel", global: "RCDE-Prop-typeLabel", description: locale.css.typeLabel},
33+
{name: "nameLabel", global: "RCDE-Prop-typeLabel", description: locale.css.nameLabel},
34+
{name: "defaultLabel", global: "RCDE-Prop-defaultLabel", description: locale.css.defaultLabel},
35+
]}
36+
>
37+
<H2>Demos</H2>
38+
<List>
39+
<ListItem><Link page={["Extensions", "React Components Docs Extension", "ReactComponentApiPage"]}>
40+
React Component Docs Extension
41+
</Link></ListItem>
42+
</List>
43+
</ApiPage>
44+
);
45+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {ReactComponentApiPage} from "@material-docs/react-components-docs-extension";
2+
// or
3+
import ReactComponentApiPage from "@material-docs/react-components-docs-extension/components/ReactComponentApiPage";
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Author: Andrieiev Danil | danssg08@gmail.com | https://github.com/DanilAndreev
3+
* Copyright (C) 2020.
4+
*/
5+
6+
import React from "react";
7+
import ApiPage from "../../../../../components/ApiPage";
8+
import importCode from "./importCode.md";
9+
import H2 from "@material-docs/core/components/H2";
10+
import List from "@material-docs/core/components/List";
11+
import ListItem from "@material-docs/core/components/ListItem";
12+
import Link from "@material-docs/core/components/Link";
13+
import {useLang} from "@material-docs/core";
14+
15+
export default function RCDEReactComponentApiPageAPI() {
16+
const {lang} = useLang();
17+
const locale = lang.locale.extensionDocs.ReactComponentsDocsExtension.pages.RCDEReactComponentApiPageAPI;
18+
return (
19+
<ApiPage
20+
name={"RCDE ReactComponentApiPage"}
21+
locale={locale}
22+
overrideName={"RCDE-ReactComponentApiPageAPI"}
23+
localeName={"ReactComponentApiPageAPI"}
24+
importCode={importCode}
25+
properties={[
26+
{name: "props", type: "RCDEProp", default: "", description: locale.props.name},
27+
{name: "css", type: "RCDEStyle", default: "", description: locale.props.global},
28+
{name: "children", type: "node", default: "", description: locale.props.children},
29+
]}
30+
enableCss={false}
31+
>
32+
<H2>Demos</H2>
33+
<List>
34+
<ListItem><Link page={["Extensions", "React Components Docs Extension", "ReactComponentApiPage"]}>
35+
React Component Docs Extension
36+
</Link></ListItem>
37+
</List>
38+
</ApiPage>
39+
);
40+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {Style} from "@material-docs/react-components-docs-extension";
2+
// or
3+
import Style from "@material-docs/react-components-docs-extension/components/Style";

0 commit comments

Comments
 (0)