File tree Expand file tree Collapse file tree 10 files changed +38
-2
lines changed
Expand file tree Collapse file tree 10 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 88 "start" : " webpack-dev-server --mode development " ,
99 "dev" : " webpack --mode development --output ./dist/leaf.js" ,
1010 "build" : " webpack --mode production --output ./dist/leaf.js" ,
11- "docs-build" :" gitbook build docs/ dist/docs" ,
11+ "docs-build" : " gitbook build docs/ dist/docs" ,
1212 "predeploy" : " npm run build" ,
1313 "deploy" : " gh-pages -d dist"
1414 },
3434 "babel-loader" : " ^8.0.2" ,
3535 "css-loader" : " ^1.0.0" ,
3636 "docpress" : " 0.7.4" ,
37+ "file-loader" : " ^3.0.1" ,
3738 "gh-pages" : " ^2.0.1" ,
3839 "html-loader" : " ^0.5.5" ,
3940 "html-webpack-plugin" : " ^3.2.0" ,
41+ "json-loader" : " ^0.5.7" ,
4042 "mini-css-extract-plugin" : " ^0.4.2" ,
4143 "react" : " ^16.6.0" ,
4244 "react-dom" : " ^16.6.0" ,
4648 },
4749 "dependencies" : {
4850 "bootstrap" : " ^4.1.3" ,
51+ "front-matter-loader" : " ^0.2.0" ,
4952 "jquery" : " ^3.3.1" ,
53+ "markdown-loader" : " ^4.0.0" ,
54+ "react-markdown" : " ^4.0.6" ,
5055 "reactstrap" : " ^6.5.0"
5156 },
5257 "docpress" : {
Original file line number Diff line number Diff line change @@ -4,17 +4,30 @@ import { Button } from 'reactstrap';
44import Navigation from './Components/Navigation' ;
55import Main from './Components/Main' ;
66import Herocontent from './Components/Herocontent' ;
7+ import ReactMarkdown from 'react-markdown' ;
8+ import AppMarkdown from '../README.md' ;
79
810class App extends React . Component {
911 constructor ( props ) {
1012 super ( props ) ;
1113 this . state = {
12- count : 0
14+ count : 5 ,
15+ markdown : ''
1316 }
1417 this . increment = this . increment . bind ( this ) ;
1518 this . decrement = this . decrement . bind ( this ) ;
1619 }
1720
21+ componentDidMount ( ) {
22+ fetch ( '../README.md' )
23+ . then ( ( resp ) => resp . text ( ) )
24+ . then ( data => {
25+ this . setState (
26+ { markdown : data }
27+ ) ;
28+ } ) ;
29+ }
30+
1831 increment ( ) {
1932 this . setState (
2033 { count : this . state . count + 1 }
@@ -28,10 +41,12 @@ class App extends React.Component {
2841 }
2942
3043 render ( ) {
44+ const { markdown } = this . state ;
3145 return (
3246 < div >
3347 < Navigation />
3448 < Herocontent />
49+ < ReactMarkdown source = { markdown } />
3550 < Main />
3651 </ div >
3752 ) ;
Original file line number Diff line number Diff line change 11const HtmlWebPackPlugin = require ( "html-webpack-plugin" ) ;
22const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
3+
34module . exports = {
45 module : {
56 rules : [
@@ -19,6 +20,21 @@ module.exports = {
1920 }
2021 ]
2122 } ,
23+ {
24+ test : / \. m d $ / ,
25+ use : [
26+ {
27+ loader : "html-loader"
28+ } ,
29+ {
30+ loader : "markdown-loader" ,
31+ options : {
32+ pedantic : true ,
33+ renderer
34+ }
35+ }
36+ ]
37+ } ,
2238 {
2339 test : / \. c s s $ / ,
2440 use : [ MiniCssExtractPlugin . loader , "css-loader" ]
You can’t perform that action at this time.
0 commit comments