在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):emn178/markdown开源软件地址(OpenSource Url):https://github.com/emn178/markdown开源编程语言(OpenSource Language):开源软件介绍(OpenSource Introduction):MarkdownA markdown example shows how to write a markdown file. This document integrates core syntax and extensions (GMF). Block ElementsParagraphs and Line BreaksParagraphsHTML Tag: One or more blank lines. (A blank line is a line containing nothing but spaces or tabs is considered blank.) Code:
Preview: This will be inline. This is second paragraph. Line BreaksHTML Tag: End a line with two or more spaces. Code:
Preview: This will be not HeadersMarkdown supports two styles of headers, Setext and atx. SetextHTML Tags: “Underlined” using equal signs (=) as Code:
Preview: This is an H1This is an H2atxHTML Tags: Uses 1-6 hash characters (#) at the start of the line, corresponding to Code:
Preview: This is an H1This is an H2This is an H6Optionally, you may “close” atx-style headers. The closing hashes don’t need to match the number of hashes used to open the header. Code:
Preview: This is an H1This is an H2This is an H3BlockquotesHTML Tag: Markdown uses email-style > characters for blockquoting. It looks best if you hard wrap the text and put a > before every line. Code:
Preview:
Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph. Code:
Preview:
Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >. Code:
Preview:
Blockquotes can contain other Markdown elements, including headers, lists, and code blocks. Code:
Preview:
ListsMarkdown supports ordered (numbered) and unordered (bulleted) lists. UnorderedHTML Tag: Unordered lists use asterisks (*), pluses (+), and hyphens (-). Code:
Preview:
is equivalent to: Code:
and: Code:
OrderedHTML Tag: Ordered lists use numbers followed by periods: Code:
Preview:
It’s possible to trigger an ordered list by accident, by writing something like this: Code:
Preview:
You can backslash-escape (\) the period: Code:
Preview: 1986. What a great season. IndentedBlockquoteTo put a blockquote within a list item, the blockquote’s > delimiters need to be indented: Code:
Preview:
Code BlockTo put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs: Code:
Preview:
Nested ListCode:
Preview:
Code BlocksHTML Tag: Indent every line of the block by at least 4 spaces or 1 tab. Code:
Preview: This is a normal paragraph:
A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (&) and angle brackets (< and >) are automatically converted into HTML entities. Code:
Preview:
Following sections Fenced Code Blocks and Syntax Highlighting are extensions, you can use the other way to write the code block. Fenced Code BlocksJust wrap your code in Code:
Preview: Here's an example:
Syntax HighlightingIn your fenced block, add an optional language identifier and we'll run it through syntax highlighting (Support Languages). Code:
Preview: require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html Horizontal RulesHTML Tag: Code:
Preview: TableHTML Tag: It's an extension. Separates column by pipe (|) and header by dashes (-), and uses colon (:) for alignment. The outer pipes (|) and alignment are optional. There are 3 delimiters each cell at least for separating header. Code:
Preview:
Span ElementsLinksHTML Tag: Markdown supports two style of links: inline and reference. InlineInline link format like this: Title is optional. Code:
Preview: This is an example inline link. This link has no title attribute. If you’re referring to a local resource on the same server, you can use relative paths: Code:
Preview: See my About page for details. ReferenceYou could predefine link references. Format like this: Title is also optional. And the you refer the link, format like this: Code:
Preview: This is an example reference-style link. That is:
The following three link definitions are equivalent: Code:
Uses an empty set of square brackets, the link text itself is used as the name. Code:
Preview: EmphasisHTML Tags: Markdown treats asterisks (*) and underscores (_) as indicators of emphasis. One delimiter will be Code:
Preview: single asterisks single underscores double asterisks double underscores But if you surround an * or _ with spaces, it’ll be treated as a literal asterisk or underscore. You can backslash escape it: Code:
Preview: *this text is surrounded by literal asterisks* CodeHTML Tag: Wraps it with backtick quotes (`). Code:
Preview: Use the To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: Code:
Preview:
The backtick delimiters surrounding a code span may include spaces — one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: Code:
Preview: A single backtick in a code span: A backtick-delimited string in a code span: ImagesHTML Tag: Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference. InlineInline image syntax looks like this: Title is optional. Code:
Preview: That is:
ReferenceReference-style image syntax looks like this: Code:
Preview: StrikethroughHTML Tag: It's an extension. GFM adds syntax to strikethrough text. Code:
Preview:
MiscellaneousAutomatic LinksMarkdown supports a shortcut style for creating “automatic” links for URLs and email addresses: simply surround the URL or email address with angle brackets. Code:
Preview: GFM will autolink standard URLs. Code:
Preview: https://github.com/emn178/markdown Backslash EscapesMarkdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax. Code:
Preview: *literal asterisks* Markdown provides backslash escapes for the following characters: Code:
Inline HTMLFor any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags. Code:
Preview: This is a regular paragraph.
This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. Unlike block-level HTML tags, Markdown syntax is processed within span-level tags. Code:
Preview: Work
**No Work**
***
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论