qanda答案中的源块

时间:2017-05-27 16:46:17

标签: asciidoctor

我想用Asciidoctor创建一个Q& A。

大多数答案涉及命令行指令,我想在[source]部分中使用。但是,似乎[source]块标记了[qanda]块的结束。

[qanda]
How do you show all the changes introduced in branchA since its common ancestor commit with branchB?::
    Having branchA and branchB as valid pointers, run
[source,sh]
----
$ git log branchB..branchA
----
You probably mean branchA and branchB to be recently related.

How do you see the contents of a stash?::
    `git stash show -p "stash{0}"`

第二个问题显示为标记列表的第一个元素。

有没有办法在Asciidoctor中表达这一点?

1 个答案:

答案 0 :(得分:1)

你应该添加一个" +"在[source,sh]之前的行中。完整文件应如下所示:

[qanda] 
How do you show all the changes introduced in branchA since its common ancestor commit with branchB?::
Having branchA and branchB as valid pointers, run
+
[source,sh]
----
$ git log branchB..branchA
----
You probably mean branchA and branchB to be recently related.

How do you see the contents of a stash?::
`git stash show -p "stash{0}"`