Skip to content

Commit 2fd8c54

Browse files
authored
Merge pull request #49 from ShMcK/fix/markdown
support markdown with other language/types
2 parents 9a5abd9 + ecadb7d commit 2fd8c54

File tree

8 files changed

+27
-156
lines changed

8 files changed

+27
-156
lines changed

package-lock.json

+3-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"concurrently": "^5.0.0",
4444
"dotenv": "^8.2.0",
4545
"glob": "^7.1.5",
46+
"graphql": "^14.5.8",
4647
"mocha": "^6.2.2",
4748
"prettier": "^1.18.2",
4849
"tslint": "^5.20.0",

web-app/package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@types/jest": "^24.0.21",
5656
"@types/markdown-it": "0.0.9",
5757
"@types/node": "^12.12.5",
58+
"@types/prismjs": "^1.16.0",
5859
"@types/ramda": "^0.26.33",
5960
"@types/react": "^16.9.11",
6061
"@types/react-dom": "^16.9.3",

web-app/src/components/Markdown/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import markdownEmoji from 'markdown-it-emoji'
55
import prism from 'markdown-it-prism'
66
import * as React from 'react'
77

8-
import './prism.css'
8+
// load prism styles & language support
9+
import './prism'
910

1011
// markdown highlighter instance
1112
const md: MarkdownIt = new MarkdownIt({

web-app/src/components/Markdown/prism.css

-127
This file was deleted.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Themes - more at https://prismjs.com/examples.html
2+
import 'prismjs/themes/prism-tomorrow.css'
3+
4+
// Language support
5+
import 'prismjs/components/prism-bash'
6+
import 'prismjs/components/prism-clike'
7+
import 'prismjs/components/prism-css'
8+
import 'prismjs/components/prism-git'
9+
import 'prismjs/components/prism-javascript'
10+
import 'prismjs/components/prism-json'
11+
import 'prismjs/components/prism-sql'
12+
import 'prismjs/components/prism-typescript'
13+
// TODO: import all - current list only supports js related

web-app/stories/Level.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ storiesOf('Level', module)
8484
steps: [
8585
{
8686
id: 'L1:S1',
87-
content: 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
87+
content: 'Should support markdown test\n ```shell\nnpn install some-packagen```\nwhew it works!',
8888
setup: { commits: ['a4679b1'], commands: [], files: ['package.json'] },
8989
solution: {
9090
commits: ['7c64508'],

0 commit comments

Comments
 (0)