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

Commit e6f03f2

Browse files
committed
[APIs] Added API for Locale and modified for Markdown.
1 parent 6c2e072 commit e6f03f2

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

src/locale/EN.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,19 @@
361361
"italic": "Styles applied to the root element, provides italic text styling."
362362
}
363363
},
364+
"ItalicAPI": {
365+
"searchDescription": "Italic - react component, designed to make text italic.",
366+
"searchTags": {
367+
"locale": "locale",
368+
"lang": "lang",
369+
"api": "api"
370+
},
371+
"props": {
372+
"path": "Path to the data in the Lang.locale. Exampele: __\"hello/darkness/my\"__.",
373+
"children": "Children of the component. Will be displayed by default if can not load data from Lang."
374+
},
375+
"css": {}
376+
},
364377
"ListAPI": {
365378
"searchDescription": "List - react component, designed to show code in monospace font inside inline code block.",
366379
"searchTags": {
@@ -423,6 +436,8 @@
423436
"props": {
424437
"inline": "If true, markdown container will be inline.",
425438
"data": "Data structure, used as storage to store components or other data, which can not describe via markdown.",
439+
"typographyInheritSize": "Paragraph Typography component will inherit font settings.",
440+
"locale": "Locale path to get data from. Example: __\"where/is/my/data\"__. Path starts from _Lang.locale_.",
426441
"children": "Markdown based notation. Used to generate visual elements."
427442
},
428443
"css": {
Lines changed: 3 additions & 0 deletions
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

Lines changed: 36 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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={[

0 commit comments

Comments
 (0)