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

白色玫瑰 程序猿

时间: 2023-07-11 阅读: 1 字数:10126

{}
markdown使用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 ...

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 <a href="https://www.w3schools.com/TAGs/">dozens and dozens of tags,</a> such as , <div>, <kbd>, , 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可能非常复杂,带有<a href="https://www.w3schools.com/TAGs/">许多标记,</a>例如,<div>,<kbd>,,以及许多其他<a href="https://www.w3schools.com/TAGs/">标记</a> 。 计算机可以轻松阅读这些内容,因为它们仅遵循语法(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 “<a href="https://daringfireball.net/projects/markdown/syntax#philosophy">to be as easy-to-read and easy-to-write as is feasible</a>.” John Gruber and Aaron Schwartz explain why they created Markdown in 2004 and provide a guide to the syntax on <a href="https://daringfireball.net/projects/markdown/">Gruber’s website</a>.

另一方面,Markdown的意思是“ <a href="https://daringfireball.net/projects/markdown/syntax#philosophy">在可行的情况下尽可能易于阅读和编写</a> ”。 John Gruber和Aaron Schwartz解释了为什么他们在2004年创建Markdown并在<a href="https://daringfireball.net/projects/markdown/">Gruber网站</a>上提供了有关语法的指南。

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 <a href="https://daringfireball.net/projects/markdown/syntax">syntax guide</a>:

这是<a href="https://daringfireball.net/projects/markdown/syntax">语法指南</a>中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
  2. 鸟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 <a href="https://commonmark.org/">CommonMark</a> and <a href="https://github.github.com/gfm/">GitHub Flavored Markdown</a> (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也有其他变体,例如<a href="https://commonmark.org/">CommonMark</a>和<a href="https://github.github.com/gfm/">GitHub</a> <a href="https://commonmark.org/">Flavored</a> <a href="https://github.github.com/gfm/">Markdown</a> (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 <a href="https://www.howtogeek.com/180167/htg-explains-what-is-github-and-what-do-geeks-use-it-for/">GitHub</a> 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,这通常是自动完成的。 例如, <a href="https://www.howtogeek.com/180167/htg-explains-what-is-github-and-what-do-geeks-use-it-for/">GitHub中的</a> README文件使用Markdown,并且只要文件扩展名为.MD,GitHub就会在发布时自动将其转换为正确HTML标签。

So, in most cases, you won’t have to do this yourself, but if you do, there’s a <a href="https://daringfireball.net/projects/markdown/">Markdown tool</a> available.

因此,在大多数情况下,您不必自己执行此操作,但是如果您这样做,则可以使用<a href="https://daringfireball.net/projects/markdown/">Markdown工具</a> 。

您在哪里可以使用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 <a href="https://www.howtogeek.com/438504/how-to-format-your-whatsapp-messages/">formatted text in WhatsApp messages</a> 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和其他网站上使用。 如果您曾经<a href="https://www.howtogeek.com/438504/how-to-format-your-whatsapp-messages/">在WhatsApp消息</a>或Slack对话中设置过<a href="https://www.howtogeek.com/438504/how-to-format-your-whatsapp-messages/">文本格式</a> ,那么您已经使用了它,因为这些应用程序使用Markdown标签的(很小)子集来格式化文本。

If you want to learn Markdown, check out the original <a href="https://daringfireball.net/projects/markdown/syntax">Markdown syntax guide</a> or a third-party <a href="https://www.markdowntutorial.com/">tutorial site</a>. It’s easy to learn, and it’ll make your README files, and Reddit or StackOverflow comments easier for others to read.

如果您想学习Markdown,请查看原始的<a href="https://daringfireball.net/projects/markdown/syntax">Markdown语法指南</a>或第三方<a href="https://www.markdowntutorial.com/">教程网站</a> 。 它很容易学习,并且可以使您的自述文件和Reddit或StackOverflow注释更易于他人阅读。

翻译自: <a href="https://www.howtogeek.com/448323/what-is-markdown-and-how-do-you-use-it/">https://www.howtogeek.com/448323/what-is-markdown-and-how-do-you-use-it/</a>

markdown使用

原文地址:https://blog.csdn.net/culintai3473/article/details/108774114?ops_request_misc=&request_id=4950579111a547a3adacde0967d66392&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~all~koosearch~default-2-108774114-null-null.142^v88^insert_down28v1,239^v2^insert_chatgpt&utm_term=markdown

本文章网址:https://www.sjxi.cn/detil/3a3fec86c1904555afa020fc5b134238

最新评论

当前未登陆哦
登陆后才可评论哦

湘ICP备2021009447号