Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【需求】代码高亮样式自定义 #46

Closed
necolo opened this issue Sep 27, 2017 · 2 comments
Closed

【需求】代码高亮样式自定义 #46

necolo opened this issue Sep 27, 2017 · 2 comments

Comments

@necolo
Copy link

necolo commented Sep 27, 2017

希望可以让用户自定义选择代码的高亮样式。

不是很喜欢原本的代码高亮样式,在软件上找了一圈也没看到有改变代码样式的选项。于是看了一遍github的简介发现是用了highlight.js,最后我的解决方式是在每个笔记的开头加上诸如
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/monokai-sublime.min.css">
这么一行来选择我希望的代码高亮样式。

但是还是太麻烦了,每个笔记都要加入这么一段,不知是否有更方便的办法,如没有希望作者能够加上这个功能。

@tamlok
Copy link
Member

tamlok commented Sep 27, 2017

hi,目前暂时是写死的,后面会加上自定义选项。但编辑时的代码样式需要根据css手工修改一下,这样才能保持阅读和编辑模式下样式一致。下一个版本会包含该功能。

谢谢使用和反馈!

@tamlok
Copy link
Member

tamlok commented Oct 2, 2017

Hi, 已经支持自定义代码块样式了(06fc4d5)。

一种方法是在markdown菜单里面添加自定义样式,需要自己下载样式文件到指定文件夹。

一种方法是通过修改配置文件指定样式文件的URL,配置加在[global]小节里面,如template_code_block_css_url=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/monokai-sublime.min.css。配置文件可以在文件菜单里面弹出修改。

欢迎下载1.9版本更新!

谢谢反馈!

@tamlok tamlok closed this as completed Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants