markdown使用_什么是Markdown,如何使用?

markdown使用

markdown使用

The Markdown Logo

Markdown is a simple syntax that formats text as headers, lists, boldface, and so on. This markup language is popular, and you definitely have apps that support it. Here’s a quick primer on what Markdown is, and how and where you can use it.

Markdown是一种简单的语法,将文本设置为标题,列表,粗体等。 这种标记语言很流行,并且您肯定有支持它的应用程序。 这是有关Markdown以及如何以及在何处使用它的快速入门。

降价是什么? (What is Markdown?)

When you add bold, italics, numbered lists, bullet points, headings, and so on to text, you’re “formatting” it. Markdown is a syntax—or, set of rules—that formats text on web pages.

当您在文本上添加粗体,斜体,编号列表,项目符号,标题等时,即在“设置格式”。 Markdown是一种语法或一组规则,用于格式化网页上的文本。

Traditionally, to format text on web pages, people used Hypertext Markup Language, better known as HTML. HTML is one member of the family of markup languages, along with eXtensible Markup Language (XML) and Standard Generalized Markup Language (SGML).

传统上,人们为了格式化网页上的文本,人们使用了超文本标记语言,即HTML。 HTML与可扩展标记语言(XML)和标准通用标记语言(SGML)一起,是标记语言家族的成员之一。

To format text with HTML, you put tags around the text. For example, if you want to bold text, you type “<b> this is some bold text </b>”.

要使用HTML设置文本格式,请在文本周围放置标签。 例如,如果要加粗文本,请键入“ <b>这是一些加粗文本</ b>”。

When your web browser “reads” a web page, it interprets the HTML tags and applies the relevant formatting. When it sees “<b> this is some bold text </b>”, it understands that anything between the <b> and </b> tags should appear in bold. The browser also hides the tags (<b> and </b>).

当您的网络浏览器“读取”网页时,它将解释HTML标记并应用相关的格式。 当它看到“ <b>这是一些粗体文本</ b>”时,它表示<b>和</ b>标记之间的任何内容都应以粗体显示 。 浏览器还隐藏标签(<b>和</ b>)。

HTML can be quite complex, with dozens and dozens of tags, such as <span>, <div>, <kbd>, <ol>, and lots of others. Computers have no trouble reading these because they just follow the syntax (the rules of HTML) and apply the formatting that matches the tags.

HTML可能非常复杂,带有许多标记,例如<span>,<div>,<kbd>,<ol>,以及许多其他标记 。 计算机可以轻松阅读这些内容,因为它们仅遵循语法(HTML规则)并应用与标记匹配的格式。

The tags, however, make it quite difficult for humans to read HTML and understand how the text will look after the computer renders it. It’s not very “user-friendly” for people who don’t have a lot of experience reading it.

但是,这些标签使人们很难阅读HTML并理解计算机渲染后文本的外观。 对于没有太多阅读经验的人来说,它不是很“用户友好”。

Markdown, on the other hand, is meant “to be as easy-to-read and easy-to-write as is feasible.” John Gruber and Aaron Schwartz explain why they created Markdown in 2004 and provide a guide to the syntax on Gruber’s website.

另一方面,Markdown的意思是“ 在可行的情况下尽可能易于阅读和编写 ”。 John Gruber和Aaron Schwartz解释了为什么他们在2004年创建Markdown并在Gruber网站上提供了有关语法的指南。

In short, Markdown makes it easier to format text for web pages because its tags are simpler than HTML, and they convert to HTML automatically. This means you don’t have to know HTML to write something for a web page because Markdown translates your tags into HTML for you.

简而言之,Markdown使网页文本的格式设置更加容易,因为其标记比HTML更简单,并且它们会自动转换为HTML。 这意味着您无需了解HTML就可以为网页编写内容,因为Markdown可以为您将标签转换为HTML。

It doesn’t cover all possible HTML tags, but, rather, the most common formatting options.

它没有涵盖所有可能HTML标记,而是最常见的格式设置选项。

您如何使用Markdown? (How Do You Use Markdown?)

To use Markdown, you just apply simple tags to your text. For example, to format text in italics, you put underscores around it like so: _this is some text in italics_.

要使用Markdown,只需将简单标签应用于文本即可。 例如,要设置斜体文本格式,请在其周围加上下划线,如下所示:_这是斜体文本_。

Here are some other examples of Markdown formatting from the syntax guide:

这是语法指南中Markdown格式的其他一些示例:

标头 (Headers)

# This is an H1

#这是H1

## This is an H2

##这是H2

###### This is an H6

######这是H6

项目符号点 (Bullet Points)

* Red * Green * Blue

*红色*绿色*蓝色

编号清单 (Numbered Lists)

1. Bird 2. McHale 3. Parish

1.鸟2.麦克海尔3.教区

重点 (Emphasis)

*bold* _italics_

*粗体* _斜体_

Markdown converts *bold* and _italics_ to the HTML <emphasis> tag, which, in theory, can be interpreted in many ways. For example, you could build an app that interprets the <emphasis> tag as flashing red text. In practice, however, almost every application (including every web browser) interprets it as *bold* and _italics _.

Markdown将* bold *和_italics_转换为HTML <emphasis>标记,从理论上讲,可以用多种方式对其进行解释。 例如,您可以构建一个将<emphasis>标记解释为闪烁的红色文本的应用。 但是实际上,几乎每个应用程序(包括每个Web浏览器)都将其解释为*粗体和_。

There are also variants of Markdown—such as CommonMark and GitHub Flavored Markdown (GFM)—but these are all based on the original Markdown specification. Variants usually just extend the standard by adding formatting tags the original Markdown doesn’t cover.

Markdown也有其他变体,例如CommonMarkGitHub Flavored Markdown (GFM),但它们均基于原始的Markdown规范。 变体通常只是通过添加原始Markdown无法覆盖的格式标记来扩展标准。

After you format your text, an application has to convert it to HTML, which is usually done automatically. For example, README files in GitHub use Markdown, and as long as they have a .MD file extension, GitHub automatically converts them to the correct HTML tags when they’re published.

格式化文本后,应用程序必须将其转换为HTML,这通常是自动完成的。 例如, GitHub中的 README文件使用Markdown,并且只要文件扩展名为.MD,GitHub就会在发布时自动将其转换为正确HTML标签。

So, in most cases, you won’t have to do this yourself, but if you do, there’s a Markdown tool available.

因此,在大多数情况下,您不必自己执行此操作,但是如果您这样做,则可以使用Markdown工具

您在哪里可以使用Markdown? (Where Can You Use Markdown?)

As we mentioned above, you can use Markdown on GitHub, but also on Reddit, StackOverflow, and other websites. If you’ve ever formatted text in WhatsApp messages or Slack conversations, you’ve already used it because these applications use a (very small) subset of Markdown tags to format text.

如上所述,您可以在GitHub上使用Markdown,也可以在Reddit,StackOverflow和其他网站上使用。 如果您曾经在WhatsApp消息或Slack对话中设置过文本格式 ,那么您已经使用了它,因为这些应用程序使用Markdown标签的(很小)子集来格式化文本。

If you want to learn Markdown, check out the original Markdown syntax guide or a third-party tutorial site. It’s easy to learn, and it’ll make your README files, and Reddit or StackOverflow comments easier for others to read.

如果您想学习Markdown,请查看原始的Markdown语法指南或第三方教程网站 。 它很容易学习,并且可以使您的自述文件和Reddit或StackOverflow注释更易于他人阅读。

翻译自: https://www.howtogeek.com/448323/what-is-markdown-and-how-do-you-use-it/

markdown使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值