第7章 Rosetta Stone

7.1. Docbook 和 AsciiDoc 之间的比较

此 Rosetta Stone 试图展示 Docbook 和 AsciiDoc 之间的差异。

表1. Docbook 和 AsciiDoc 之间的比较
语言特性DocbookAsciiDoc

粗体

<strong>bold</strong>

*bold*

斜体

<emphasis>Italic</emphasis>

_Italic_

等宽字体

<literal>Monospace</literal>

`Monospace`

段落

<para>This is a paragraph</para>

This is a paragraph

按键

<keycap>F11</keycap>

kbd:[F11]

链接

<link xlink:href="https://freebsd.ac.cn/where/">Download FreeBSD</link>
link:https://freebsd.ac.cn/where/[Download FreeBSD]

章节

  <sect1 xml:id="id">
    <title>Section 1</title>
  </sect1>
 [[id]]
 = Section 1

无序列表

<itemizedlist>
  <listitem>
    <para>When to build a custom kernel.</para>
  </listitem>

  <listitem>
    <para>How to take a hardware inventory.</para>
  </listitem>
</itemizedlist>
* When to build a custom kernel.
* How to take a hardware inventory.

有序列表

<orderedlist>
  <listitem>
    <para>One</para>
  </listitem>
  <listitem>
    <para>Two</para>
  </listitem>
  <listitem>
    <para>Three</para>
  </listitem>
  <listitem>
    <para>Four</para>
  </listitem>
</orderedlist>
. One
. Two
. Three
. Four

变量列表

<variablelist>
  <varlistentry>
    <term>amd64</term>
    <listitem>
      <para>This is the most common desktop...</para>
    </listitem>
  </varlistentry>
</variablelist>
amd64::
This is the most common desktop...

源代码

<screen>
  &prompt.root; <userinput>mkdir -p /var/spool/lpd/lp</userinput>
</screen>
[source,shell]
----
# mkdir -p /var/spool/lpd/lp
----

文本块

<programlisting>
include GENERIC
ident MYKERNEL

options         IPFIREWALL
options         DUMMYNET
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPDIVERT
</programlisting>
....
include GENERIC
ident MYKERNEL

options         IPFIREWALL
options         DUMMYNET
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPDIVERT
....

图像

<figure xml:id="bsdinstall-newboot-loader-menu">
  <title>FreeBSD Boot Loader Menu</title>

  <mediaobject>
    <imageobject>
      <imagedata fileref="bsdinstall/bsdinstall-newboot-loader-menu"/>
    </imageobject>
    <textobject>
      </literallayout>ASCII art replacement is no longer supported.</literallayout>
    </textobject>
    <textobject>
      <phrase>The FreeBSD loader menu, with options 1-6 to boot
          multi-user, boot single user, escape to loader prompt, reboot,
          select a kernel to load, and select boot options</phrase>
    </textobject>
  </mediaobject>
</figure>
[[bsdinstall-newboot-loader-menu]]
.FreeBSD Boot Loader Menu
image::bsdinstall/bsdinstall-newboot-loader-menu[The FreeBSD loader menu, with options 1-6 to boot multi-user, boot single user, escape to loader prompt, reboot, select a kernel to load, and select boot options]

包含

n/a

include::chapter.adoc[]

表格

<table xml:id="partition-schemes" frame="none" rowsep="1" pgwide="1">
  <title>Partitioning Schemes</title>

  <tgroup cols="2" align="left">
    <thead>
      <row>
        <entry align="left">Abbreviation</entry>
        <entry align="left">Description</entry>
      </row>
    </thead>

    <tbody>
      <row>
        <entry>APM</entry>
        <entry>Apple Partition Map, used by PowerPC(R).</entry>
      </row>
    </tbody>
  </tgroup>
</table>
[[partition-schemes]]
.Partitioning Schemes
[cols="1,1", frame="none", options="header"]
|===
| Abbreviation
| Description

|APM
|Apple Partition Map, used by PowerPC(R).

|===

警告

<tip>
  <para>This is a tip</para>
</tip>
[TIP]
====
This is a tip
====

上次修改时间:2024年3月9日,作者 Danilo G. Baio