mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Add code theme selector
This commit is contained in:
@@ -15,6 +15,7 @@ const defaultConfig = {
|
||||
'switch-preview': 'blur',
|
||||
'disable-direct-write': false,
|
||||
'theme-ui': 'light',
|
||||
'theme-code': 'xcode',
|
||||
'theme-syntax': 'xcode'
|
||||
}
|
||||
|
||||
|
||||
78
browser/lib/hljsThemes.js
Normal file
78
browser/lib/hljsThemes.js
Normal file
@@ -0,0 +1,78 @@
|
||||
const hljsThemeList =[
|
||||
{caption: "Default", name: "default"},
|
||||
{caption: "Agate", name: "agate"},
|
||||
{caption: "Androidstudio", name: "androidstudio"},
|
||||
{caption: "Arduino Light", name: "arduino-light"},
|
||||
{caption: "Arta", name: "arta"},
|
||||
{caption: "Ascetic", name: "ascetic"},
|
||||
{caption: "Atelier Cave Dark", name: "atelier-cave-dark"},
|
||||
{caption: "Atelier Cave Light", name: "atelier-cave-light"},
|
||||
{caption: "Atelier Dune Dark", name: "atelier-dune-dark"},
|
||||
{caption: "Atelier Dune Light", name: "atelier-dune-light"},
|
||||
{caption: "Atelier Estuary Dark", name: "atelier-estuary-dark"},
|
||||
{caption: "Atelier Estuary Light", name: "atelier-estuary-light"},
|
||||
{caption: "Atelier Forest Dark", name: "atelier-forest-dark"},
|
||||
{caption: "Atelier Forest Light", name: "atelier-forest-light"},
|
||||
{caption: "Atelier Heath Dark", name: "atelier-heath-dark"},
|
||||
{caption: "Atelier Heath Light", name: "atelier-heath-light"},
|
||||
{caption: "Atelier Lakeside Dark", name: "atelier-lakeside-dark"},
|
||||
{caption: "Atelier Lakeside Light", name: "atelier-lakeside-light"},
|
||||
{caption: "Atelier Plateau Dark", name: "atelier-plateau-dark"},
|
||||
{caption: "Atelier Plateau Light", name: "atelier-plateau-light"},
|
||||
{caption: "Atelier Savanna Dark", name: "atelier-savanna-dark"},
|
||||
{caption: "Atelier Savanna Light", name: "atelier-savanna-light"},
|
||||
{caption: "Atelier Seaside Dark", name: "atelier-seaside-dark"},
|
||||
{caption: "Atelier Seaside Light", name: "atelier-seaside-light"},
|
||||
{caption: "Atelier Sulphurpool Dark", name: "atelier-sulphurpool-dark"},
|
||||
{caption: "Atelier Sulphurpool Light", name: "atelier-sulphurpool-light"},
|
||||
{caption: "Brown Paper", name: "brown-paper"},
|
||||
{caption: "Codepen Embed", name: "codepen-embed"},
|
||||
{caption: "Color Brewer", name: "color-brewer"},
|
||||
{caption: "Dark", name: "dark"},
|
||||
{caption: "Darkula", name: "darkula"},
|
||||
{caption: "Docco", name: "docco"},
|
||||
{caption: "Dracula", name: "dracula"},
|
||||
{caption: "Far", name: "far"},
|
||||
{caption: "Foundation", name: "foundation"},
|
||||
{caption: "Github Gist", name: "github-gist"},
|
||||
{caption: "Github", name: "github"},
|
||||
{caption: "Googlecode", name: "googlecode"},
|
||||
{caption: "Grayscale", name: "grayscale"},
|
||||
{caption: "Gruvbox Dark", name: "gruvbox.dark"},
|
||||
{caption: "Gruvbox Light", name: "gruvbox.light"},
|
||||
{caption: "Hopscotch", name: "hopscotch"},
|
||||
{caption: "Hybrid", name: "hybrid"},
|
||||
{caption: "Idea", name: "idea"},
|
||||
{caption: "Ir Black", name: "ir-black"},
|
||||
{caption: "Kimbie Dark", name: "kimbie.dark"},
|
||||
{caption: "Kimbie Light", name: "kimbie.light"},
|
||||
{caption: "Magula", name: "magula"},
|
||||
{caption: "Mono Blue", name: "mono-blue"},
|
||||
{caption: "Monokai Sublime", name: "monokai-sublime"},
|
||||
{caption: "Monokai", name: "monokai"},
|
||||
{caption: "Obsidian", name: "obsidian"},
|
||||
{caption: "Paraiso Dark", name: "paraiso-dark"},
|
||||
{caption: "Paraiso Light", name: "paraiso-light"},
|
||||
{caption: "Pojoaque", name: "pojoaque"},
|
||||
{caption: "Qtcreator Dark", name: "qtcreator_dark"},
|
||||
{caption: "Qtcreator Light", name: "qtcreator_light"},
|
||||
{caption: "Railscasts", name: "railscasts"},
|
||||
{caption: "Rainbow", name: "rainbow"},
|
||||
{caption: "School Book", name: "school-book"},
|
||||
{caption: "Solarized Dark", name: "solarized-dark"},
|
||||
{caption: "Solarized Light", name: "solarized-light"},
|
||||
{caption: "Sunburst", name: "sunburst"},
|
||||
{caption: "Tomorrow Night Blue", name: "tomorrow-night-blue"},
|
||||
{caption: "Tomorrow Night Bright", name: "tomorrow-night-bright"},
|
||||
{caption: "Tomorrow Night Eighties", name: "tomorrow-night-eighties"},
|
||||
{caption: "Tomorrow Night", name: "tomorrow-night"},
|
||||
{caption: "Tomorrow", name: "tomorrow"},
|
||||
{caption: "Vs", name: "vs"},
|
||||
{caption: "Xcode", name: "xcode"},
|
||||
{caption: "Xt 256", name: "xt256"},
|
||||
{caption: "Zenburn", name: "zenburn"}
|
||||
]
|
||||
|
||||
export default function hljsTheme() {
|
||||
return hljsThemeList
|
||||
}
|
||||
@@ -11,10 +11,14 @@ var md = markdownit({
|
||||
highlight: function (str, lang) {
|
||||
if (lang && hljs.getLanguage(lang)) {
|
||||
try {
|
||||
return hljs.highlight(lang, str).value
|
||||
return '<pre class="hljs"><code>' +
|
||||
hljs.highlight(lang, str).value +
|
||||
'</code></pre>';
|
||||
} catch (e) {}
|
||||
}
|
||||
return str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"')
|
||||
return '<pre class="hljs"><code>' +
|
||||
str.replace(/\&/g, '&').replace(/\</g, '<').replace(/\>/g, '>').replace(/\"/g, '"') +
|
||||
'</code></pre>';
|
||||
}
|
||||
})
|
||||
md.use(emoji, {
|
||||
|
||||
Reference in New Issue
Block a user