gpt4 book ai didi

asciidoc - 在 Asciidoctor 中嵌套项目符号列表和段落

转载 作者:行者123 更新时间:2023-12-01 11:17:25 26 4
gpt4 key购买 nike

我应该如何编写 Asciidoc(tor) 以获得以下输出:

* item 1
* item a
paragraph 1 inside item a
* item a.1 inside paragraph 1 inside item a
paragraph a.1 inside item a.1
* item a.2 inside paragraph 1 inside item a
paragraph a.2 inside item a.1
paragraph 2 inside item a
* item b
paragraph 1 inside item b
* item 2

更新 :@TigerTV.ru 提出了一个不错的技巧,但它需要能够在项目符号列表中隐藏项目符号。如何才能做到这一点?

谢谢

最佳答案

https://asciidoctor.org/docs/user-manual/#attaching-to-an-ancestor-list :

You may find that you need to attach block content to a parent list item instead of the current one. In other words, you want to attach the block content to the parent list item so it becomes a sibling of the child list. To do this, you add a blank line before the list continuation.

* parent list item
** child list item

+
paragraph attached to parent list item

更复杂的例子:
* Foo
** Aaa
** Bbb

+
Continuation of Foo
* Bar
+
Continuation of Bar
* Baz
+
Continuation of Baz

** Ccc
** Ddd
* Xyz
笔记:
  • Bbb 后需要空行。这是设计使然:

    The blank line signals to the list continuation to move out of the current list so it attaches the block to the last item of the parent list.


  • 您还需要在 Ccc 之前空行。这是当前 Unresolved 问题 #2509 .

  • A block attached to the grandparent list item:

    * grandparent list item
    ** parent list item
    *** child list item


    +
    paragraph attached to grandparent list item

    Using blank lines to back out of the nesting may feel fragile. A more robust way to accomplish the same thing is to enclose the nested lists in an open block. That way, it’s clear where the nested list ends and the enclosing list continues:

    * grandparent list item
    +
    --
    ** parent list item
    *** child list item
    --
    +
    paragraph attached to grandparent list item

    关于asciidoc - 在 Asciidoctor 中嵌套项目符号列表和段落,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48890305/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com