从 SyntaxHighlighter 中删除行号
有没有办法删除 SyntaxHighlighter 的行号?
谢谢!
Is there any way to remove the line numbers of SyntaxHighlighter?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有办法删除 SyntaxHighlighter 的行号?
谢谢!
Is there any way to remove the line numbers of SyntaxHighlighter?
Thanks!
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您可以将 SyntaxHighliter 的装订线配置设置为 false。 这将从您的代码中删除行号。
You can set the SyntaxHighliter's gutter configuration to false. This will remove the line number from your code.
点击“查看普通”链接?
看一下 SyntaxHighlighter 演示,您会发现它的右上角有一些按钮,您可以使用这些按钮可以单击将代码复制到剪贴板,查看实际的源代码(删除标记)和/或打印它。
您是否在问我们如何删除添加行号的实际功能,同时仍保留其余功能? 您要求我们为您做这件事吗?
回应评论:
如果您想保留功能,只删除行号,您将需要自己下载 javascript 文件的副本,并删除您不需要的功能。 SyntaxHighlighter 下载页面允许您下载自己的荧光笔版本,它还告诉您它是根据 LGPL 3 获得许可的,这意味着您在进行和使用修改时必须遵循这些规则。
如果您愿意,如果您陷入某个特定位置,您可以回来询问个别 Javascript 问题,但我们不是 TopCoder,也不会为您重新编写代码。
Hit the "view plain" link?
Taking a look at the SyntaxHighlighter demo you will see it has buttons in the top right corner which you can click to either copy the code to your clipboard, see the actual source code (removing markup) and or print it.
Are you asking us how to remove the actual feature that adds the line numbers while still keeping the rest of the functionality in place? Are you asking us to do this for you?
In response to comment:
If you want to keep the functionality in place, and just remove the line numbers you will need to download a copy of the javascript file for yourself and remove the features you don't want. the SyntaxHighlighter download page allows you to download your very own version of the highlighter, it also tells you that is is licensed under the LGPL 3, which means you have to follow those rules when you make and use your modifications.
If you want, you may come back and ask individual Javascript questions, if you get stuck in a particular spot, but we are not TopCoder nor will we re-write code for you.
如果您不想编辑现有标记,可以通过编辑
shCore.js
文件将其全局关闭:If you don't want to edit your existing markup, you can turn it off globally by editing the
shCore.js
file:您可以设置默认的 'gutter' => 通过编辑文件syntaxhighlighter.php,在 SyntaxHighlighter Evolved 版本 3.2.1 中更新 0。 在文件中查找此内容:
You can set the default of 'gutter' => 0 in SyntaxHighlighter Evolved version 3.2.1 by editing the file syntaxhighlighter.php. Look for this in the file: