Hello ladies and gentlemen. This is my first post in the "pandoc-discuss" group. Allow me to explain myself.
So what I would like pandoc to do when executing it on a DOCX document of the above type is:
- Keep the whitespace between the verses and the first line which is the title
- Keep the verse structure so that lines that are not divided by a whitespace line stay together
====TRIED====
function Pandoc(doc)
local lb = pandoc.LineBlock(doc)
for i,b in pairs(doc.content) do
if b.t == "Para" and b.content ~= nil then
table.insert(lb.content, b.content)
end
end
return pandoc.Pandoc({lb}, doc.meta)
end
```
--> that gets the conversion in the right direction. Lines are not like this
```
Evigt liv til salg
Hvis nyeste forskning besad.
Gralen til evigt liv via morgenmad.
Ville du gå til bords?
Mæske dig i libidoens buffet.
Eller tror du, fordi du tror?
```
but like this:
```
| Evigt liv til salg
| Hvis nyeste forskning besad.
| Gralen til evigt liv via morgenmad.
| Ville du gå til bords?
| Mæske dig i libidoens buffet.
| Eller tror du, fordi du tror?
| At evigt liv er en Guds givet gave.
```
However as stated in the "..what I would like..." section, it does not:
- Keep the whitespace between the verses and the first line which is the title
- Keep the verse structure so that lines that are not divided by a whitespace line stay together
----
So I'm seeking help on how to accomplish what I want with a LUA filter, as this seems like the rigth path.
Thank you very much :-) and a happy new year (it's soon :-).
function Pandoc(doc)
local lb = pandoc.LineBlock(doc)
for i,b in pairs(doc.content) do
if b.t == "Para" and b.content ~= nil then
table.insert(lb.content, b.content)
end
end
return pandoc.Pandoc({lb}, doc.meta)
end
sudo pandoc -s /Volumes/IBIGDATA/IBIG\ Data/Documents/POEMS\ -\ PHILOSOPHIES\ -\ WORDPLAY/FINISHED\ POEMS/DANISH/2016/Evigt\ liv\ til\ salg\ 160603.docx -t markdown -o mydoc.md --wrap=none --extract-media .