有人能够或至少尝试过将 Liquid 模板语言移植到 C# 吗?

发布于 2024-08-20 15:35:54 字数 308 浏览 18 评论 0原文

我需要让最终用户能够安全地编辑 ASP.NET MVC Web 应用程序模板,到目前为止,Liquid 模板语言似乎很完美,但它是用 Ruby 编写的,移植对我来说似乎是一项过于复杂的任务,因为我不这样做不知道 Ruby...有人尝试将其移植到 C# 吗?这在很多情况下都非常有用,我将积极提供所需的帮助!

更新:我还发现了 Javascript 版本,这应该足以简化移植工作。

I need to give end-users the ability to securely edit an asp.net mvc web application templates and so far Liquid Template Language seems to be perfect, but it is written in Ruby and porting it seems a too complex task for me as I don't know Ruby... anyone tried to port it to C#? It would be really useful in a lot of situations and I'm going to actively help for what is needed!

Update: I also found out a Javascript version, this should ease the porting enough.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪菊怪哟 2024-08-27 15:35:54

您是指 DotLiquid 吗?它是 Ruby 的 Liquid 模板语言的 .NET 4.0 端口。模板语法本身与 Liquid 相同,但 .NET 代码尽可能利用 .NET / C# 约定。它显然是开源的,与最初的 Liquid 项目相同。

披露:我编写了 DotLiquid(无论如何,我从 Ruby 进行了 C# 移植)。与原始海报一样,我也希望能够从 .NET 代码访问 Liquid 模板语法。我希望它对其他人有用。 Liquid 的 Ruby 源代码非常干净,并且包含一整套单元测试,因此移植非常简单。如果您确实发现任何错误,请

Do you mean DotLiquid? It's a .NET 4.0 port of the Liquid template language for Ruby. The template syntax itself is the same as Liquid, but the .NET code takes advantage of .NET / C# conventions as much as possible. It's obviously open source, same as the original Liquid project.

Disclosure: I wrote DotLiquid (well, I did the C# port from Ruby, anyway). Like the original poster, I also wanted to have access to Liquid template syntax from .NET code. I'm hoping it's useful for other people. Liquid's Ruby source code is very clean, and included a full suite of unit tests, so it made porting quite straightforward. If you do find any bugs, please

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文