From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17823 Path: news.gmane.org!.POSTED!not-for-mail From: endymionselenicz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Newsgroups: gmane.text.pandoc Subject: Re: How to get a page break (/f) from Markdown -> docx? Date: Tue, 13 Jun 2017 04:03:24 -0700 (PDT) Message-ID: <6ecc8d08-7c6d-4e76-8b35-004176e6af4b@googlegroups.com> References: <65081506-a54b-4aff-96a0-d8e1cb6accc2@googlegroups.com> <2085f4cb-d713-4975-a739-9ad775cd37c4@googlegroups.com> <20150420171718.GB49983@localhost.hsd1.ca.comcast.net> <86515234-38b7-4fa5-8d21-0c94fe3cf9f6@googlegroups.com> <253add6a-b873-4a1c-ad97-3dadf4c7ed1f@googlegroups.com> <20150422154425.GC52517@localhost.hsd1.ca.comcast.net> <2f0fdd14-9f3e-4aa7-9d9c-756cc82f3a5d@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3862_909685056.1497351804205" X-Trace: blaine.gmane.org 1497351806 25357 195.159.176.226 (13 Jun 2017 11:03:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Jun 2017 11:03:26 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCMJRA4VUQMRB7EM77EQKGQEOV26QBI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 13 13:03:20 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io0-f185.google.com ([209.85.223.185]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKjbU-0006G5-3B for gtp-pandoc-discuss@m.gmane.org; Tue, 13 Jun 2017 13:03:20 +0200 Original-Received: by mail-io0-f185.google.com with SMTP id f79sf11235654ioi.1 for ; Tue, 13 Jun 2017 04:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=0IhupXnYFYjZUx9VMEL8kpCjcpZpxQMmQyahFK1gMNg=; b=maXKkehD8pHthsE3EFyizLSHCgA/oVHM44tRS7Sr8T95LDM9oO1Yoc+9bznZbHdZ00 P5cBfU0dnePx/mntjMVynjTs/aDpYA1isEyD+mYtogSDDHfiMStWW2McTRpd6oldDd0Q ghdxY4R/fCi7vYHO8XGHaMW81EBoUMygfua+4PsqKbVh+Ixcpwbah94aS7/I4EGr/zET 9G9bMPpeLsZNZrSmYogO5OtuDSSJCsQk2LaY8eE11omAlYt9OWf7+mO6YHFiufjNvLtu 66vDsTPqwagiGVQqawG3GfPAwh+rupKggwwmzLeJ2I8Y8fviqOblFlEkQ+8QbHwLffjI bvFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=0IhupXnYFYjZUx9VMEL8kpCjcpZpxQMmQyahFK1gMNg=; b=CHetDCsXuXBbgpea9UIX5h7uuX18JRLwsptOXLRX8Cu0J4Yok+0P6gDKWFRg0Fdi9T 4fpAFTnbyPpZOtg9tpl7T19rL7pQBlyOokKJsPqX3vYeiyT7j6jT9fNsaRu9WjQvJPVk lAvAz0ZfPb2Sss1MK4PXrHSIWHb2qWt+HuybeKHQnQlOm1e8E9M/1wKmCd3Q+q4Trn8H CcOEVe/gWNiIrvXDRnYGYs3DDhizS4WD6p2DwT059Uv0lSx4pBUD/iGbWv1yvk1tTNH7 GwuoGt0MUx4LDXqqaNJ53E8NtGSZVNxqOPXi6qsmRAp75vQNF1X69L9LKBcqV+zTYqFo coXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=0IhupXnYFYjZUx9VMEL8kpCjcpZpxQMmQyahFK1gMNg=; b=RdZX/r7rxVqTE1wQ8w7HmAFVcEIZphDs30Df+L4BNhRvZSKSR5mY2bIY9/rb7iHe2d J44YNiyS6K5t4+eR6sCWm6hqJaF1DdQA7jzsGEXHGbZrO+5LUbPv9kknfyPqv5u5s6hN a5xsP3SU2Qk9nmFSQlMZzGl1xgC4vcQuuOVxuv6/JqDOI7zT/BA3SeUCauoImP1JvQK/ 6hRsPBCdjRlYF1ws1JJ5IH/ZIsma/ZZnZYmF+78bC6XM4J2wX2t2N2y4KXDo0C/RxZeG zYRx8v1s7DJWuzRtP5TvZIBy+BBybkmV+EEsjhXCfm4Gdz0v9uyXUHcViWMor9EX/6Ys VtDg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKS2vOwdVGNtVbEnZxmYFsq5AKRczVrM/4vAuS+1Jh7j1HbrLDTVY3k7 U8u1kVPs/7LN4A== X-Received: by 10.157.13.169 with SMTP id 38mr123026ots.6.1497351805211; Tue, 13 Jun 2017 04:03:25 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.45.44 with SMTP id v41ls579114ota.15.gmail; Tue, 13 Jun 2017 04:03:24 -0700 (PDT) X-Received: by 10.157.52.232 with SMTP id t37mr123613otd.15.1497351804721; Tue, 13 Jun 2017 04:03:24 -0700 (PDT) In-Reply-To: X-Original-Sender: endymionselenicz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:17823 Archived-At: ------=_Part_3862_909685056.1497351804205 Content-Type: multipart/alternative; boundary="----=_Part_3863_291160719.1497351804205" ------=_Part_3863_291160719.1497351804205 Content-Type: text/plain; charset="UTF-8" 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 = "
" 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 -- 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/6ecc8d08-7c6d-4e76-8b35-004176e6af4b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_3863_291160719.1497351804205 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 brea= k command from Markdown to ICML.
I needed this very much for my master&= #39;s thesis. I am very grateful for your sharing your knowledge. The code = I used is this.

#!/usr/bin/env runhaskell
-- icmlpagebreaks.hs

import T= ext.Pandoc.JSON
import Text.Pandoc
import Text= .Pandoc.Walk (walk)

pgBrkIcml
:: Strin= g
pgBrk= Icml
=3D " <CharacterS= tyleRange AppliedCharacterStyle=3D\"CharacterStyle/$ID/[No character s= tyle]\" ParagraphBreakType=3D\"NextColumn\"><Br/>&l= t;/CharacterStyleRange> "

pgBrkBlock
:: Block
pgBrkBlock
=3D = RawBlock <= /span>(Format "icml") pgBrkIcml

insertPgBrks ::
Block -> Block
insertPgBrks
(Para [Str "\\PAGEBREAK"<= span style=3D"color: #660;" class=3D"styled-by-prettify">]) =3D pgBrkBlock
insertPgBrks blk
=3D blk

main
=3D toJSONFilter insertPgBrks=

At the moment, it looks like it's wo= rking. I hope it is correct. Thank you again, cheers

David

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/6ecc8d08-7c6d-4e76-8b35-004176e6af4b%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_3863_291160719.1497351804205-- ------=_Part_3862_909685056.1497351804205--