-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
代码行号 #113
Comments
可以通过 JS 实现,我试了下这个:https://github.com/JS-Zheng/code-line 效果: 但它可能改变原有代码样式,有的代码块首尾会有多余空行等 ,我觉得不完美,目前没加到模板里。 |
可以~这个挺好。 |
使用 到prism.js官网https://prismjs.com/download.html进行定制,在页面底部预览,我选了代码高亮、line number、toolbar、copy to clipboard等功能。 Change the style in /css/syntax.css .highlight pre code * {
white-space: pre !important; // this sets all children inside to nowrap
} _include/header.md的head标签中加入css _include/footer.md中的body标签中加入js 并调用 jquery <script type="text/javascript">
$('pre').addClass("line-numbers").css("white-space", "pre-wrap");
</script> 参考: |
请问有办法让代码块显示行号吗?如果没有这个功能作者是否考虑加一下呢。
The text was updated successfully, but these errors were encountered: