整合營銷服務(wù)商

          電腦端+手機端+微信端=數(shù)據(jù)同步管理

          免費咨詢熱線:

          AsciiDoc 的相關(guān)整理

          . AsciiDoc 簡介

          • AsciiDoc 是一種文本文檔格式(輕量級的標(biāo)記語言),用于編寫注釋、文檔、文章、書籍、電子書、幻燈片、網(wǎng)頁、手冊頁和博客。
          • AsciiDoc 文件可以翻譯成多種格式,包括 HTML、PDF、EPUB、手冊頁面等。
          • AsciiDoc 是高度可配置的,用戶可以定制和擴展 AsciiDoc 源文件語法和后端輸出標(biāo)記(幾乎可以是任何類型的 SGML/XML 標(biāo)記)。
          • AsciiDoc 是免費軟件,并根據(jù) GNU 通用公共許可證版本 2(GPLV2)的條款進行許可。

          1.1 語法

          1.1.1 文檔頭

          • 可以包含文檔頭、作者、修訂行、自定義屬性等。
          • 頭部可選但是必須在文檔的頂部。
          = 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...
          

          1.1.2 標(biāo)題

          • 需要靠左側(cè)頂格。
          • 可以包含文檔頭、第 1 ~ 第 5 章節(jié)標(biāo)題。
          • 當(dāng)使用項目文檔類型(默認(rèn)值)時,只能有一個 0 級的節(jié)標(biāo)題(即,文檔標(biāo)題),并且它必須位于文檔頭中。
          • 等號的數(shù)目與 HTML 輸出中的標(biāo)題級別相匹配。
          • 例如,(=)轉(zhuǎn)換成為 <h2> 標(biāo)簽。
          = 文檔標(biāo)題 (0級) =
          == 段落標(biāo)題 (1級) ==
          === 段落標(biāo)題 (2級) ===
          ==== 段落標(biāo)題 (3級) ====
          ===== 段落標(biāo)題 (4級) =====
          

          1.1.3 段落

          • 段落不需要任何特殊的標(biāo)記,段落只需要是連續(xù)文本的一行或多行。
          • 開始新的段落需要用一個空行進行分隔。
          • 文檔中的大部分內(nèi)容是段落文本,因此 AsciiDoc 不需要任何特殊的標(biāo)記或?qū)傩詠碇付ǘ温鋬?nèi)容。
          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.
          

          1.1.3.1 換行

          • 在 AsciiDoc 中,相鄰或連續(xù)的文本行形成段落元素。若要在另一個元素(如節(jié)標(biāo)題或表)之后開始新的段落,則插入空行,然后繼續(xù)鍵入內(nèi)容即可。
          • 因為 AsciiDoc 轉(zhuǎn)換文檔時,相鄰的文本行會被合并為單個段落,這意味著可以包裝段落文本或?qū)⒚總€句子或短語放在單獨的行上,輸出中是不會出現(xiàn)換行的。
          • 如果希望保留段落中的換行符,可以使用加號 (+) 后的空格或 hardbreaks 屬性。這樣會導(dǎo)致每一行之后增加可見的換行標(biāo)記(例如 <BR>)。
          Rubies are red, +
          Topazes are blue.
          [%hardbreaks]
          Ruby is red.
          Java is black.
          
          • 通過將 hardbreaks 屬性添加到文檔頭部,可以在整個文檔中保留換行符。
          :hardbreaks:
          ......
          Rubies are red,
          Topazes are blue.
          

          1.1.3.2 文字段落

          • 由至少一個空間偏移的段落成為文字段落,文字段落中的所有行必須是相鄰的。
          • 文本段落顯示為預(yù)格式化文本,文本以固定寬度字體顯示,空格和換行符都會被保留下來。

          1.1.3.3 提示段落

          • 主要是為了引起讀者注意,用標(biāo)簽開頭。
          • 標(biāo)簽必須大寫,后面跟著冒號(:)。

          標(biāo)簽說明 NOTE 注釋,TIP 提示,WARNING 警告,IMPORTANT 重要,CAUTION 注意。

          TIP: Pro tip...
          IMPORTANT: Don't forget...
          WARNING: Watch out for...
          CAUTION: Ensure that...
          
          • 當(dāng)想對復(fù)雜內(nèi)容應(yīng)用警告時,可以將標(biāo)簽設(shè)置為塊上的樣式屬性。
          • 下例是在分隔塊上的屬性列表中設(shè)置標(biāo)簽,標(biāo)簽必須大寫。
          [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 參數(shù)制定圖標(biāo)的路徑。
          [icons="./images/icons/wink.png"]
          NOTE: What lovely war.
          
          • 使用 caption 參數(shù)定義警告標(biāo)題返回的文本信息(在警告圖標(biāo)設(shè)置為可用時 icons 參數(shù)必須設(shè)置為 icons=None)。
          [icons=None, caption="特殊提示"]
          NOTE: This is my special note.
          
          1.1.3.3.1 圖標(biāo)
          • AsciiDoc 提供三種顯示圖標(biāo)的策略。
          • 作為文本
          • 作為圖像
          • 作為從圖標(biāo)字體中選擇的字符。
          • 使用圖標(biāo)屬性控制策略。默認(rèn)行顯示返回的文本。
          • 如果希望使用圖像顯示圖標(biāo),可以在文檔頭中將圖標(biāo)屬性設(shè)置為空值。如果正在轉(zhuǎn)換為 DocBook,或者希望使用一種簡單的方法使 HTML 可以脫機查看,則建議采用此策略。DocBook 工具鏈提供了警告和標(biāo)注等圖標(biāo)的圖像,這些圖標(biāo)可以用自己的自定義圖標(biāo)替換。如果使用內(nèi)聯(lián)圖標(biāo)宏,則需要為這些圖標(biāo)提供圖像。
          • 也可以使用字體圖標(biāo)設(shè)置為 AsciiDoc 圖標(biāo),若要使用此特性,需要將圖標(biāo)文件屬性的值設(shè)置為文檔標(biāo)題中的字體。可以從 Awesome 中獲得更多的字體圖標(biāo)。這種方式默認(rèn)情況下需要在線訪問。
          = Document Title
          :icons: font
          ......
          NOTE: Asciidoctor supports font-based admonition icons, powered by Font Awesome!
          
          • HTML 格式輸出。
          <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>
          
          • AsciiDoc 中添加了 Awesome 的字體超強樣式表和字體文件的引用。
          <link rel="stylesheet" >
          
          1.1.3.3.2 Unicode 文本圖標(biāo)
          • 代替圖像或基于字體的圖標(biāo),可以通過使用一個小技巧使用 Unicode 文本來表示警告圖標(biāo)。
          • 如果在文檔上沒有設(shè)置圖標(biāo)屬性,AsciiDoc 輸出一個標(biāo)識警告類型的文本標(biāo)簽。此標(biāo)簽的文本來自 AsciiDoc 屬性。
          • 屬性的名稱是 <類型> 標(biāo)題,其中 <類型> 是小寫中的警告類型。例如,提示提示的屬性是提示字幕。
          • 可以將一個 Unicode 字形賦值給這個屬性,而不是單詞。
          :tip-caption: 
          [TIP]
          It's possible to use Unicode glyphs as admonition icons.
          
          • HTML 格式輸出。
          <td class="icon">
          <div class="title"></div>
          </td>
          
          1.1.3.3.3 內(nèi)聯(lián)圖標(biāo)
          • 圖標(biāo)可以插入到段落內(nèi)容的任意位置,內(nèi)嵌宏。
          icon:tags[] ruby, asciidoctor
          
          • HTML 格式輸出。
          <div class="paragraph">
          <p><span class="icon"><i class="fa fa-tags"></i></span> ruby, asciidoctor</p>
          </div>
          
          • 內(nèi)聯(lián)圖標(biāo)宏和角色語法。
          icon:tags[role="blue"] ruby, asciidoctor
          
          • 圖標(biāo)大小
          • 默認(rèn)為 1x
          icon:heart[2x]
          icon:heart[size=2x]
          
          • 圖標(biāo)旋轉(zhuǎn)和翻轉(zhuǎn)
          icon:shield[rotate=90, flip=vertical]
          
          • 鏈接
          icon:download[link="http://rubygems.org/downloads/asciidoctor-1.5.2.gem"]
          

          1.1.3.4 引文段落

          • 將引文樣式應(yīng)用到任何段落,它將使用更大的字體大小。
          • 自動將引文段落進行樣式化。
          • 可以采用 (.) 的方式設(shè)置引文角色和分配到段落上。
          • 當(dāng)將文檔轉(zhuǎn)換為 HTML 并使用默認(rèn)樣式表查看時,前導(dǎo)的第一段將自動樣式化為前導(dǎo)段。
          [.lead]
          This text will be styled as a lead paragraph (i.e., larger font).
          

          1.1.4 塊結(jié)構(gòu)

          • 任何塊都可以有一個標(biāo)題,位于塊的上方。塊標(biāo)題是從一個點開始的文本行。

          1.1.4.1 文本塊

          • 文字塊定義為三種方式
          • 用一個或多個空格縮進段落的第一行。
          • 將文字屬性應(yīng)用于段落或區(qū)塊。
          • 使用文字塊定界符(…)。
           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)用于文本。

          • 當(dāng)希望整個文本塊是文本,并且不希望縮進時,可在元素的頂部設(shè)置文本屬性。
          [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
          

          1.1.4.2 注釋塊

          • 不會輸出到目標(biāo)文件。
          • 行注釋
          • 行注釋可用于分割元素,如兩個相鄰列表。
          // A single-line comment.
          
          • 塊注釋
          ////
          CommentBlock
          ////
          
          1.1.4.3 清單塊(列表塊)
          • 用于計算機的輸出和文件列表、可用于程序代碼。
          • 里面特殊字符不替換。
          • 列表塊內(nèi)容被轉(zhuǎn)換為 <PRE> 文本。
          • 列表塊中的內(nèi)容只受特殊字符和標(biāo)注替換的限制。
          • 列表塊名稱應(yīng)用于內(nèi)容的兩種方式。
          • 在元素上設(shè)置列表屬性。
          • 包含分隔符列表塊中的內(nèi)容。
          • 將列表塊名稱應(yīng)用于元素,例如段落,通過在該元素上設(shè)置列表屬性。
          [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>
          ----
          
          • 滾動支持
          • nowrap 會增加(css 樣式 white-space:nowrap 和 word-wrap: normal)到 <PRE> 元素上。
          [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(".*");
           }
          }
          ----
          
          • 全局強制不換行 ,可以設(shè)置 prewrap 屬性。
          :prewrap!:
          
          • 帶標(biāo)題的列表塊
          .Gemfile.lock
          ----
          GEM
           remote: https://rubygems.org/
           specs:
           asciidoctor (1.5.6.1)
          PLATFORMS
           ruby
          DEPENDENCIES
           asciidoctor (~> 1.5.6.1)
          ----
          
          • 帶標(biāo)注的代碼塊
          [source,ruby]
          ----
          require 'sinatra' // <1>
          get '/hi' do // <2>
           "Hello World!" // <3>
          end
          ----
          <1> Library import
          <2> URL mapping
          <3> HTTP response body
          
          • 帶不可選擇標(biāo)注的代碼塊
          ----
          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.
          
          • 具有不可選標(biāo)注的 XML 代碼塊
          [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.
          
          • 代碼列表塊啟動語法高亮可以在文檔頭中設(shè)置。
          • 高亮屬性有 coderay、highlightjs、prettify 和 pygments。
          :source-highlighter: pygments
          

          1.1.4.4 側(cè)邊欄塊

          • 有邊框顯示。
          .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.
          ****
          

          1.1.4.5 引用文本塊

          • 文本塊左上角顯示一個雙引號圖片。
          ____
          QuoteBlock
          ____
          
          • 負(fù)責(zé)引用塊
          [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.
          ____
          
          • 縮寫塊引用(只有 Asciidoctor 支持)
          "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.
          ""
          

          1.1.4.6 案例文本塊

          • 可以使用 NOTE、TIP、IMPORTANT、WARNING、CAUTION 顯示提示塊。
          ====
          ExampleBlock
          ====
          

          1.1.4.7 混合使用

          .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.
          ====
          

          1.1.4.8 開放塊

          --
          An open block can be an anonymous container,
          or it can masquerade as any other block.
          --
          [source]
          --
          puts "I'm a source block!"
          --
          

          1.1.5 列表

          1.1.5.1 有序列表

          • 通過在第一個列表之后插入一個空白行和一行注釋,可以將兩個相鄰的列表分開。-
          • 約定使用(//)作為行注釋向其他作者提供一個提示,即它是一個列表分隔符。
          1. 阿拉伯?dāng)?shù)字標(biāo)注的列表項目.
          a. 小寫字母標(biāo)注的列表項目.
          F. 大寫字母標(biāo)注的列表項目.
          iii) 小寫羅馬數(shù)字標(biāo)注的列表項目.
          IX) 大寫羅馬數(shù)字標(biāo)注的列表項目.
          

          1.1.5.2 無序列表

          - List item.
          * List item.
          ** List item.
          *** List item.
          **** List item.
          ***** List item.
          

          1.1.5.3 自定義列表

          • 字母或數(shù)字開始 1-4 個冒號或兩個分號結(jié)束。
          Operating Systems::
           Linux:::
           . Fedora
           * Desktop
           . Ubuntu
           * Desktop
           * Server
           BSD:::
           . FreeBSD
           . NetBSD
          Cloud Providers::
           PaaS:::
           . OpenShift
           . CloudBees
           IaaS:::
           . Amazon EC2
           . Rackspace
          

          1.1.5.4 問答列表

          [qanda]
          What is Asciidoctor?::
           An implementation of the AsciiDoc processor in Ruby.
          What is the answer to the Ultimate Question?:: 42
          

          1.1.5.5 復(fù)選框列表

          * [*] checked
          * [x] also checked
          * [ ] not checked
          * normal list item
          

          1.1.5.6 單行標(biāo)記

          first term:: definition of first term
          second term:: definition of second term
          

          1.1.5.7 多行標(biāo)記

          first term::
          definition of first term
          second term::
          definition of second term
          

          1.1.5.8 專業(yè)術(shù)語列表

          [glossary]
          術(shù)語1::
           解釋1.
          術(shù)語2::
           解釋2.
          

          1.1.6 文本格式

          1.1.6.1 粗體

          *bold phrase* & **char**acter**s**
          

          1.1.6.2 斜體

          _italic phrase_ & __char__acter__s__
          

          1.1.6.3 等寬字體

          `monospace phrase` & ``char``acter``s``
          
          • 如果要在等寬字體中用到({name})這樣的格式(需要直譯),那么可以使用(+ 和 +)符號或者轉(zhuǎn)義符(\)。
          You can reference the value of a document attribute using the syntax `+{name}+`, where `name` is the attribute name.
          

          1.1.6.4 混合使用

          `*_monospace bold italic phrase_*` & ``**__char__**``acter``**__s__**``
          

          1.1.6.5 標(biāo)記字體(黃色背景)

          Werewolves are allergic to #cassia cinnamon#.
          

          1.1.6.6 字體縮小

          Did the werewolves read the [.small]##small print##?
          

          1.1.6.7 字體擴大

          [.big]##O##nce upon an infinite loop.
          

          1.1.6.8 刪除線

          We need [.line-through]#ten# make that twenty VMs.
          

          1.1.6.9 下劃線

          Where did all the [.underline]#cores# run off to?
          

          1.1.6.10 上標(biāo)

          ^super^script phrase
          

          1.1.6.11 下標(biāo)

          ~sub~script phrase
          

          1.1.6.12 智能引號

          • 如果不希望應(yīng)用智能引號,可以使用 (\)進行轉(zhuǎn)義。
          "`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.
          

          1.1.6.13 文本替換

          符號顯示說明(C)?版權(quán)(TM)?商標(biāo)(R)?注冊商標(biāo)…?...省略號->→右箭頭<-←左箭頭=>?右雙箭頭<=?左雙箭頭??數(shù)字--—破折號(只能在兩個字符之間使用)

          • 文本替換是指其字符的通用字符集 / Unicode 代碼,使用格式。
          • https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references 可查詢通用字符集。
          hhhh;
          

          1.1.7 其他標(biāo)簽

          1.1.7.1 文件包含語句

          • 如果不在相鄰的文件包含語句之間插入空白行以保持內(nèi)容分離,務(wù)必在源文檔中添加空白行,以避免意外的結(jié)果,如吞并部分標(biāo)題等。
          = Reference Documentation
          Lead Developer
          This is documentation for project X.
          include::basics.adoc[]
          include::installation.adoc[]
          include::example.adoc[]
          
          • 包含 URL 文件
          include::https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/README.adoc[]
          

          1.1.7.2 水平線

          '''
          

          1.1.7.3 分頁符

          <<<
          

          1.1.7.4 超鏈接

          • 外部鏈接
          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]
          
          • Windows 路徑
          link:\\server\share\whitepaper.pdf[Whitepaper]
          
          • 相對路徑
          link:index.html[Docs]
          
          • 電子郵件和 IRC
          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
          

          1.1.7.5 錨點

          錨點:[[A88]]
          鏈接:<<A88,chapter titles>>
          

          1.1.7.6 圖片

          • 塊圖像
          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]
          
          • 內(nèi)聯(lián)圖
          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.
          
          • 具有定位角色的內(nèi)聯(lián)圖
          image:sunset.jpg[Sunset,150,150,role="right"] What a beautiful sunset!
          

          1.1.7.7 視頻

          • 塊視頻
          video::video_file.mp4[]
          video::video_file.mp4[width=640, start=60, end=140, options=autoplay]
          

          1.1.7.8 源碼

          • 內(nèi)聯(lián)方式(等寬字體)
          Reference code like `types` or `methods` inline.
          
          • 內(nèi)聯(lián)方式(直譯方法)
          Output literal monospace text such as `+{backtick}+` by
          enclosing the text in pluses, then again in backticks.
          

          1.1.7.9 文檔目錄(ToC)

          = AsciiDoc Writer's Guide
          Doc Writer <doc.writer@asciidoctor.org>
          v1.0, 2013-08-01
          :toc: right
          

          1.1.7.10 參考文獻

          _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.
          

          1.1.7.11 腳注

          A statement.footnote:[Clarification about this statement.]
          A bold statement!footnoteref:[disclaimer,Opinions are my own.]
          Another bold statement.footnoteref:[disclaimer]
          

          1.1.8 表格

          • 除非指定了 cols 屬性,否則列的數(shù)量等于塊分隔符之間的第一行(非空)上的單元格分隔符字符的數(shù)量。
          • 當(dāng)空白行跟隨第一個非空行時,第一行中的單元格將升遷到表標(biāo)題。
          .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
          |===
          
          • cols 屬性中的(*)是重復(fù)運算符,意味著在列的其余部分重復(fù)列規(guī)范。
          • 當(dāng)頭中的單元格沒有在一行上定義時,必須使用 cols 屬性設(shè)置表中的列數(shù),使用 %header 選項(或 .=header 屬性)將第一行提升到表頭。
          [%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
          |===
          
          • 下例中指定該表有三列,并設(shè)置它們的相對寬度。
          [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.
          |===
          
          • 包含其他標(biāo)簽的表
          [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]!
          |===
          
          • CSV 格式的表
          [%header,format=csv]
          |===
          Artist,Track,Genre
          Baauer,Harlem Shake,Hip Hop
          The Lumineers,Ho Hey,Folk Rock
          |===
          
          • CSV 格式速記表(只有 Asciidoctor 支持)
          ,===
          Artist,Track,Genre
          Baauer,Harlem Shake,Hip Hop
          ,===
          
          • 引入 CSV 文件表
          |===
          include::customers.csv[]
          |===
          
          • DSV 數(shù)據(jù)使用速記表
          :===
          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
          |===
          

          1.1.9 屬性

          • 定義和使用
          :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!
          
          • 計數(shù)器屬性
          [caption=""]
          .Parts{counter2:index:0}
          |===
          |Part Id |Description
          |PX-{counter:index}
          |Description of PX-{index}
          |PX-{counter:index}
          |Description of PX-{index}
          |===
          

          1.1.10 直譯方式

          • 轉(zhuǎn)移符直譯
          \*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 宏直譯
          pass:[<u>underline me</u>] is also underlined.
          
          • 三(+)直譯
          +++<u>underline me</u>+++ is underlined.
          

          1.2 兼容 Markdown

          • 兼容 Markdown 標(biāo)題
          # Document Title (Level 0)
          ## Section Level 1
          ### Section Level 2
          #### Section Level 3
          ##### Section Level 4
          ###### Section Level 5
          
          • 兼容 Markdown 代碼塊
          ```ruby
          require 'sinatra'
          get '/hi' do
           "Hello World!"
          end
          \``` \\ 去除第一個 \ 符號
          
          • 兼容 Markdown 引用塊
          > 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
          
          • 兼容 Markdown 引用塊和塊內(nèi)容
          > > 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.
          
          • 兼容 Markdown 水平線
          ---
          - - -
          ***
          * * *
          

          參考資料

          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-1Latin alphabet part 1北美、西歐、拉丁美洲、加勒比海、加拿大、非洲
          ISO-8859-2Latin alphabet part 2東歐
          ISO-8859-3Latin alphabet part 3SE Europe、世界語、其他雜項
          ISO-8859-4Latin alphabet part 4斯堪的納維亞/波羅的海(以及其他沒有包括在 ISO-8859-1 中的部分)
          ISO-8859-5Latin/Cyrillic part 5使用古代斯拉夫語字母表的語言,比如保加利亞語、白俄羅斯文、俄羅斯語、馬其頓語
          ISO-8859-6Latin/Arabic part 6使用阿拉伯字母的語言
          ISO-8859-7Latin/Greek part 7現(xiàn)代希臘語,以及由希臘語衍生的數(shù)學(xué)符號
          ISO-8859-8Latin/Hebrew part 8使用希伯來語的語言
          ISO-8859-9Latin 5 part 9土耳其語。除了土耳其字符取代了冰島文字,其它與 ISO-8859-1 相同。
          ISO-8859-10Latin 6拉普蘭語、日耳曼語、愛斯基摩北歐語
          ISO-8859-15Latin 9 (aka Latin 0)與 ISO 8859-1 類似,歐元符號和其他一些字符取代了一些較少使用的符號
          ISO-2022-JPLatin/Japanese part 1日本語
          ISO-2022-JP-2Latin/Japanese part 2日本語
          ISO-2022-KRLatin/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-8UTF8 中的字符可以是 1-4 個字節(jié)長。UTF-8 可以表示 Unicode 標(biāo)準(zhǔn)中的任意字符。UTF-8 向后兼容 ASCII。UTF-8 是網(wǎng)頁和電子郵件的首選編碼。
          UTF-1616 比特的 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。


          主站蜘蛛池模板: 国产欧美色一区二区三区| 亚洲影视一区二区| 国产日韩视频一区| 天美传媒一区二区三区| 韩国精品福利一区二区三区| 无码人妻精品一区二区三区99性 | 国产一区二区三区在线观看影院| 男插女高潮一区二区| 日美欧韩一区二去三区| 国产一区二区免费在线| 亚洲日本精品一区二区| 精品3d动漫视频一区在线观看| 色狠狠一区二区三区香蕉蜜桃| 亚洲欧洲无码一区二区三区| 国产日韩一区二区三免费高清| 无码一区二区三区免费| 国产成人一区二区在线不卡| 亚洲无线码在线一区观看| 国产视频一区二区在线观看| 亚洲视频在线一区| 91久久精一区二区三区大全| 午夜DV内射一区区| 蜜桃AV抽搐高潮一区二区| 亚洲一区精品中文字幕| 亚洲综合无码AV一区二区| 日韩视频免费一区二区三区| 亚洲日韩一区二区三区| 亚洲国产精品乱码一区二区| 香蕉视频一区二区三区| 视频一区视频二区在线观看| 免费高清av一区二区三区| 国产香蕉一区二区三区在线视频 | 中文字幕一区二区三区免费视频| 乱码人妻一区二区三区| 亚洲码欧美码一区二区三区| 成人精品视频一区二区| 又紧又大又爽精品一区二区| 日本一区二区三区久久| 中文字幕无线码一区| 精品日韩亚洲AV无码一区二区三区| 国产免费无码一区二区 |