Asciidoc 的嵌入式链接写法
多年以前,有一段時(shí)間我對 Asciidoc 很感興趣,嘗試用它起草寫了一篇博客文章(為什么我說Rust是靠譜的編程語言),偏偏那是一篇很長的文章(大概有一萬字),偏偏里面有大量的超級鏈接,大量的鏈接夾雜在文字中間,寫的我都快吐了。當(dāng)時(shí)也曾專門去找,想知道Asciidoc有沒有類似Markdown的嵌入式鏈接寫法([title][name] [name]: url),然而很遺憾,沒找到(我覺得官方文檔也要背一下鍋)。結(jié)果就是,那是我第一篇也是唯一一篇用Asciidoc格式正式書寫的文章。
今天偶然看到Asciidoc,又去它官方網(wǎng)站找了一遍,還真給找到了嵌入式鏈接寫法,解開了我心中積壓多年的一個(gè)疑團(tuán)。下面引用官方文檔。(杯具的是,我這里寫的還是Markdown,因?yàn)镃SDN博客編輯器已經(jīng)官方支持Markdown。)
28.1. Setting configuration entries
Attribute entries promote clarity and eliminate repetition
URLs and file names in AsciiDoc macros are often quite long?—?they break paragraph flow and readability suffers. The problem is compounded by redundancy if the same name is used repeatedly. Attribute entries can be used to make your documents easier to read and write, here are some examples:
:1: http://freshmeat.net/projects/asciidoc/ :homepage: http://asciidoc.org[AsciiDoc home page] :new: image:./images/smallnew.png[] :footnote1: footnote:[A meaningless latin term]Using previously defined attributes: See the {1}[Freshmeat summary] or the {homepage} for something new {new}. Lorem ispum {footnote1}.Note:
- The attribute entry definition must precede it’s usage.
- You are not limited to URLs or file names, entire macro calls or arbitrary lines of text can be abbreviated.
- Shared attributes entries could be grouped into a separate file and included in multiple documents.
總結(jié)
以上是生活随笔為你收集整理的Asciidoc 的嵌入式链接写法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android Fragment切换动画
- 下一篇: 什么是 Asciidoc