图标的轻量级标记语言
轻量级标记语言对于超链接和图像非常方便。但我正在寻找一种可以帮助用户在页面上(例如在仪表板上)显示图标或表情的语言。
例如,“flag:red”将显示...红旗。 “Light:green”将显示绿色交通灯。图标可以来自图像库、Unicode 符号或者图形库。
这样的语言存在吗?
Lightweight markup languages are very convenient for hyperlinks and images. But what I am looking for is a language that would help users display icons or smileys on a page (for example on a dashboard).
For example, "flag:red" would display... a red flag. "Light:green" would display a green traffic light. The icons could come from an image library, unicode symbols, or maybe a graphic library.
Does such a language exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Github 为其标记实现了与此类似的内容。你可以写
:cake:
并得到这个(请注意,与文本的其余部分成比例):不幸的是,该实现不是开源的。不过,你的想法很有效。用您选择的语言实现一个简单的解析器,提出严格的语法和图像库,然后就可以进城了!
Github implemented something similar to this for their markup. You'd write
:cake:
and get this (in scale with the rest of the text, mind you):Unfortunately, the implementation is not open-source. However, your idea works great. Implement a simple parser in your language of choice, come up with a rigid syntax and an image library, and go to town!
您可以通过添加一些“自定义解释文本角色”来使用 reStructuredText 来完成此操作,但如果您想要的话如果选择图标,您可能最好使用自定义的“域特定语言”。不过,您的操作方式很大程度上取决于您想要使用的环境。
You could do it with reStructuredText by adding some "custom interpreted text roles" but if all you want to do it choose icons, you're probably better off with a custom "domain specific language". How you'd do it is very dependent on the environment you want to use though.