Skip to content

DocBook: admonition-like environments #1234

@thom4parisot

Description

@thom4parisot

Hello,

Docbook has a handy way to create text blocks. The current way Pandoc translates them makes it very difficult to recover them through XML post-processing.

Text Flow

Asciidoc

Regular paragraph.

[TIP]
====
.Title of my tip
A paragraph inside a tip.
====

Another regular paragraph.

DocBook

<simpara>Regular paragraph.</simpara>
<tip>
  <formalpara>
    <title>Title of my tip</title>
    <para>A paragraph inside a tip.</para>
  </formalpara>
</tip>
<simpara>Another regular paragraph.</simpara>

OpenDocument (from pandoc)

<text:p text:style-name="Text_20_body">Regular paragraph.</text:p>

<text:p text:style-name="P11"><text:span text:style-name="T279">Tip</text:span></text:p>
<text:p text:style-name="P11"><text:span text:style-name="T282">Title of my tip</text:span>.<text:line-break/>A paragraph inside a tip.</text:p>

<text:p text:style-name="Text_20_body">Another regular paragraph.</text:p>

Ideal solution

<text:p text:style-name="Text_20_body">Regular paragraph.</text:p>

<text:h text:style-name="ADMONITION11 ADMONITITION-TIP">Title of my tip</text:h>
<text:p text:style-name="ADMONITION11 ADMONITITION-TIP">A paragraph inside a tip.</text:p>

<text:p text:style-name="Text_20_body">Another regular paragraph.</text:p>

Something like that.

How feasible is it? It would help a lot for the code blocks as well, as they share a very similar logic (which is going to be a next issue).

Thanks very much :-)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions