= My Document's Title Doc Writer <doc.writer@asciidoctor.org> v1.0, 2018-04-11 :toc: :imagesdir: assets/images :homepage: https://asciidoctor.org My document provides...
= 文檔標(biāo)題 (0級) = == 段落標(biāo)題 (1級) == === 段落標(biāo)題 (2級) === ==== 段落標(biāo)題 (3級) ==== ===== 段落標(biāo)題 (4級) =====
Paragraphs don’t require any special markup in AsciiDoc. A paragraph is just one or more lines of consecutive text. To begin a new paragraph, separate it by at least one blank line. Newlines within a paragraph are not displayed.
Rubies are red, + Topazes are blue. [%hardbreaks] Ruby is red. Java is black.
:hardbreaks: ...... Rubies are red, Topazes are blue.
標(biāo)簽說明 NOTE 注釋,TIP 提示,WARNING 警告,IMPORTANT 重要,CAUTION 注意。
TIP: Pro tip... IMPORTANT: Don't forget... WARNING: Watch out for... CAUTION: Ensure that...
[IMPORTANT] .Feeding the Werewolves ==== While werewolves are hardy community members, keep in mind the following dietary concerns: . They are allergic to cinnamon. . More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens. . Celery makes them sad. ====
[icons="./images/icons/wink.png"] NOTE: What lovely war.
[icons=None, caption="特殊提示"] NOTE: This is my special note.
= Document Title :icons: font ...... NOTE: Asciidoctor supports font-based admonition icons, powered by Font Awesome!
<div class="admonitionblock note"> <table> <tr> <td class="icon"> <i class="fa icon-note" title="Note"></i> </td> <td class="content"> Asciidoctor supports font-based admonition icons, powered by Font Awesome! </td> </tr> </table> </div>
<link rel="stylesheet" >
:tip-caption: [TIP] It's possible to use Unicode glyphs as admonition icons.
<td class="icon"> <div class="title"></div> </td>
icon:tags[] ruby, asciidoctor
<div class="paragraph"> <p><span class="icon"><i class="fa fa-tags"></i></span> ruby, asciidoctor</p> </div>
icon:tags[role="blue"] ruby, asciidoctor
icon:heart[2x] icon:heart[size=2x]
icon:shield[rotate=90, flip=vertical]
icon:download[link="http://rubygems.org/downloads/asciidoctor-1.5.2.gem"]
[.lead] This text will be styled as a lead paragraph (i.e., larger font).
error: The requested operation returned error: 1954 Forbidden search for defensive operations manual absolutely fatal: operation initiation lost in the dodecahedron of doom would you like to die again? y/n .... Lazarus: Where is the *defensive operations manual*? Computer: Calculating ... Can not locate object that you are not authorized to know exists. Would you like to ask another question? Lazarus: Did the werewolves tell you to say that? Computer: Calculating ... ....
注意:在輸出中,粗體文本格式?jīng)]有應(yīng)用于文本。
[literal] error: The requested operation returned error: 1954 Forbidden search for defensive operations manual absolutely fatal: operation initiation lost in the dodecahedron of doom would you like to die again? y/n
// A single-line comment.
//// CommentBlock ////
[listing] This is an example of a paragraph styled with `listing`. Notice that the monospace markup is preserved in the output.
.app.rb [source,ruby] ---- require 'sinatra' get '/hi' do "Hello World!" end
:version: 1.5.6.1 [source,xml,subs="verbatim,attributes"] ---- <dependency> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-java-integration</artifactId> <version>{version}</version> </dependency> ----
[source%nowrap,java] ---- public class ApplicationConfigurationProvider extends HttpConfigurationProvider { @Override public Configuration getConfiguration(ServletContext context) { return ConfigurationBuilder.begin() .addRule() .when(Direction.isInbound().and(Path.matches("/{path}"))) .perform(Log.message(Level.INFO, "Client requested path: {path}")) .where("path").matches(".*"); } } ----
:prewrap!:
.Gemfile.lock ---- GEM remote: https://rubygems.org/ specs: asciidoctor (1.5.6.1) PLATFORMS ruby DEPENDENCIES asciidoctor (~> 1.5.6.1) ----
[source,ruby] ---- require 'sinatra' // <1> get '/hi' do // <2> "Hello World!" // <3> end ---- <1> Library import <2> URL mapping <3> HTTP response body
---- line of code // <1> line of code # <2> line of code ;; <3> ---- <1> A callout behind a line comment for C-style languages. <2> A callout behind a line comment for Ruby, Python, Perl, etc. <3> A callout behind a line comment for Clojure.
[source,xml] ---- <section> <title>Section Title</title> <!--1--> </section> ---- <1> The section title is required.
[source,ruby] ---- include::app.rb[] ----
:sourcedir: src/main/java [source,java] ---- include::{sourcedir}/org/asciidoctor/Asciidoctor.java[] ----
[source,ruby,indent=0] ---- include::lib/document.rb[lines=5..10] ----
[source,xml] <meta name="viewport" content="width=device-width, initial-scale=1.0"> This is normal content.
:source-highlighter: pygments
.AsciiDoc history **** AsciiDoc was first released in Nov 2002 by Stuart Rackham. It was designed from the start to be a shorthand syntax for producing professional documents like DocBook and LaTeX. ****
____ QuoteBlock ____
[quote, Abraham Lincoln, Address delivered at the dedication of the Cemetery at Gettysburg] ____ Four score and seven years ago our fathers brought forth on this continent a new nation... ____ [quote, Albert Einstein] A person who never made a mistake never tried anything new. ____ A person who never made a mistake never tried anything new. ____ [quote, Charles Lutwidge Dodgson, 'Mathematician and author, also known as http://en.wikipedia.org/wiki/Lewis_Carroll[Lewis Carroll]'] ____ If you don't know where you are going, any road will get you there. ____
"I hold it that a little rebellion now and then is a good thing, and as necessary in the political world as storms in the physical." -- Thomas Jefferson, Papers of Thomas Jefferson: Volume 11
[, James Baldwin] "" Not everything that is faced can be changed. But nothing can be changed until it is faced. ""
==== ExampleBlock ====
.Sample document ==== Here's a sample AsciiDoc document: [listing] .... = Title of Document Doc Writer :toc: This guide provides... .... The document header is useful, but not required. ==== [NOTE] ==== An admonition block may contain complex content. .A list - one - two - three Another paragraph. ====
-- An open block can be an anonymous container, or it can masquerade as any other block. -- [source] -- puts "I'm a source block!" --
1. 阿拉伯?dāng)?shù)字標(biāo)注的列表項目. a. 小寫字母標(biāo)注的列表項目. F. 大寫字母標(biāo)注的列表項目. iii) 小寫羅馬數(shù)字標(biāo)注的列表項目. IX) 大寫羅馬數(shù)字標(biāo)注的列表項目.
- List item. * List item. ** List item. *** List item. **** List item. ***** List item.
Operating Systems:: Linux::: . Fedora * Desktop . Ubuntu * Desktop * Server BSD::: . FreeBSD . NetBSD Cloud Providers:: PaaS::: . OpenShift . CloudBees IaaS::: . Amazon EC2 . Rackspace
[qanda] What is Asciidoctor?:: An implementation of the AsciiDoc processor in Ruby. What is the answer to the Ultimate Question?:: 42
* [*] checked * [x] also checked * [ ] not checked * normal list item
first term:: definition of first term second term:: definition of second term
first term:: definition of first term second term:: definition of second term
[glossary] 術(shù)語1:: 解釋1. 術(shù)語2:: 解釋2.
*bold phrase* & **char**acter**s**
_italic phrase_ & __char__acter__s__
`monospace phrase` & ``char``acter``s``
You can reference the value of a document attribute using the syntax `+{name}+`, where `name` is the attribute name.
`*_monospace bold italic phrase_*` & ``**__char__**``acter``**__s__**``
Werewolves are allergic to #cassia cinnamon#.
Did the werewolves read the [.small]##small print##?
[.big]##O##nce upon an infinite loop.
We need [.line-through]#ten# make that twenty VMs.
Where did all the [.underline]#cores# run off to?
^super^script phrase
~sub~script phrase
"`double curved quotes`" '`single curved quotes`' Olaf's desk was a mess. All of the werewolves`' desks were a mess. Olaf had been with the company since the `'60s. “double curved quotes” ‘single curved quotes’ Olaf’s desk was a mess. All of the werewolves’ desks were a mess. Olaf had been with the company since the ’60s.
符號顯示說明(C)?版權(quán)(TM)?商標(biāo)(R)?注冊商標(biāo)…?...省略號->→右箭頭<-←左箭頭=>?右雙箭頭<=?左雙箭頭??數(shù)字--—破折號(只能在兩個字符之間使用)
hhhh;
= Reference Documentation Lead Developer This is documentation for project X. include::basics.adoc[] include::installation.adoc[] include::example.adoc[]
include::https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/README.adoc[]
'''
<<<
https://asciidoctor.org - automatic! https://asciidoctor.org[Asciidoctor] https://github.com/asciidoctor[Asciidoctor @ *GitHub*]
link:++https://example.org/?q=[a b]++[URL with special characters] link:https://example.org/?q=%5Ba%20b%5D[URL with special characters]
link:\\server\share\whitepaper.pdf[Whitepaper]
link:index.html[Docs]
devel@discuss.arquillian.org mailto:devel@discuss.arquillian.org[Discuss Arquillian] mailto:devel-join@discuss.arquillian.org[Subscribe, Subscribe me, I want to join!] irc://irc.freenode.org/#fedora
錨點:[[A88]] 鏈接:<<A88,chapter titles>>
image::sunset.jpg[] image::sunset.jpg[Sunset] .A mountain sunset [#img-sunset] [caption="Figure 1: ",link=https://www.flickr.com/photos/javh/5448336655] image::sunset.jpg[Sunset,300,200] image::https://asciidoctor.org/images/octocat.jpg[GitHub mascot]
Click image:icons/play.png[Play, title="Play"] to get the party started. Click image:icons/pause.png[title="Pause"] when you need a break.
image:sunset.jpg[Sunset,150,150,role="right"] What a beautiful sunset!
video::video_file.mp4[] video::video_file.mp4[width=640, start=60, end=140, options=autoplay]
Reference code like `types` or `methods` inline.
Output literal monospace text such as `+{backtick}+` by enclosing the text in pluses, then again in backticks.
= AsciiDoc Writer's Guide Doc Writer <doc.writer@asciidoctor.org> v1.0, 2013-08-01 :toc: right
_The Pragmatic Programmer_ <<pp>> should be required reading for all developers. To learn all about design patterns, refer to the book by the "`Gang of Four`" <<gof>>. [bibliography] == References - [[[pp]]] Andy Hunt & Dave Thomas. The Pragmatic Programmer: From Journeyman to Master. Addison-Wesley. 1999. - [[[gof,2]]] Erich Gamma, Richard Helm, Ralph Johnson & John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. 1994.
A statement.footnote:[Clarification about this statement.] A bold statement!footnoteref:[disclaimer,Opinions are my own.] Another bold statement.footnoteref:[disclaimer]
.Table Title |=== |Name of Column 1 |Name of Column 2 |Name of Column 3 |Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1 |Cell in column 1, row 2 |Cell in column 2, row 2 |Cell in column 3, row 2 |===
[%header,cols=2*] |=== |Name of Column 1 |Name of Column 2 |Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 1, row 2 |Cell in column 2, row 2 |===
[cols="1,1,2", options="header"] .Applications |=== |Name |Category |Description |Firefox |Browser |Mozilla Firefox is an open-source web browser. It's designed for standards compliance, performance, portability. |Arquillian |Testing |An innovative and highly extensible testing platform. Empowers developers to easily create real, automated tests. |===
[cols="2,2,5a"] |=== |Firefox |Browser |Mozilla Firefox is an open-source web browser. It's designed for: * standards compliance * performance * portability http://getfirefox.com[Get Firefox]! |===
[%header,format=csv] |=== Artist,Track,Genre Baauer,Harlem Shake,Hip Hop The Lumineers,Ho Hey,Folk Rock |===
,=== Artist,Track,Genre Baauer,Harlem Shake,Hip Hop ,===
|=== include::customers.csv[] |===
:=== Artist:Track:Genre Robyn:Indestructable:Dance :===
[cols="e,m,^,>s", width="25%"] |=== |1 >s|2 |3 |4 ^|5 2.2+^.^|6 .3+<.>m|7 ^|8 |9 2+>|10 |===
:url-home: https://asciidoctor.org :link-docs: https://asciidoctor.org/docs[documentation] :summary: Asciidoctor is a mature, plain-text document format for \ writing notes, articles, documentation, books, and more. \ It's also a text processor & toolchain for translating \ documents into various output formats (i.e., backends), \ including HTML, DocBook, PDF and ePub. :checkedbox: pass:normal[{startsb}?{endsb}] Check out {url-home}[Asciidoctor]! {summary} Be sure to read the {link-docs} too! {checkedbox} That's done!
[caption=""] .Parts{counter2:index:0} |=== |Part Id |Description |PX-{counter:index} |Description of PX-{index} |PX-{counter:index} |Description of PX-{index} |===
\*Stars* is not rendered as bold text. The asterisks around the word are preserved. \{author} is not resolved to the author name. The curly brackets around the word are preserved. `A\--Z` connects A to Z in monospace using two dashes. The dashes are not replaced by an em dash. \[[Word]] is not interpreted as an anchor. The double brackets around the word are preserved. [\[[Word]]] is not interpreted as a bibliography anchor. The triple brackets around the word are preserved. In these cases, the backslash character is automatically removed.
`+Text inside {plus} characters+` is not formatted. However, special characters like +<+ and +>+ are still escaped.
pass:[<u>underline me</u>] is also underlined.
+++<u>underline me</u>+++ is underlined.
# Document Title (Level 0) ## Section Level 1 ### Section Level 2 #### Section Level 3 ##### Section Level 4 ###### Section Level 5
```ruby require 'sinatra' get '/hi' do "Hello World!" end \``` \\ 去除第一個 \ 符號
> I hold it that a little rebellion now and then is a good thing, > and as necessary in the political world as storms in the physical. > -- Thomas Jefferson, Papers of Thomas Jefferson: Volume 11
> > What's new? > > I've got Markdown in my AsciiDoc! > > > Like what? > > * Blockquotes > * Headings > * Fenced code blocks > > > Is there more? > > Yep. AsciiDoc and Markdown share a lot of common syntax already.
--- - - - *** * * *
https://asciidoctor.org/docs/
TML 字符集
如需正確地顯示 HTML 頁面,瀏覽器必須知道使用何種字符集。
萬維網(wǎng)早期使用的字符集是 ASCII。ASCII 支持 0-9 的數(shù)字,大寫和小寫英文字母表,以及一些特殊字符。
由于很多國家使用的字符并不屬于 ASCII,現(xiàn)代瀏覽器的默認(rèn)字符集是 ISO-8859-1。
如果網(wǎng)頁使用不同于 ISO-8859-1 的字符集,就應(yīng)該在 <meta> 標(biāo)簽進行指定。
ISO 字符集
ISO 字符集是國際標(biāo)準(zhǔn)組織 (ISO) 針對不同的字母表/語言定義的標(biāo)準(zhǔn)字符集。
下面列出了世界各地使用的不同字符集:
字符集 | 描述 | 使用范圍 |
---|---|---|
ISO-8859-1 | Latin alphabet part 1 | 北美、西歐、拉丁美洲、加勒比海、加拿大、非洲 |
ISO-8859-2 | Latin alphabet part 2 | 東歐 |
ISO-8859-3 | Latin alphabet part 3 | SE Europe、世界語、其他雜項 |
ISO-8859-4 | Latin alphabet part 4 | 斯堪的納維亞/波羅的海(以及其他沒有包括在 ISO-8859-1 中的部分) |
ISO-8859-5 | Latin/Cyrillic part 5 | 使用古代斯拉夫語字母表的語言,比如保加利亞語、白俄羅斯文、俄羅斯語、馬其頓語 |
ISO-8859-6 | Latin/Arabic part 6 | 使用阿拉伯字母的語言 |
ISO-8859-7 | Latin/Greek part 7 | 現(xiàn)代希臘語,以及由希臘語衍生的數(shù)學(xué)符號 |
ISO-8859-8 | Latin/Hebrew part 8 | 使用希伯來語的語言 |
ISO-8859-9 | Latin 5 part 9 | 土耳其語。除了土耳其字符取代了冰島文字,其它與 ISO-8859-1 相同。 |
ISO-8859-10 | Latin 6 | 拉普蘭語、日耳曼語、愛斯基摩北歐語 |
ISO-8859-15 | Latin 9 (aka Latin 0) | 與 ISO 8859-1 類似,歐元符號和其他一些字符取代了一些較少使用的符號 |
ISO-2022-JP | Latin/Japanese part 1 | 日本語 |
ISO-2022-JP-2 | Latin/Japanese part 2 | 日本語 |
ISO-2022-KR | Latin/Korean part 1 | 韓語 |
Unicode 標(biāo)準(zhǔn)
由于上面列出的字符集都有容量限制,而且不兼容多語言環(huán)境,Unicode 聯(lián)盟開發(fā)了 Unicode 標(biāo)準(zhǔn)。
Unicode 標(biāo)準(zhǔn)涵蓋了世界上的所有字符、標(biāo)點和符號。
不論是何種平臺、程序或語言,Unicode 都能夠進行文本數(shù)據(jù)的處理、存儲和交換。
Unicode 聯(lián)盟
Unicode 聯(lián)盟開發(fā)了 Unicode 標(biāo)準(zhǔn)。他們的目標(biāo)是用標(biāo)準(zhǔn)的 Unicode 轉(zhuǎn)換格式 (UTF) 來取代現(xiàn)有的字符集。
Unicode 標(biāo)準(zhǔn)已經(jīng)獲得了成功,在 XML、Java、ECMAScript (JavaScript)、LDAP、CORBA 3.0、WML 中,Unicode 已經(jīng)得到了實現(xiàn)。在許多操作系統(tǒng)以及所有的現(xiàn)代瀏覽器中,Unicode 同樣得到了支持。
Unicode 聯(lián)盟與領(lǐng)導(dǎo)性的標(biāo)準(zhǔn)發(fā)展組織進行合作,比如 ISO、W3C 以及 ECMA。
Unicode 可以被不同的字符集兼容。最常用的編碼方式是 UTF-8 和 UTF-16:
字符集 | 描述 |
---|---|
UTF-8 | UTF8 中的字符可以是 1-4 個字節(jié)長。UTF-8 可以表示 Unicode 標(biāo)準(zhǔn)中的任意字符。UTF-8 向后兼容 ASCII。UTF-8 是網(wǎng)頁和電子郵件的首選編碼。 |
UTF-16 | 16 比特的 Unicode 轉(zhuǎn)換格式是一種 Unicode 可變字符編碼,能夠?qū)θ?Unicode 指令表進行編碼。UTF-16 主要被用于操作系統(tǒng)和環(huán)境中,比如微軟的 Windows 2000/XP/2003/Vista/CE 以及 Java 和 .NET 字節(jié)代碼環(huán)境。 |
提示: 最前面的 256 個 Unicode 字符集字符對應(yīng)于 256 個 ISO-8859-1 字符。
提示: 所有 HTML 4 處理器均已支持 UTF-8,而所有 XHTML 和 XML 處理器支持 UTF-8 和 UTF-16!
如您還有不明白的可以在下面與我留言或是與我探討QQ群308855039,我們一起飛!
HTML 中,正確的字符編碼是什么?
HTML5 中默認(rèn)的字符編碼是 UTF-8。
這并非總是如此。早期網(wǎng)絡(luò)的字符編碼是 ASCII 碼。
后來,從 HTML 2.0 到 HTML 4.01,ISO-8859-1 被認(rèn)定為標(biāo)準(zhǔn)。
隨著 XML 和 HTML5 的出現(xiàn),UTF-8 也終于到來了,解決了大量的字符編碼問題。
下面是關(guān)于字符編碼標(biāo)準(zhǔn)的簡短概述。
在開始的時候:ASCII
計算機信息(數(shù)字、文字、圖片)在電子中是以二進制 1 和 0(01000101)進行存儲的。
為了規(guī)范字母數(shù)字字符的存儲,創(chuàng)建了 ASCII(全稱 American Standard Code for Information Interchange)。它為每個存儲字符定義了一個獨特的二元 7 位數(shù)字,支持 0-9 數(shù)字,大/小寫英文字母(a-z、A-Z)和一些特殊的字符,比如 ! $ + - ( ) @ < > 。
由于 ASCII 使用一個字節(jié)(7 位表示字符,1 位表示傳輸奇偶控制),所以它只能表示 128 個不同的字符。這些字符中有 32 個被保留作為其他控制目的使用。
ASCII 的最大的缺點是,它排除了非英文字母。
ASCII 今天仍然在廣泛使用,尤其是在大型計算機系統(tǒng)中。
如需深入了解 ASCII,請查看完整的 ASCII 參考手冊。
在 Windows 中:ANSI
ANSI(也稱為 Windows-1252),是 Windows 95 及其之前的 Windows 系統(tǒng)中默認(rèn)的字符集。
ANSI 是 ASCII 的擴展,它加入了國際字符。它使用一個完整的字節(jié)(8 位)來表示 256 個不同字符。
自從 ANSI 成為 Windows 中默認(rèn)的字符集,所有的瀏覽器都支持 ANSI。
如需深入了解 ANSI,請查看完整的 ANSI 參考手冊。
在 HTML 4 中:ISO-8859-1
由于大多數(shù)國家使用 ASCII 以外的字符,在 HTML 2.0 標(biāo)準(zhǔn)中,默認(rèn)的字符編碼更改為 ISO-8859-1。
ISO-8859-1 是 ASCII 的擴展,它加入了國際字符。與 ANSI 一樣,它使用一個完整的字節(jié)(8 位)來表示 256 個不同字符。
如果 HTML 4 網(wǎng)頁使用了不同于 ISO-8859-1 的字符集,則需要在 <meta> 標(biāo)簽中指定,如下所示:
實例
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-8">
如需深入了解 ISO-8859-1,請查看完整的 ISO-8859-1 參考手冊。
在 HTML5 中:Unicode(UTF-8)
由于以上所列的字符集是有限的,在多語言環(huán)境中是不兼容的,所以 Unicode 聯(lián)盟(Unicode Consortium)開發(fā)了 Unicode 標(biāo)準(zhǔn)(Unicode Standard)。
Unicode 標(biāo)準(zhǔn)覆蓋了(幾乎)所有的字符、標(biāo)點符號和符號。
Unicode 使文本的處理、存儲和運輸,獨立于平臺和語言。
HTML5 中默認(rèn)的字符編碼是 UTF-8。
如您還有不明白的可以在下面與我留言或是與我探討QQ群308855039,我們一起飛!
當(dāng)瀏覽器在網(wǎng)頁中檢測到 ISO-8859-1 時,通常默認(rèn)為 ANSI,因為除了 ANSI 有 32 個額外的字符這一點,其他方面 ANSI 基本等同于 ISO-8859-1。
HTML5 中默認(rèn)的字符集是 UTF-8。
所有的 HTML 4 處理器都支持 UTF-8,所有的 HTML5 和 XML 處理器都支持 UTF-8 和 UTF-16。
*請認(rèn)真填寫需求信息,我們會在24小時內(nèi)與您取得聯(lián)系。