= 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...
= 文档标题 (0级) = == 段落标题 (1级) == === 段落标题 (2级) === ==== 段落标题 (3级) ==== ===== 段落标题 (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.
标签说明 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" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css/font-awesome.min.css">
: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 ... ....
注意:在输出中,粗体文本格式没有应用于文本。
[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. 阿拉伯数字标注的列表项目. a. 小写字母标注的列表项目. F. 大写字母标注的列表项目. iii) 小写罗马数字标注的列表项目. IX) 大写罗马数字标注的列表项目.
- 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] 术语1:: 解释1. 术语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)©版权(TM)™商标(R)®注册商标…...省略号->→右箭头<-←左箭头=>⇒右双箭头<=⇐左双箭头➊➊数字--—破折号(只能在两个字符之间使用)
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 页面,浏览器必须知道使用何种字符集。
万维网早期使用的字符集是 ASCII。ASCII 支持 0-9 的数字,大写和小写英文字母表,以及一些特殊字符。
由于很多国家使用的字符并不属于 ASCII,现代浏览器的默认字符集是 ISO-8859-1。
如果网页使用不同于 ISO-8859-1 的字符集,就应该在 <meta> 标签进行指定。
ISO 字符集
ISO 字符集是国际标准组织 (ISO) 针对不同的字母表/语言定义的标准字符集。
下面列出了世界各地使用的不同字符集:
字符集 | 描述 | 使用范围 |
---|---|---|
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 | 现代希腊语,以及由希腊语衍生的数学符号 |
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 标准
由于上面列出的字符集都有容量限制,而且不兼容多语言环境,Unicode 联盟开发了 Unicode 标准。
Unicode 标准涵盖了世界上的所有字符、标点和符号。
不论是何种平台、程序或语言,Unicode 都能够进行文本数据的处理、存储和交换。
Unicode 联盟
Unicode 联盟开发了 Unicode 标准。他们的目标是用标准的 Unicode 转换格式 (UTF) 来取代现有的字符集。
Unicode 标准已经获得了成功,在 XML、Java、ECMAScript (JavaScript)、LDAP、CORBA 3.0、WML 中,Unicode 已经得到了实现。在许多操作系统以及所有的现代浏览器中,Unicode 同样得到了支持。
Unicode 联盟与领导性的标准发展组织进行合作,比如 ISO、W3C 以及 ECMA。
Unicode 可以被不同的字符集兼容。最常用的编码方式是 UTF-8 和 UTF-16:
字符集 | 描述 |
---|---|
UTF-8 | UTF8 中的字符可以是 1-4 个字节长。UTF-8 可以表示 Unicode 标准中的任意字符。UTF-8 向后兼容 ASCII。UTF-8 是网页和电子邮件的首选编码。 |
UTF-16 | 16 比特的 Unicode 转换格式是一种 Unicode 可变字符编码,能够对全部 Unicode 指令表进行编码。UTF-16 主要被用于操作系统和环境中,比如微软的 Windows 2000/XP/2003/Vista/CE 以及 Java 和 .NET 字节代码环境。 |
提示: 最前面的 256 个 Unicode 字符集字符对应于 256 个 ISO-8859-1 字符。
提示: 所有 HTML 4 处理器均已支持 UTF-8,而所有 XHTML 和 XML 处理器支持 UTF-8 和 UTF-16!
如您还有不明白的可以在下面与我留言或是与我探讨QQ群308855039,我们一起飞!
HTML 中,正确的字符编码是什么?
HTML5 中默认的字符编码是 UTF-8。
这并非总是如此。早期网络的字符编码是 ASCII 码。
后来,从 HTML 2.0 到 HTML 4.01,ISO-8859-1 被认定为标准。
随着 XML 和 HTML5 的出现,UTF-8 也终于到来了,解决了大量的字符编码问题。
下面是关于字符编码标准的简短概述。
在开始的时候:ASCII
计算机信息(数字、文字、图片)在电子中是以二进制 1 和 0(01000101)进行存储的。
为了规范字母数字字符的存储,创建了 ASCII(全称 American Standard Code for Information Interchange)。它为每个存储字符定义了一个独特的二元 7 位数字,支持 0-9 数字,大/小写英文字母(a-z、A-Z)和一些特殊的字符,比如 ! $ + - ( ) @ < > 。
由于 ASCII 使用一个字节(7 位表示字符,1 位表示传输奇偶控制),所以它只能表示 128 个不同的字符。这些字符中有 32 个被保留作为其他控制目的使用。
ASCII 的最大的缺点是,它排除了非英文字母。
ASCII 今天仍然在广泛使用,尤其是在大型计算机系统中。
如需深入了解 ASCII,请查看完整的 ASCII 参考手册。
在 Windows 中:ANSI
ANSI(也称为 Windows-1252),是 Windows 95 及其之前的 Windows 系统中默认的字符集。
ANSI 是 ASCII 的扩展,它加入了国际字符。它使用一个完整的字节(8 位)来表示 256 个不同字符。
自从 ANSI 成为 Windows 中默认的字符集,所有的浏览器都支持 ANSI。
如需深入了解 ANSI,请查看完整的 ANSI 参考手册。
在 HTML 4 中:ISO-8859-1
由于大多数国家使用 ASCII 以外的字符,在 HTML 2.0 标准中,默认的字符编码更改为 ISO-8859-1。
ISO-8859-1 是 ASCII 的扩展,它加入了国际字符。与 ANSI 一样,它使用一个完整的字节(8 位)来表示 256 个不同字符。
如果 HTML 4 网页使用了不同于 ISO-8859-1 的字符集,则需要在 <meta> 标签中指定,如下所示:
实例
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-8">
如需深入了解 ISO-8859-1,请查看完整的 ISO-8859-1 参考手册。
在 HTML5 中:Unicode(UTF-8)
由于以上所列的字符集是有限的,在多语言环境中是不兼容的,所以 Unicode 联盟(Unicode Consortium)开发了 Unicode 标准(Unicode Standard)。
Unicode 标准覆盖了(几乎)所有的字符、标点符号和符号。
Unicode 使文本的处理、存储和运输,独立于平台和语言。
HTML5 中默认的字符编码是 UTF-8。
如您还有不明白的可以在下面与我留言或是与我探讨QQ群308855039,我们一起飞!
当浏览器在网页中检测到 ISO-8859-1 时,通常默认为 ANSI,因为除了 ANSI 有 32 个额外的字符这一点,其他方面 ANSI 基本等同于 ISO-8859-1。
HTML5 中默认的字符集是 UTF-8。
所有的 HTML 4 处理器都支持 UTF-8,所有的 HTML5 和 XML 处理器都支持 UTF-8 和 UTF-16。
*请认真填写需求信息,我们会在24小时内与您取得联系。