什么简单的语法可以用于富文本?

时间:2021-07-07 01:36:02

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]*[/bold] is a [tag]good[/tag] resource for programmers.

示例:[bold] * [/ bold]是程序员的[tag]良好[/ tag]资源。

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.

HTML / XML和LaTeX足够强大,但却太复杂了。 Wiki-Syntax看似简单,但每个标记使用另一个符号,引用不明确,每个Wiki似乎都有另一种语法。对于表格和类似的东西,Wiki变得非常复杂。

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?

存在符合我需要的语言/语法,或者可以稍微更改一下吗?或者我必须自己发明一些东西?在那种情况下,你有什么建议吗?

3 个解决方案

#1


3  

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.

根据您的用户群以及您所选语言提供的工具和解析器做出决定。对于我的网站,我们选择了Textile,但我发现BBCode往往是大多数人已经知道的语言。但是,这将随着不同的用户人口统计而变化。

#2


2  

*, along with several other sites, uses Markdown. I think it will give you the best balance between features and simplicity.

*与其他几个站点一起使用Markdown。我认为它将为您提供功能和简单性之间的最佳平衡。

#3


1  

Let me add ReStructuredText to the list.

让我将ReStructuredText添加到列表中。

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.

使用它的另一个好处是ReStructuredText到Anything服务的可用性,这使得创建文档的HTML或PDF版本非常容易。

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.

正如已经指出的那样,有许多轻量级标记语言(这里列出了许多语言:*文章),不需要创建自己的语言。

#1


3  

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.

根据您的用户群以及您所选语言提供的工具和解析器做出决定。对于我的网站,我们选择了Textile,但我发现BBCode往往是大多数人已经知道的语言。但是,这将随着不同的用户人口统计而变化。

#2


2  

*, along with several other sites, uses Markdown. I think it will give you the best balance between features and simplicity.

*与其他几个站点一起使用Markdown。我认为它将为您提供功能和简单性之间的最佳平衡。

#3


1  

Let me add ReStructuredText to the list.

让我将ReStructuredText添加到列表中。

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.

使用它的另一个好处是ReStructuredText到Anything服务的可用性,这使得创建文档的HTML或PDF版本非常容易。

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.

正如已经指出的那样,有许多轻量级标记语言(这里列出了许多语言:*文章),不需要创建自己的语言。