From 3037c423c30caaa21d7e07cc91688d7f01fb22ab Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 7 Jan 2021 15:09:18 +0300 Subject: feat!: deprecate ContentSection --- src/index.tsx | 82 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 42 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 63f7938..9a80262 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9,7 +9,7 @@ import { import { Benzin, Markdown, - ContentSection, + Heading, } from './lib'; import Header from './demo/Header/Header'; @@ -55,24 +55,23 @@ const CustomPage: React.FC = () => { return ( <> - -

- This should be a link to a valid markdown file. Response should give the file contents. - If you copy README file from GitHub, make sure you provide link to raw view. -

-

- -

- -
+ Render custom markdown document +

+ This should be a link to a valid markdown file. Response should give the file contents. + If you copy README file from GitHub, make sure you provide link to raw view. +

+

+ +

+ ); @@ -91,29 +90,28 @@ const LivePreviewPage: React.FC = ({ setLivePreviewData }) => { return ( <> - -

- Start typing and see your text rendered on the left window! - You can find the list of all Markdown features - {' '} - - here - - . (some of them are yet in progress). - We recommend starting with # Header. -

-

- -

-
+ Markdown live preview +

+ Start typing and see your text rendered on the left window! + You can find the list of all Markdown features + {' '} + + here + + . (some of them are yet in progress). + We recommend starting with # Header. +

+

+ +

); }; -- cgit v1.2.3 From bc288a43c90ab830019bf077d72081fade76c06e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 7 Jan 2021 15:26:02 +0300 Subject: feat: add dotfiles instead of spacevim tab --- src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 63f7938..2ebe975 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -32,7 +32,7 @@ const Icon = logo; const headerContents = { home: null, - spacevim: null, + dotfiles: null, 'material-ui': null, custom: null, 'live preview': null, @@ -40,8 +40,8 @@ const headerContents = { const pageMap: Record = { home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md', - spacevim: 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md', 'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md', + dotfiles: 'https://raw.githubusercontent.com/eug-vs/dotfiles/master/.github/README.md', }; -- cgit v1.2.3 From 53e41901558319e6063fdcbca4f6150101c57f10 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 11 Jan 2021 22:29:03 +0300 Subject: feat: allow passing variable context --- src/index.tsx | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 9a80262..3f312bb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -14,6 +14,7 @@ import { import Header from './demo/Header/Header'; import Window from './demo/Window/Window'; +import content from './demo/content.md'; import icon from './assets/icon.svg'; const useStyles = makeStyles(theme => ({ @@ -128,19 +129,6 @@ const App: React.FC = () => { const url = pageMap[page]; const fileName = url?.slice(url.lastIndexOf('/') + 1); - const info = [ - /* eslint-disable max-len */ - `## Markdown\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:`, - 'Switch between tabs on the header to explore other markdown templates. :recycle: ', - 'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:', - '## How do I use this feature?', - '```', - 'import Markdown from \'react-benzin\';', - 'const data = \'# Header\\nHello, *world!*\';', - 'ReactDOM.render(, document.getElementById(\'root\'));', - '```', - /* eslint-enable max-len */ - ].join('\n'); let primaryWindowContent = ; if (page === 'custom') primaryWindowContent = ; @@ -148,6 +136,19 @@ const App: React.FC = () => { primaryWindowContent = ; } + const tryButton = ( +

+ +

+ ); + return (
{ { (page === 'live preview') ? - : ( - <> - -

- -

- - ) + : } -- cgit v1.2.3 From fa16b78695099fe28d233edc8cb6fce67e5e2648 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 14 Jan 2021 19:51:16 +0300 Subject: refactor: rename data -> source prop --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index aa786ac..e37e7aa 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -133,7 +133,7 @@ const App: React.FC = () => { let primaryWindowContent = ; if (page === 'custom') primaryWindowContent = ; else if (page === 'live preview') { - primaryWindowContent = ; + primaryWindowContent = ; } const tryButton = ( -- cgit v1.2.3