什么简单的语法可以用于富文本?
我希望在一个具有简单文本输入的应用程序中,添加一些标记以包括格式或语义标签。 我希望语法尽可能简单,并且我想包含自定义标签。
例子: [bold]Stackoverflow[/bold] 是程序员的[tag]好[/tag]资源。
也需要桌子。
HTML/XML 和 LaTeX 足够强大,可以实现这一点,但太复杂了。 Wiki 语法看似简单,但每个标记都使用不同的符号,引用不明确,而且每个 Wiki 似乎都有不同的语法。 对于表格和类似的东西,Wiki 变得非常复杂。
是否存在符合我的需求的语言/语法,或者可以稍微改变一下? 还是我必须自己发明一些东西? 那么,您有什么建议吗?
I want in an application with a simple text input, enriched with some marks to include formatting or semantic labeling. I want the syntax as easy as possible and I want to include self-defined labels.
Example:
[bold]Stackoverflow[/bold] is a [tag]good[/tag] resource for programmers.
Tables would be needed too.
HTML/XML and LaTeX are mighty enough to allow this, but too complicated. Wiki-Syntax seems simple, but uses another symbol for each markup, has unclear quoting and every Wiki seems to have another syntax. For tables and similar stuff Wiki becomes very complicated.
Exists a language/syntax, that matches my needs or can be slightly changed to do so? Or do I have to invent something myself? In that case, do you have suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
绝对不要发明自己的。 已经有很多简单的标记语言,但用户讨厌学习新的语言。 相信我!
我建议使用以下其中一种:
根据您的用户群以及您选择的语言可用的工具和解析器做出决定。 对于我的网站,我们选择了 Textile,但我发现 BBCode 往往是大多数人已经知道的语言。 然而,这会随着不同的用户群体而变化。
Definitely do NOT invent your own. There are plenty of simple markup languages already, and users HATE learning new ones. Trust me on this!
I would suggest using one of the following:
Make your decision based on your userbase, as well as what tools and parsers are available in your chosen language. For my site, we went with Textile, but I've found that BBCode tends to be the language that most people already know. However, this will vary with different user demographics.
StackOverflow 以及其他几个网站都使用 Markdown。 我认为它将为您提供功能和简单性之间的最佳平衡。
StackOverflow, along with several other sites, uses Markdown. I think it will give you the best balance between features and simplicity.
让我将 ReStructuredText 添加到列表中。
使用它的另一个好处是 ReStructuredText to Anything 服务的可用性,该服务使得非常容易创建文档的 HTML 或 PDF 版本。
正如已经指出的,有很多轻量级标记语言(这里列出了许多轻量级标记语言:维基百科文章< /a>),不需要创建自己的。
Let me add ReStructuredText to the list.
An additional benefit of using it is given by the availability of ReStructuredText to Anything service that makes extremely easy to create HTML or PDF versions of the document.
As already pointed out there are a lot of lightweight markup languages (many are listed here: wikipedia article), there should be no need of creating your own.