いい感じにやった

This commit is contained in:
syuilo 2017-02-10 00:40:34 +09:00
parent 8c9ae6e8cf
commit 76e2892949
6 changed files with 53 additions and 35 deletions

View File

@ -188,6 +188,16 @@ const elements = [
}; };
}, },
// label
code => {
if (code[0] != '@') return null;
const label = code.match(/^@([a-zA-Z_-]+?)\n/)[0];
return {
html: `<span class="label">${label}</span>`,
next: label.length
};
},
// extract vars // extract vars
(code, i, source, vars) => { (code, i, source, vars) => {
const prev = source[i - 1]; const prev = source[i - 1];

View File

@ -107,46 +107,52 @@ a
* *
cursor pointer cursor pointer
pre > code pre
font-family Consolas, 'Courier New', Courier, Monaco, monospace overflow auto
tab-size 2
.comment > code
opacity 0.5 font-family Consolas, 'Courier New', Courier, Monaco, monospace
tab-size 2
.string .comment
color #e96900 opacity 0.5
.regexp .string
color #e9003f color #e96900
.keyword .regexp
color #2973b7 color #e9003f
&.true .keyword
&.false color #2973b7
&.null
&.nil &.true
&.undefined &.false
&.null
&.nil
&.undefined
color #ae81ff
.symbol
color #42b983
.number
color #ae81ff color #ae81ff
.symbol .var:not(.keyword)
color #42b983 font-weight bold
font-style italic
//text-decoration underline
.number .method
color #ae81ff font-style italic
color #8964c1
.var:not(.keyword) .property
font-weight bold color #a71d5d
font-style italic
//text-decoration underline
.method .label
font-style italic color #e9003f
color #8964c1
.property
color #a71d5d
mk-locker mk-locker
display block display block

View File

@ -91,9 +91,9 @@
font-size 1.1em font-size 1.1em
color #717171 color #717171
pre
max-height 120px
font-size 80%
</style> </style>
</mk-timeline-post-sub> </mk-timeline-post-sub>

View File

@ -233,7 +233,6 @@
pre pre
padding 16px padding 16px
overflow auto
font-size 80% font-size 80%
color #525252 color #525252
background #f8f8f8 background #f8f8f8

View File

@ -91,6 +91,10 @@
font-size 1.1em font-size 1.1em
color #717171 color #717171
pre
max-height 120px
font-size 80%
</style> </style>
<script>@post = @opts.post</script> <script>@post = @opts.post</script>
</mk-timeline-post-sub> </mk-timeline-post-sub>

View File

@ -212,7 +212,6 @@
pre pre
padding 16px padding 16px
overflow auto
font-size 80% font-size 80%
color #525252 color #525252
background #f8f8f8 background #f8f8f8