public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: amygroshek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: How to get a page break (/f) from Markdown -> docx?
Date: Sat, 30 May 2015 08:41:18 -0700 (PDT)	[thread overview]
Message-ID: <9c2658ec-c79f-4dd7-b403-21c88dc93bc4@googlegroups.com> (raw)
In-Reply-To: <f65a84c9-7e2f-4ba1-a092-0c52f5f79186-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2269 bytes --]

This thread is excellent! I'm trying to get this working... Must be having 
some sort of basic setup issue or something. 

I'm just trying to use the basic "PAGEBREAK" replace option. 

import Text.Pandoc.JSON

pgBrkXml :: String
pgBrkXml = "<w:p><w:r><w:br w:type=\"page\"/></w:r></w:p>"

pgBrkBlock :: Block
pgBrkBlock = RawBlock (Format "openxml")
pgBrkXml

insertPgBrks :: Block -> Block
insertPgBrks (Para [Str "PAGEBREAK"])  = pgBrkBlock
insertPgBrks blk = blk

main = toJSONFilter insertPgBrks

Getting all kinds of funky responses:

As-MacBook-Air:poetry macair$ pandoc --filter 
/Users/macair/.pandoc/filter-pagebreak.hs test_ms.md -f markdown -t docx -s 
-o test_ms.docx

/Users/macair/.pandoc/filter-pagebreak.hs: line 1: import: command not found

/Users/macair/.pandoc/filter-pagebreak.hs: line 3: pgBrkXml: command not 
found

/Users/macair/.pandoc/filter-pagebreak.hs: line 4: pgBrkXml: command not 
found

/Users/macair/.pandoc/filter-pagebreak.hs: line 6: pgBrkBlock: command not 
found

/Users/macair/.pandoc/filter-pagebreak.hs: line 7: syntax error near 
unexpected token `('

/Users/macair/.pandoc/filter-pagebreak.hs: line 7: `pgBrkBlock = RawBlock 
(Format "openxml")'

pandoc: Error running filter /Users/macair/.pandoc/filter-pagebreak.hs

Compiling the filter also seems to go wonky:

As-MacBook-Air:.pandoc macair$ ghc --make filter-pagebreak.hs

[1 of 1] Compiling Main             ( filter-pagebreak.hs, 
filter-pagebreak.o )


filter-pagebreak.hs:8:1:

    Parse error: naked expression at top level

    Perhaps you intended to use TemplateHaskell

I'm new to Haskell and pandoc. Assuming there's some simple, basic, 
no-brainer thing that I'm not doing?

All best!

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9c2658ec-c79f-4dd7-b403-21c88dc93bc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 6112 bytes --]

  parent reply	other threads:[~2015-05-30 15:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 13:55 Ken Kleinman
     [not found] ` <65081506-a54b-4aff-96a0-d8e1cb6accc2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-10-03 14:10   ` Jesse Rosenthal
     [not found]     ` <87fvf5ckhv.fsf-4GNroTWusrE@public.gmane.org>
2014-10-03 14:21       ` Ken Kleinman
     [not found]         ` <d4db22fa-7e71-4ae5-aa46-ff75a2fe3a62-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-10-03 14:28           ` Ken Kleinman
     [not found]             ` <404e04a7-e51c-4afe-ab5a-826a2ccfec86-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-10-03 14:43               ` Jesse Rosenthal
     [not found]                 ` <874mvlcixp.fsf-4GNroTWusrE@public.gmane.org>
2014-10-03 14:50                   ` Ken Kleinman
     [not found]                     ` <c4a5f8d6-a674-4ffd-8f90-afa87647f069-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-10-16 21:15                       ` Gavin Swanson
2014-10-03 14:39           ` Jesse Rosenthal
2014-10-03 14:27       ` John MacFarlane
2015-04-20 17:05   ` hjallen44-Re5JQEeQqe8AvxtiuMwx3w
     [not found]     ` <2085f4cb-d713-4975-a739-9ad775cd37c4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-04-20 17:17       ` John MacFarlane
     [not found]         ` <20150420171718.GB49983-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-04-20 17:35           ` hjallen44-Re5JQEeQqe8AvxtiuMwx3w
     [not found]             ` <86515234-38b7-4fa5-8d21-0c94fe3cf9f6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-04-20 18:31               ` fiddlosopher
     [not found]                 ` <253add6a-b873-4a1c-ad97-3dadf4c7ed1f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-04-22 13:28                   ` hjallen44-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                     ` <f65a84c9-7e2f-4ba1-a092-0c52f5f79186-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-04-22 15:44                       ` John MacFarlane
     [not found]                         ` <20150422154425.GC52517-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-04-22 16:59                           ` hjallen44-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                             ` <2f0fdd14-9f3e-4aa7-9d9c-756cc82f3a5d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-27 22:52                               ` JO
     [not found]                                 ` <0ef1e813-31dc-4c69-b37b-2114f4c4621a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-28 17:59                                   ` 'Jason Seeley' via pandoc-discuss
2016-08-29 20:45                               ` joel allen
     [not found]                                 ` <a1dc8029-bc47-49d4-a55f-0c035c076ba5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-06-13 11:03                                   ` endymionselenicz-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                     ` <6ecc8d08-7c6d-4e76-8b35-004176e6af4b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-07-22 11:33                                       ` Jonathan Van Belle
2019-01-21 21:07                                       ` sonya.mamurin-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                         ` <f2152eb3-5e8e-42b7-9450-72035339de40-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-02-15 18:17                                           ` sonya.mamurin-Re5JQEeQqe8AvxtiuMwx3w
2015-05-30 15:41                       ` amygroshek-Re5JQEeQqe8AvxtiuMwx3w [this message]
     [not found]                         ` <9c2658ec-c79f-4dd7-b403-21c88dc93bc4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-30 17:13                           ` Jason White
     [not found]                             ` <20150530171323.GA20492-4VuKTzg51y8@public.gmane.org>
2015-12-09  1:58                               ` Courtney Campany
     [not found]                                 ` <81dcb1b1-eb5a-4bb6-afdc-3ce9542d2cdb-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-12-11 13:49                                   ` Andrew Dunning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c2658ec-c79f-4dd7-b403-21c88dc93bc4@googlegroups.com \
    --to=amygroshek-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).