用于自定义标记语言的 Ruby 标记解析器
我正在寻找 Ruby 标记解析器(或助手)来将自定义标记语言转换为 HTML。 像 Decoda 在 PHP 世界中所做的事情(参见 $code->addMarkup()功能)。 Ruby 世界里有什么好工具吗?
I am looking for a Ruby markup parser (or helper) to convert a custom markup language to HTML.
Something like Decoda does in the PHP world (see $code->addMarkup() function). Is there a good tool in the Ruby world?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
很高兴接受其他教育,但恐怕我不认为这样的事情存在——有人必须需要一个解析器(或者解析器生成器,也许)来用于多种未指定的未来标记语言。可能不是经常遇到的需求。或者曾经。
然而,如果您的语言相当常规,我认为使用可用的工具构建您自己的解析器不会有太多的任务。
您可以从以下地方开始:
Happy to be educated otherwise, but I'm afraid I don't think such a thing exists - someone would have had to have needed a parser (or parser-generator, perhaps) for multiple unspecified future markup languages. Probably not a need that's been experienced very often. Or ever.
However, if your language is fairly regular, I don't see that it's going to be too much more of a task to build your own parser using tools that are available.
Some places you might start:
用于纺织品的 redcloth http://redcloth.org/
用于 markdown 的 bluecloth http://deveiate.org/projects/BlueCloth
就我个人而言,我喜欢纺织品。
redcloth for textile http://redcloth.org/
bluecloth for markdown http://deveiate.org/projects/BlueCloth
personally, i like textile.