有胡须模板语言的任何pygments lexer吗?
我想在论文中列出胡子模板的源代码,并且我正在使用铸造的软件包来突出显示我的乳胶源中的代码。铸造的软件包只需使用pygments。但是目前没有任何胡须的lexer。有人知道我的用例简单解决方案吗?例如,是否存在Python中实现的现有胡须Lexer并准备用于Pygments?
任何建议或想法都将不胜感激!
最好,妮可
I'd like to list source code of Mustache templates in my paper, and I'm using the minted package for highlighting code in my LaTeX source. The minted package simply uses Pygments. But there isn't any Pygments lexer for Mustache at the moment. Does anyone know an easy solution for my use case? For example, is there any existing Mustache lexer that is implemented in Python and is ready to use for Pygments?
Any suggestion or thoughts will be highly appreciated!
Best, Nicole
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用一个车把Lexer,因为车把或多或少是小胡子的超集。我说“或多或少”,因为上次我检查时,车把没有倒置选择。 lay词中的词汇似乎也不支持它们。 If your code uses them, you should be able to easily implement your own Mustache lexer by extending HandlebarsLexer and 车把barshtmllexer 。另请参见 https://pygments.org/docs/lexerdeveveloment/ 。
这是一个示例:
将导致:
There is already a Handlebars lexer which you can use, as Handlebars is more or less a superset of Mustache. I say “more or less” because, last time I checked, Handlebars did not have Inverted Selections. The lexer in Pygments does not seem to support them, either. If your code uses them, you should be able to easily implement your own Mustache lexer by extending HandlebarsLexer and HandlebarsHtmlLexer. See also https://pygments.org/docs/lexerdevelopment/.
Here is an example:
Which results in: