File tree Expand file tree Collapse file tree 4 files changed +42
-9
lines changed Expand file tree Collapse file tree 4 files changed +42
-9
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,49 @@ import './prism'
1010// markdown highlighter instance
1111const md : MarkdownIt = new MarkdownIt ( {
1212 breaks : true ,
13- // highlight: syntaxHighlight,
1413 html : true ,
1514 linkify : true ,
1615} )
1716 // add emoji: https://github.com/markdown-it/markdown-it-emoji
1817 . use ( markdownEmoji )
18+ // add syntax highlighting through prism
1919 . use ( prism , {
2020 defaultLanguage : 'js' ,
2121 } )
2222
23+ // const mdFeatures = [
24+ // 'table',
25+ // 'code',
26+ // 'fence',
27+ // 'blockquote',
28+ // 'hr',
29+ // 'list',
30+ // 'reference',
31+ // 'heading',
32+ // 'lheading',
33+ // 'html_block',
34+ // 'paragraph',
35+ // 'html_inline',
36+ // 'autolink',
37+ // 'link',
38+ // 'image',
39+ // ]
40+
41+ // TODO: markdownIt with rules disabling most features
42+ // const minimalMarkdownIt = new MarkdownIt({
43+ // breaks: false,
44+ // html: true,
45+ // linkify: false,
46+ // }).disable(mdFeatures)
47+
2348interface Props {
2449 children : string
50+ minimal ?: boolean
2551}
2652
2753const Markdown = ( props : Props ) => {
2854 let html : string
55+ // TODO: set md to minimal rule set if specified
2956 try {
3057 html = md . render ( props . children )
3158 } catch ( error ) {
Original file line number Diff line number Diff line change 11import * as React from 'react'
22import { css , jsx } from '@emotion/core'
33import Card from '../../../components/Card'
4+ import Markdown from '../../../components/Markdown'
45
56const styles = {
67 card : {
@@ -39,7 +40,7 @@ const LanguageIcon = () => (
3940const TutorialItem = ( props : Props ) => (
4041 < Card onClick = { props . onSelect } css = { styles . card } >
4142 < h3 > { props . title || 'Title' } </ h3 >
42- < p > { props . description || 'Description' } </ p >
43+ < Markdown minimal > { props . description || 'Description' } </ Markdown >
4344 < div css = { styles . languages } >
4445 < LanguageIcon />
4546 </ div >
Original file line number Diff line number Diff line change @@ -3,12 +3,15 @@ import * as G from 'typings/graphql'
33import Button from '../../components/Button'
44import Markdown from '../../components/Markdown'
55
6+ const footerHeight = 50
7+
68const styles = {
79 page : {
810 position : 'relative' as 'relative' ,
911 display : 'flex' as 'flex' ,
1012 flexDirection : 'column' as 'column' ,
1113 width : '100%' ,
14+ paddingBottom : footerHeight ,
1215 } ,
1316 summary : {
1417 padding : '0rem 1rem 1rem 1rem' ,
@@ -38,7 +41,7 @@ const styles = {
3841 flexDirection : 'row' as 'row' ,
3942 alignItems : 'center' as 'center' ,
4043 justifyContent : 'flex-end' as 'flex-end' ,
41- height : '50px' ,
44+ height : footerHeight ,
4245 padding : '1rem' ,
4346 paddingRight : '2rem' ,
4447 backgroundColor : 'black' ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const styles = {
1414 display : 'flex' as 'flex' ,
1515 flexDirection : 'column' as 'column' ,
1616 padding : 0 ,
17- paddingBottom : '36px' ,
17+ paddingBottom : 72 ,
1818 height : 'auto' ,
1919 width : '100%' ,
2020 } ,
@@ -42,18 +42,20 @@ const styles = {
4242 } ,
4343 processes : {
4444 padding : '0 1rem' ,
45- position : 'absolute' as 'absolute' ,
46- bottom : '36px' ,
45+ position : 'fixed' as 'fixed' ,
46+ bottom : 36 ,
47+ left : 0 ,
48+ right : 0 ,
4749 } ,
4850 footer : {
4951 display : 'flex' as 'flex' ,
5052 flexDirection : 'row' as 'row' ,
5153 justifyContent : 'space-between' ,
5254 alignItems : 'center' ,
53- height : '36px' ,
55+ height : 36 ,
5456 backgroundColor : 'black' ,
55- fontSize : '16px' ,
56- lineHeight : '16px' ,
57+ fontSize : 16 ,
58+ lineHeight : 16 ,
5759 padding : '10px 1rem' ,
5860 position : 'fixed' as 'fixed' ,
5961 bottom : 0 ,
You can’t perform that action at this time.
0 commit comments