asciidoc - thawk/wiki GitHub Wiki
- _Emphasized text_
-
Word phrases 'enclosed in single quote characters' (acute accents) or _underline characters_ are emphasized.
- *Strong text*
-
Word phrases *enclosed in asterisk characters* are rendered in a strong font (usually bold).
- +Monospaced text+
-
Word phrases `enclosed in backtick characters` (grave accents) or +plus characters+ are rendered in a monospaced font.
- ``Quoted text''
-
Phrases ``enclosed with two grave accents to the left and two acute accents to the right'' are rendered in ``quotation'' marks. Asciidoctor use ` inside ' or ", like "`sample text`": “sample text”
- #highlight text#
-
Placing #hashes around text# render text as highlighed.
- +++Triple-plus passthrough\+\++
-
原样输出
- $$Double-dollar passthrough$$
-
只替换特殊字符(Special characters). This passthrough can be prefixed with inline attributes.
由一行标题,跟着一行重复的字符形成。
Level 0 (top level): ====================== Level 1: ---------------------- Level 2: ~~~~~~~~~~~~~~~~~~~~~~ Level 3: ^^^^^^^^^^^^^^^^^^^^^^ Level 4 (bottom level): ++++++++++++++++++++++
两行标题对中文支持不好,推荐用单行标题
需要打开experimental
属性。
// We must enable experimental attribute.
:experimental:
可以定义自己的键名(如MacOS的Command键)
// Define unicode for Apple Command key.
:commandkey: ⌘
使用
Press kbd:[{commandkey} + 1] or kbd:[Ctrl + 1]
在双重方括号中包含块的名字,用于以后进行引用。
[[chapter-titles]] Chapter titles can be ...
后面可以用 <<chapter-titles,chapter titles>>
来引用上面的块
段落结束于空行、文件尾或DelimitedBlock
由多个非空行文本组成。首行必须顶格
verse风格可以保留行四周的边框
缺省段落, 第二行。 [verse] 带**verse**风格的缺省段落, 第二行。
Renders:
缺省段落, 第二行。
带verse风格的缺省段落, 第二行。
由多个非空行文本组成。首行缩进1或多个空格。 段落中的格式字符将保持原样。
**Literal**缺省段落, 第二行。
Renders:
**Literal**缺省段落, 第二行。
CommentBlock: ////////////////////////// PassthroughBlock: ++++++++++++++++++++++++++ ListingBlock: -------------------------- LiteralBlock: .......................... SidebarBlock: ************************** QuoteBlock: __________________________ ExampleBlock: ========================== Filter blocks: ~~~~~~~~~~~~~~~~~~~~~~~~~~
`-------------.------------.---------.---------.---------.--------- Passthrough Listing Literal Sidebar Quote
Callouts No Yes Yes No No Attributes Yes No No Yes Yes Inline Macros Yes No No Yes Yes Quotes No No No Yes Yes Replacements No No No Yes Yes Special chars No Yes Yes Yes Yes Special words No No No Yes Yes
Note
|
可以通过加上[subs="quotes"]之类,让一个block支持更多的格式。 |
-
需要使用
:toc: macro
属性,并且在适当位置用toc::[]指出toc的放置位置 -
模板
= asciidoc摘要 :numbered: :toc: macro :toc-title: 目录 toc::[]
-
可能需要使用BOM才可以在asciidoctor.js live preview中显示中文
可以注入CSS内容。
Mode | Location | Behaviour | Docinfo file name |
---|---|---|---|
Private |
Head |
Adds content to <head>/<info> for <docname>.adoc files. |
|
<docname>-docinfo<outfilesuffix> |
Footer |
Adds content to end of document for <docname>.adoc files. |
<docname>-docinfo-footer<outfilesuffix> |
Shared |
Head |
Adds content to <head>/<info> for any document in same directory. |
|
docinfo<outfilesuffix> |
Footer |
Adds content to end of document for any document in same directory. |
docinfo-footer<outfilesuffix> |
-
private-head
-
private-footer
-
private (alias for private-head,private-footer)
-
shared-head
-
shared-footer
-
shared (alias for shared-head,shared-footer)
指定docinfo的路径
sudo gem install asciidoctor slim thread_safe
sudo gem install bundler
-
Create project directory
mkdir my-awesome-presentation cd my-awesome-presentation
-
Create a file named Gemfile with the following content:
source 'https://rubygems.org' gem 'asciidoctor-revealjs' # latest released version #gem 'asciidoctor-revealjs', github: 'asciidoctor/asciidoctor-reveal.js' # github master branch
NoteFor some reason, when you use the system Ruby on Fedora, you also have to add the json gem to the Gemfile. -
Install the gems into the project
bundle config --local github.https true bundle --path=.bundle/gems --binstubs=.bundle/.bin
-
Optional: Copy or clone reveal.js presentation framework. Allows you to modify themes or view slides offline.
git clone -b 3.3.0 --depth 1 https://github.com/hakimel/reveal.js.git
-
创建演示文件
bundle exec asciidoctor-revealjs CONTENT_FILE.adoc