给定内部网站上的 .SQL 文件,有哪些选项可以动态进行漂亮的格式化?
因此,我想将这些文件放在我的本地服务器上,以供参考,并且除了我的常规 DVCS 之外,因为这将在以后变成培训材料。但我希望能够漂亮地格式化 SQL 文件。 (如果它也扩展到 C# 代码,那就太好了。)
我不确定哪些库已经做到了这一点,而且我愿意打赌有一个 Javascript 库可以完全满足我的需要。
需要发牢骚的偏好
;)
:运行 使用 ASP.NET 代码,或以 jQuery 方式。例如:给定
<代码>SELECT * FROM ...— 那么也许是这样的?$('.tsql').prettify();
我想要做的就是获取现有文件(也许我会将其内联插入代码块中,如上所述)对其应用着色,并将其显示在浏览器窗口中。我不关心为我重新格式化文件,我不关心热链接或 API 引用或任何类似的东西。
我会用谷歌搜索它,但我的 googlefu 今天很弱,而且我知道 stackoverflow 上至少有五个人知道我需要什么。
编辑:如果您觉得自己有更好的答案,请随时在下面提出建议,我相信其他人会希望看到类似的答案。
So I want to put the files up on my local server, for reference purposes and aside from my regular DVCS because this will turn into training material later. But I want to be able to pretty format the SQL file. (Would be nice if it extended to C# code as well.)
I'm not sure what libraries do this already, and I'm willing to bet there's a Javascript library out there that does EXACTLY what I need.
Needy whiny preferences
;)
: runs
with ASP.NET code, or in a jQuery fashion. eg: given<div
— then maybe something like?
class="tsql">SELECT * FROM ...</div>$('.tsql').prettify();
All I want to do is take the existing file, (maybe I'll insert it inline in a code block as indicated above) apply coloring to it, and display it in a browser window. I'm not concerned about reformatting the file for me, I'm not concerned about hotlinking or API references or any of the like.
I would google it but my googlefu is weak today, and I know there are at least five people on stackoverflow that know just what I need.
EDIT: If you feel you have a better answer, feel free to suggest it below, I'm sure others will want to see something similar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您所描述的,这似乎有 C#、SQL、OracleSQL 和简单的设置:
http://shjs.sourceforge.net/doc/documentation.html
至少谷歌首先建议它,希望 T-SQL 不会变得疯狂:)
This seems to have C#, SQL, OracleSQL and an easy setup just as you described:
http://shjs.sourceforge.net/doc/documentation.html
Well at least google suggested it as first, hopyfully it won't go crazy with T-SQL :)