Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
783 views
in Technique[技术] by (71.8m points)

insert a blank line in .odt generated from docbook by pandoc

I have a workflow where I use asciidoc (via asciidoctor) to create html, pdf and or open office (.odt) format documents. For the most part this works very well.

For the open office conversion I use pandoc with docbook format as an intermediary as in:

asciidoctor -b docbook foo.adoc -o foo.docbook
pandoc --base-header-level=3 -V date:"" -V title:"" -f docbook foo.docbook -o foo.odt

Now I wish to format output like the following:

This is some pipe delimited output:

    #columns: name|phone
    Goza|555

This is some more:

    #columns: name|phone
    Zuul|666

For which I use the asciidoc syntax like:

==== Example

This is some pipe delimited output:

----
    #columns: name|phone
    Goza|555
----

This is some more:

----
    #columns: name|phone
    Zuul|666
----

In docbook this comes out as:

<title>Example</title>
<simpara>This is some pipe delimited output:
</simpara>
<screen>#columns: name|phone
Goza|555</screen>

But in libreoffice the odt file appears with no blank lines as below, which looks really ugly:

This is some pipe delimited output:
 #columns: name|phone
 Goza|555
This is some more:
 #columns: name|phone
 Zuul|666

I want to be able force the insertion of a blank line after each colon such that:

  • It will appear in the .odt file
  • It won't mess up the output of asciidoctor -b html5 or asciidoctor-pdf
  • The .adoc file is not encumbered with too much noise

There is some discussion here:

I tried various combinations of macros like:

:blank: {empty} +

with no luck.

First of all I am not clear what docbook syntax I need asciidoctor to produce.

I tried using "literallayout" instead of "simpara" and it looks the same after processing by pandoc. The same seems to be mostly true if I insert "<div>" elements or "&nbsp".

It may be the pandoc stage that is at fault here. If so I'm not sure what to do about it.

Update

I am now pretty confident it is the docbook to odt stage via pandoc that is at fault. Using "[example]" I can get asciidoctor to produce docbook like:

 <simpara>This is some pipe delimited output:
 </simpara>
 <informalexample>
 <literallayout class="monospaced">#columns: name|phone
 Goza|555</literallayout>
 </informalexample>

and there is still no blank line after the colon.

question from:https://stackoverflow.com/questions/65944733/insert-a-blank-line-in-odt-generated-from-docbook-by-pandoc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...