Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1037582

Browse files
authored
Merge pull request#355 from coderoad/fix/summary-markdown
add markdown support to tutorial overview
2 parents1d38411 +da39942 commit1037582

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

‎web-app/src/components/TutorialOverview/index.tsxrenamed to‎web-app/src/containers/SelectTutorial/TutorialOverview/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import*asReactfrom'react'
22
import*asTTfrom'typings/tutorial'
33
// import moment from 'moment'
4-
importButtonfrom'../Button'
5-
importMarkdownfrom'../Markdown'
4+
importButtonfrom'../../../components/Button'
5+
importMarkdownfrom'../../../components/Markdown'
66
import{Breadcrumb}from'@alifd/next'
77

88
constfooterHeight='3rem'
@@ -88,8 +88,8 @@ const Summary = (props: Props) => {
8888
</Breadcrumb.Item>
8989
</Breadcrumb>
9090
</div>
91-
<h1css={styles.title}>{props.tutorial.summary.title}</h1>
92-
<h3>{props.tutorial.summary.description}</h3>
91+
<Markdowncss={styles.title}>{`#${props.tutorial.summary.title}`}</Markdown>
92+
<Markdown>{`###${props.tutorial.summary.description}`}</Markdown>
9393
{/* <h5 css={styles.meta}>
9494
<div css={{ marginRight: '2rem' }}>Created by {props.createdBy.name}</div>
9595
<div>Last updated {moment(props.updatedAt).format('M/YYYY')}</div>
@@ -100,9 +100,7 @@ const Summary = (props: Props) => {
100100
<h2>Content</h2>
101101
{props.tutorial.levels.map((level:TT.Level,index:number)=>(
102102
<divkey={index}>
103-
<h3>
104-
{index+1}.{level.title}
105-
</h3>
103+
<Markdown>{`###${index+1}.${level.title}`}</Markdown>
106104
<divcss={styles.levelSummary}>
107105
<Markdown>{level.summary}</Markdown>
108106
</div>

‎web-app/src/containers/SelectTutorial/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import*asTTfrom'typings/tutorial'
22
import*asReactfrom'react'
33
importSelectTutorialFormfrom'./SelectTutorialForm'
4-
importTutorialOverviewfrom'../../components/TutorialOverview'
4+
importTutorialOverviewfrom'./TutorialOverview'
55
importLoadTutorialSummaryfrom'./LoadTutorialSummary'
66
importprocessTutorialfrom'../../services/tutorial'
77

‎web-app/stories/Overview.stories.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { linkTo } from '@storybook/addon-links'
33
import{action}from'@storybook/addon-actions'
44
import{storiesOf}from'@storybook/react'
55
importReactfrom'react'
6-
importOverViewPagefrom'../src/components/TutorialOverview'
6+
importOverViewPagefrom'../src/containers/SelectTutorial/TutorialOverview'
77
importSideBarDecoratorfrom'./utils/SideBarDecorator'
88

99
storiesOf('Overview',module)
@@ -13,18 +13,21 @@ storiesOf('Overview', module)
1313
id:'1',
1414
version:'0.1.0',
1515
config:{
16+
appVersions:{
17+
vscode:'0.1.0',
18+
},
1619
testRunner:{command:''},
1720
repo:{uri:'',branch:'master'},
1821
},
1922
summary:{
2023
title:'Manage NPM package.json',
21-
description:'Learn to use the package manager at the core of JavaScript projects.',
24+
description:'Learn to use the package manager at the core of JavaScript projects',
2225
},
2326
levels:[
2427
{
2528
id:'L1',
26-
title:'The First Level',
27-
summary:'A Summary of the first level',
29+
title:'The First Level. `Markdown` supported here.',
30+
summary:'A Summary of the first level. `Markdown` supported here.',
2831
content:'',
2932
steps:[],
3033
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp