Skip to content

Commit

Permalink
The code highlights the language.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 11, 2018
1 parent b0bbb4c commit ed5bb5f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
20 changes: 20 additions & 0 deletions templates/default/introduce/guides/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,23 @@ console.log('test')
</script>
```
<!--End-->

目前只预览 `HTML`, 下面为 `LESS` 展示

<!--DemoStart-->
```less
.wapper {
&::after {
content: '';
display: block;
clear: both;
}
}

.wapperContent {
padding: 15px 0 0 0;
max-width: 1200px;
margin: 0px auto 0;
}
```
<!--End-->
1 change: 1 addition & 0 deletions theme/default/lib/markdown/InlineCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class Canvas extends PureComponent {
onClick={this.onClick.bind(this)}
>
{this.state.height === 0 ? '显示' : '隐藏'}代码
{this.props.language && <div className={styles.language}>{this.props.language}</div>}
</div>
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions theme/default/lib/markdown/InlineCode.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
line-height: 20px;
background-color: rgba(0,0,0,.03);
cursor: pointer;
.language {
float: right;
text-shadow: 0 1px white;
color: #b1b1b1;
}
}
}
2 changes: 1 addition & 1 deletion theme/default/lib/markdown/style/default.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ p {
blockquote {
margin: 0;
padding: 0 1em;
margin-bottom: 16px;
margin: 16px 0 16px 0;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
& >:first-child {
Expand Down

0 comments on commit ed5bb5f

Please sign in to comment.