如果您经常使用在线社交网络或论坛,那么您很可能已经看到或使用过Markdown,甚至不知道Markdown是什么。
对于已经在网络上的许多人来说,HTML是他们学习的第一种也是最基本的编码语言。然而,Markdown更简单。事实上,它是如此简单,以至于它的课程并不完全存在。您可以在几分钟内学会它。
在本文中,让我们回顾一下Markdown的基础知识以及您应该了解的有关 Web 上最流行和轻量级标记语言之一的所有信息。
什么是降价?(What Is Markdown?)
顾名思义,Markdown是对“标记”一词的演绎。” 标记(” Markup)被定义为“为准备打印而更正文本的过程或结果”,这是对编程语言如何与解释器和渲染引擎交互以向我们这些浏览互联网的人显示文本的准确描述。
HTML 代表“超文本标记(Markup)语言”,因此Markdown是一种更容易编写HTML代码的方式,尽管方式不太健壮。
Markdown由John Gruber和Aaron Swartz于 2004 年创建,他们希望允许人们“使用易于阅读和易于编写的纯文本格式进行编写,可选择将其转换为结构上有效的XHTML(或HTML)”。
Markdown的核心目标之一是与其替代方案相比更易于阅读。这使得编写Markdown和阅读纯文本Markdown代码变得非常简单。
哪些网站使用 Markdown?(What Sites Use Markdown?)
由于Markdown只是一种更简单的HTML编写方式,因此您不会看到网站自称是“用Markdown编写的”。但是,您会发现许多网站允许用户以接受Markdown的方式投稿或发帖。
一个例子是GitHub。在每个GitHub(GitHub)存储库的预先生成的README.md文件中,都接受Markdown。正如这所暗示的,MD 是用于使用Markdown代码编写的文件的扩展名。
Reddit和Stack Exchange还利用Markdown作为用户更好地组织帖子和表达自己的一种方式。如果没有Markdown(Markdown)将纯文本转换为可读的、格式化的代码片段, Stack Overflow等Stack Exchange 网站(Stack Exchange sites)就不一样了。
如何使用降价
上面的示例图像显示了用于创建新Reddit文本帖子的Markdown格式示例。(Markdown)虽然它确实涵盖了Markdown的基础知识,但并未包含一些常见示例。让我们来看看那些。
标头
在Markdown中,您可以通过在文本前输入(Markdown)#(数字/井号)来创建标题。您使用的数字/磅符号的数量将按比例缩小标题的级别。例如,#将是最大的标题,而###将显示较小的副标题。
在HTML中,这些只是简单地转换为标签。#是 <h1>,###是 <h3>。
图片
与链接类似,Markdown中的图像是通过将 alt 文本括在方括号中和将URL括在括号中来创建的。这是一个例子:
[求助台极客标志]( https://helpdeskgeek.com/wp-content/themes/hdg/images/hdg-banner.png )
内联代码
以四个空格开头的行将创建一个代码块,但对于内联代码,您可以简单地将文本包装在反引号中。这是一个例子:
*int main(){printf (“Hi World”);返回 0;}*
Markdown 文本编辑器
如果您对掌握Markdown感兴趣,那么以桌面文本编辑器的形式寻求支持是一个很好的开始。但是,由于Markdown可以在浏览器中实时呈现,并且不需要任何复杂的服务器端交互,因此甚至还有在线Markdown编辑器。
独立的 Markdown 编辑器
适用于Windows(Windows)、macOS 和Linux的最好的独立Markdown编辑器(以及整体的文本编辑器)之一是Sublime Text。
要启用Markdown语法高亮,您只需加载 MD 文件或通过单击状态栏右侧的纯文本将语法高亮设置为(Plain Text)Markdown 。
另外两个很棒的免费 Markdown 编辑器(free Markdown editors)是Typora (Mac) 和Remarkable (Linux)。
基于 Web 的 Markdown 编辑器
基于 Web 的Markdown编辑器通常功能更丰富,因此我们强烈推荐这些。
例如,StackEdit提供了一个带有两个窗格的无干扰界面:一个用于您的Markdown代码,另一个用于动态实时预览您的文本。
如果您是StackEdit的新手,您所要做的就是单击Start Writing,您将被带到其基于 Web 的编辑器,该编辑器预先填充了示例Markdown代码和说明。
如果StackEdit没有您要查找的内容,请查看Dillinger或Editor.md。
Markdown在网络上无处不在,如果您是互联网新手,那么它可能是您学习使用的第一个非官方“编码语言”。它非常有用,并增强了我们通过文本进行在线交流的方式,因此我们希望本文能帮助您了解更多有关它的信息!
HDG Explains: What Is Markdown And What Are The Basics I Should Know?
If you regularly use online social networks or discussion forums, chances are that you’ve seen or used Markdown without еven knowіng what Markdown iѕ.
For many already on the web, HTML was the first and most elementary coding language they learned. However, Markdown is even simpler. In fact, it’s so simple that courses for it don’t exactly exist. You can learn it in a matter of just minutes.
In this article, let’s go over the basics of what Markdown is and everything you should know about one of the web’s most popular and lightweight markup languages.
What Is Markdown?
As a name, Markdown is a play on the term “markup.” Markup is defined as “the process or result of correcting text in preparation for printing” which is an accurate description of how programming languages interact with interpreters and rendering engines to display text for those of us browsing the internet.
HTML stands for “Hypertext Markup Language,” and Markdown is therefore a way of more easily writing HTML code, although in a less robust way.
Markdown was created in 2004 by John Gruber and Aaron Swartz, who wanted to allow people “to write using an easy-to-read and easy-to-write plain text format, optionally convert it to structurally valid XHTML (or HTML).”
One of the core goals of Markdown was to allow for easier readability when compared to its alternatives. This makes writing Markdown and reading plain text Markdown code very simple.
What Sites Use Markdown?
Since Markdown is just a simpler way of writing HTML, you won’t see websites crediting themselves as being “written in Markdown”. However, you will find many websites that allow users to contribute or post in ways that accept Markdown.
One example is GitHub. In the pre-generated README.md file of each GitHub repository, Markdown is accepted. As this suggests, MD is the extension used for files that are written using Markdown code.
Reddit and Stack Exchange also utilize Markdown as a way for their users to better organize posts and express themselves. Stack Exchange sites such as Stack Overflow would not be the same without Markdown to convert plain text to readable, formatted code snippets.
How To Use Markdown
The example image above shows Markdown formatting examples for creating a new Reddit text post. While it does go over the basics of Markdown, some common examples have not been included. Let’s go over those.
Headers
In Markdown, you can create a header by typing # (number/pound sign) before your text. The number of number/pound signs that you use will scale down the level of the header. For example, # will be the largest heading and ### will show a smaller subheading.
In HTML, these are simply converted to <h> tags. # is <h1> and ### is <h3>, for example.
Images
Similar to links, images in Markdown are created by wrapping the alt text in square brackets and the URL in parenthesis. Here’s an example:
[Help Desk Geek Logo](https://helpdeskgeek.com/wp-content/themes/hdg/images/hdg-banner.png)
Inline code
Starting a line with four spaces will create a code block, but for inline code, you can simply wrap text in backticks. Here’s an example:
`int main(){printf (“Hi World\n”);return 0;}`
Markdown Text Editors
If you’re interested in mastering Markdown, finding support in the form of a desktop text editor is a great start. However, since Markdown can be rendered live in the browser and doesn’t require any complicated server-side interaction, there are even online Markdown editors.
Standalone Markdown Editors
One of the best standalone Markdown editors (and text editors overall) for Windows, macOS, and Linux is Sublime Text.
All you have to do to enable Markdown syntax highlighting is load an MD file or set the syntax highlighting to Markdown by clicking on Plain Text on the right side of the status bar.
Two other great free Markdown editors are Typora (Mac) and Remarkable (Linux).
Web-based Markdown Editors
Web-based Markdown editors are generally more feature-rich, so we strongly recommend those.
For example, StackEdit provides a distraction-free interface with two panes: one for your Markdown code and another for a dynamic, live preview of your text.
If you’re new to StackEdit, all you have to do is click on Start Writing and you’ll be taken to its web-based editor, which comes pre-populated with example Markdown code and instructions.
If StackEdit doesn’t have what you’re looking for, check out Dillinger or Editor.md.
Markdown is everywhere around the web, and if you’re new to the internet then it will probably be the first unofficial “coding language” you learn to use. It’s extremely useful and enhances the way we communicate online through text, so we hope this article has helped you learn more about it!