Skip to content

Commit ed5bb5f

Browse files
committed
The code highlights the language.
1 parent b0bbb4c commit ed5bb5f

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

templates/default/introduce/guides/html.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,23 @@ console.log('test')
8181
</script>
8282
```
8383
<!--End-->
84+
85+
目前只预览 `HTML`, 下面为 `LESS` 展示
86+
87+
<!--DemoStart-->
88+
```less
89+
.wapper {
90+
&::after {
91+
content: '';
92+
display: block;
93+
clear: both;
94+
}
95+
}
96+
97+
.wapperContent {
98+
padding: 15px 0 0 0;
99+
max-width: 1200px;
100+
margin: 0px auto 0;
101+
}
102+
```
103+
<!--End-->

theme/default/lib/markdown/InlineCode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default class Canvas extends PureComponent {
4242
onClick={this.onClick.bind(this)}
4343
>
4444
{this.state.height === 0 ? '显示' : '隐藏'}代码
45+
{this.props.language && <div className={styles.language}>{this.props.language}</div>}
4546
</div>
4647
</div>
4748
);

theme/default/lib/markdown/InlineCode.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@
2424
line-height: 20px;
2525
background-color: rgba(0,0,0,.03);
2626
cursor: pointer;
27+
.language {
28+
float: right;
29+
text-shadow: 0 1px white;
30+
color: #b1b1b1;
31+
}
2732
}
2833
}

theme/default/lib/markdown/style/default.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ p {
5555
blockquote {
5656
margin: 0;
5757
padding: 0 1em;
58-
margin-bottom: 16px;
58+
margin: 16px 0 16px 0;
5959
color: #6a737d;
6060
border-left: 0.25em solid #dfe2e5;
6161
& >:first-child {

0 commit comments

Comments
 (0)