Add github markdown css styles
This commit is contained in:
parent
b4c9b0d5d8
commit
3e2172ac36
7 changed files with 23 additions and 8 deletions
3
TODO.md
3
TODO.md
|
@ -1,4 +1,3 @@
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
1. Fix wrapping on code blocks
|
1. Add filtering posts by tags
|
||||||
2. Add filtering posts by tags
|
|
||||||
|
|
7
package-lock.json
generated
7
package-lock.json
generated
|
@ -5396,6 +5396,11 @@
|
||||||
"assert-plus": "^1.0.0"
|
"assert-plus": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"github-markdown-css": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-9G5CIPsHoyk5ObDsb/H4KTi23J8KE1oDd4KYU51qwqeM+lKWAiO7abpSgCkyWswgmSKBiuE7/4f8xUz7f2qAiQ=="
|
||||||
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||||
|
@ -6757,7 +6762,7 @@
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.1.1"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deep-extend": {
|
"deep-extend": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
|
"github-markdown-css": "^3.0.1",
|
||||||
"react": "^16.8.6",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^16.8.6",
|
"react-dom": "^16.8.6",
|
||||||
"react-markdown": "^4.0.8",
|
"react-markdown": "^4.0.8",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import 'github-markdown-css'
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import AboutMarkdown from '../static/about.md';
|
import AboutMarkdown from '../static/about.md';
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ class About extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const { markdown } = this.state;
|
const { markdown } = this.state;
|
||||||
return (
|
return (
|
||||||
<div className="content">
|
<div className="markdown-body">
|
||||||
<ReactMarkdown source={markdown} />
|
<ReactMarkdown source={markdown} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import 'github-markdown-css'
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { fetchPost } from '../actions';
|
import { fetchPost } from '../actions';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
@ -32,10 +33,12 @@ class Post extends React.Component {
|
||||||
<h1><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h1>
|
<h1><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h1>
|
||||||
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
||||||
<h4>Posted {post.time_published}</h4>
|
<h4>Posted {post.time_published}</h4>
|
||||||
|
<div className="markdown-body">
|
||||||
<ReactMarkdown source={post.content} />
|
<ReactMarkdown source={post.content} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import 'github-markdown-css'
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { fetchPosts } from '../actions';
|
import { fetchPosts } from '../actions';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
@ -22,10 +23,12 @@ class PostList extends React.Component {
|
||||||
<h2><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h2>
|
<h2><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h2>
|
||||||
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
||||||
<h4>Posted {post.time_published}</h4>
|
<h4>Posted {post.time_published}</h4>
|
||||||
|
<div className="markdown-body">
|
||||||
<ReactMarkdown source={post.content} />
|
<ReactMarkdown source={post.content} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}).reverse();
|
}).reverse();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import 'github-markdown-css'
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { fetchUserProfile } from '../actions';
|
import { fetchUserProfile } from '../actions';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
@ -26,10 +27,12 @@ class User extends React.Component {
|
||||||
<h2><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h2>
|
<h2><b><u><Link to={"/posts/" + post.slug}>{post.title}</Link></u></b></h2>
|
||||||
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
<h3><b>By <Link to={"/users/"+ post.author}>{post.author}</Link></b></h3>
|
||||||
<h4>Posted {post.time_published}</h4>
|
<h4>Posted {post.time_published}</h4>
|
||||||
|
<div className="markdown-body">
|
||||||
<ReactMarkdown source={post.content} />
|
<ReactMarkdown source={post.content} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue