如何使用DAV SVN模块显示语言语法着色?
当查看纯文本代码文件(即“.py”、“.c”、“.cpp”、“.m”、“.as”、“.js”等)时,是否可以拥有 DAV SVN模块渲染特定于语言的语法着色?
那真是太棒了。目前,它只是黑色的纯文本,但如果能实现这一点就太好了,这样就可以更轻松地在浏览器中阅读代码,对于那些只需要快速浏览器访问 svn 的人来说,无需在 IDE 中打开代码或像 Notepad++ 这样的精美文本编辑器。
When viewing a plain text code file (i.e. ".py", ".c", ".cpp", ".m", ".as", ".js", etc.) is it possible to have the DAV SVN module render language-specific syntax coloring?
That would be amazing. Currently it's all just black plain text, but it'd great to get this working so it's easier to read code in the browser, for those folks here that just need quick browser access to the svn, without requiring opening the code in an IDE or fancy text editor like Notepad++.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不相信 DAV SVN 会自己做这件事。它能做的最好的事情就是为文档提供正确的 Content-Type 标头。您可以对目录列表进行 XSLT 转换,但这并没有多大帮助。
如果您想要漂亮的输出,恐怕您将不得不切换到重量级的浏览程序。一种选择是 websvn + enscript。
I don't believe DAV SVN will do this itself. The best it can do is serve documents with the correct Content-Type headers. You can do XSLT transformations on the directory listings, but that doesn't help you much.
I'm afraid you're going to have to switch to a heavier-weight browsing program if you want pretty output. One option would be websvn + enscript.
如果 apache 已经在运行,请尝试 websvn 以及文件列表的颜色和更多功能。
If apache is already running try websvn with Colourisation of file listings and many more features.
对于 PHP,我通过在位置指令中添加应用程序/类型作为 php 源来实现。
For PHP i do it by adding an application/type as php source within location directive.