Dear fellows,
I just wanted to thank you for the code I found on this discussion and for every contribution. Unfortunately I have absolutely zero knowledge of Haskell, but with a minimal edit to your code, I managed to make a little filter to enable forwarding a custom page break command from Markdown to ICML.
I needed this very much for my master's thesis. I am very grateful for your sharing your knowledge. The code I used is this.
#!/usr/bin/env runhaskell
-- icmlpagebreaks.hs
import Text.Pandoc.JSON
import Text.Pandoc
import Text.Pandoc.Walk (walk)
pgBrkIcml :: String
pgBrkIcml = " <CharacterStyleRange AppliedCharacterStyle=\"CharacterStyle/$ID/[No character style]\" ParagraphBreakType=\"NextColumn\"><Br/></CharacterStyleRange> "
pgBrkBlock :: Block
pgBrkBlock = RawBlock (Format "icml") pgBrkIcml
insertPgBrks :: Block -> Block
insertPgBrks (Para [Str "\\PAGEBREAK"]) = pgBrkBlock
insertPgBrks blk = blk
main = toJSONFilter insertPgBrks
At the moment, it looks like it's working. I hope it is correct. Thank you again, cheers
David