mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
style: remove code theme option
This commit is contained in:
parent
d42f98bcf1
commit
c5f570e391
@ -137,34 +137,14 @@ const WxRenderer = function (opts) {
|
|||||||
numbers.push('<li></li>')
|
numbers.push('<li></li>')
|
||||||
}
|
}
|
||||||
const lang = infoString || '';
|
const lang = infoString || '';
|
||||||
const codeTheme = store.state.codeTheme;
|
const codeTheme = 'github';
|
||||||
let result;
|
return `
|
||||||
|
|
||||||
switch (codeTheme) {
|
|
||||||
case 'wechat':
|
|
||||||
result = `
|
|
||||||
<section class="code-snippet__${codeTheme} code-snippet__js">
|
|
||||||
<ul class="code-snippet__line-index code-snippet__js">${numbers.join('')}</ul>
|
|
||||||
<pre class="code__pre code-snippet__js" data-lang="${lang}">
|
|
||||||
${codeLines.join('')}
|
|
||||||
</pre>
|
|
||||||
</section>
|
|
||||||
`;
|
|
||||||
break;
|
|
||||||
case 'github':
|
|
||||||
result = `
|
|
||||||
<section class="code-snippet__${codeTheme}">
|
<section class="code-snippet__${codeTheme}">
|
||||||
<pre class="code__pre" data-lang="${lang}">
|
<pre class="code__pre" data-lang="${lang}">
|
||||||
${codeLines.join('')}
|
${codeLines.join('')}
|
||||||
</pre>
|
</pre>
|
||||||
</section>
|
</section>
|
||||||
`;
|
`;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
renderer.codespan = (text, infoString) => `<code ${getStyles('codespan')}>${text}</code>`
|
renderer.codespan = (text, infoString) => `<code ${getStyles('codespan')}>${text}</code>`
|
||||||
renderer.listitem = text => `<span ${getStyles('listitem')}><span style="margin-right: 10px;"><%s/></span>${text}</span>`
|
renderer.listitem = text => `<span ${getStyles('listitem')}><span style="margin-right: 10px;"><%s/></span>${text}</span>`
|
||||||
|
@ -47,16 +47,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-select v-model="selectCodeTheme" size="mini" placeholder="选择代码块样式" clearable @change="codeThemeChanged">
|
|
||||||
<el-option v-for="theme in config.codeThemeOption" :key="theme.value"
|
|
||||||
:label="theme.label"
|
|
||||||
:value="theme.value">
|
|
||||||
<span class="select-item-left">{{ theme.label }}</span>
|
|
||||||
<span class="select-item-right">{{ theme.desc }}</span>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-tooltip content="自定义颜色" :effect="effect" placement="top">
|
<el-tooltip content="自定义颜色" :effect="effect" placement="top">
|
||||||
<el-color-picker v-model="selectColor" size="mini" show-alpha @change="colorChanged"></el-color-picker>
|
<el-color-picker v-model="selectColor" size="mini" show-alpha @change="colorChanged"></el-color-picker>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
Loading…
Reference in New Issue
Block a user