Skip to content

support markdown with other language/types #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
support markdown with other language/types
  • Loading branch information
ShMcK committed Nov 3, 2019
commit ec097e84fc961fe974ca3dc602676efaad35ff20
45 changes: 6 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/jsdom": "^12.2.4",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.5",
"@types/prismjs": "^1.16.0",
"assert": "^2.0.0",
"concurrently": "^5.0.0",
"dotenv": "^8.2.0",
Expand Down
3 changes: 2 additions & 1 deletion web-app/src/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import markdownEmoji from 'markdown-it-emoji'
import prism from 'markdown-it-prism'
import * as React from 'react'

import './prism.css'
// load prism styles & language support
import './prism'

// markdown highlighter instance
const md: MarkdownIt = new MarkdownIt({
Expand Down
127 changes: 0 additions & 127 deletions web-app/src/components/Markdown/prism.css

This file was deleted.

13 changes: 13 additions & 0 deletions web-app/src/components/Markdown/prism.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Themes - more at https://prismjs.com/examples.html
import 'prismjs/themes/prism-tomorrow.css'

// Language support
import 'prismjs/components/prism-bash'
import 'prismjs/components/prism-clike'
import 'prismjs/components/prism-css'
import 'prismjs/components/prism-git'
import 'prismjs/components/prism-javascript'
import 'prismjs/components/prism-json'
import 'prismjs/components/prism-sql'
import 'prismjs/components/prism-typescript'
// TODO: import all - current list only supports js related
2 changes: 1 addition & 1 deletion web-app/stories/Level.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ storiesOf('Level', module)
steps: [
{
id: 'L1:S1',
content: 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
content: 'Should support markdown test\n ```shell\nnpn install some-packagen```\nwhew it works!',
setup: { commits: ['a4679b1'], commands: [], files: ['package.json'] },
solution: {
commits: ['7c64508'],
Expand Down