From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23463 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?5bGx5pys5LiA6LK0?= Newsgroups: gmane.text.pandoc Subject: Re: Number concatenated chapters (Was: concatenating md have a page-break between in resulting docx?) Date: Wed, 25 Sep 2019 19:25:18 +0900 Message-ID: References: <236f815f-2db1-4ee2-30d0-5794cd6301b3@reagle.org> <83bd8e54-4c7f-2fd7-966e-fe2fb55755bd@reagle.org> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007046a105935e12a1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186880"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCY7J2HL3ALBBGUBVXWAKGQEBOSULYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Sep 25 12:25:34 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf1-f186.google.com ([209.85.210.186]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iD4UH-000mOr-LE for gtp-pandoc-discuss@m.gmane.org; Wed, 25 Sep 2019 12:25:34 +0200 Original-Received: by mail-pf1-f186.google.com with SMTP id w126sf3622397pfd.22 for ; Wed, 25 Sep 2019 03:25:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569407131; cv=pass; d=google.com; s=arc-20160816; b=uln+O6uQMNv48HVbniWbQnd1DFYtQSpLm5EApcuVswb2n9F4nQQqiqZD09v4hUarXR D8uDCOe9oHgubtgqq3wRkW0yZXbzwa3h7Rv0mObdtKORy/tRxYo/B0K5EONnsl6sF9MS 5CJLH+UEflVGvE+GOnG9TtweeEx+ealLWY4FZwoNKY6svIILVbXH4TVEoyN23img1G9L QhLmnau867m8IJnlwc2h6tEcnq5T4bQffKnZBWqCLC0PltAPInSH6Kl04G44Ir/zWIVp Uae+6kPrBoCPzOFDYE/lP4AG6vvtnmNFzBtoSs451YfCAqoQiDaXPjxaRMkWGBH5f/U0 m/OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=tcgd4aaPSGPRzTVzC56INNtyjLVaS3+dBJoFxYwcEIs=; b=QbzYaFieUXbCSLtJE0GG+PrBFeLy1JIvUr/jSWIpN747jbMrtpjget98rKRRvxe3GQ PrO9RrlSTTKnq+fpQLHOFDocPcTyEC4Olg0Av/GJF9AUPlV13EjFNgbd73S9ouxCMKMX d6yyJVGtLSIWK+gy65xwjETlm3Mniw7ecmuXd/SB0/AKGZ7IGdCazAo/DUUJ6ZnyUey9 CCp9JiOWDuIloj+qxeAqtkC8Z0X+FT8hQ1ioqHqdswN5FqHKjS1OjFeYzBKXucR0mCFt 3GY6vBGGuNz7iRPJXUxYoXrZ6WVQd6E3j7TU6jBNK5rvGVB+7CBPvJDDN4M1JkGT/2kE 1M/g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJY09jAM; spf=pass (google.com: domain of k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=tcgd4aaPSGPRzTVzC56INNtyjLVaS3+dBJoFxYwcEIs=; b=bdMs6X+XYdiSLHBs0Vu5TQJh9gBMIvGMzgFumvL+cjTmN1kDDLhom6ZYj82FL5/9VD NpADTIY4ZZ761+eHo7ZnfP0dG4qy1Y55FpISBWPrMgzBmR28mSv0wk0tYKiQtkqL5kaH KbS0dK5LrvYo1uWn4Y2p2fRTPLpcBbN84BBtjBee8JCKVimJl0orlPG777k3OQ902D06 D4U5J/7LAh2Lgk0w8O2M997E8IscEbjuZ2aY1iufoOW0SjZ+/pif5WFFJB3/zQo5uXod pW8ru2kQc2HkDak0VoL15C3AbaPWpUGllZoBN2TxZrWnCqEYwTYzdoSr5SnkCrdxDeOR GY9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=tcgd4aaPSGPRzTVzC56INNtyjLVaS3+dBJoFxYwcEIs=; b=ge9l4zLxOWRYn075hgc37/TEKYtWx/OgVTYdR2T6Mbo3jggFLFHQHJGwllQO3BMElv RvAYLDLf08R+zFZFxl36firkrxfrGlW6eYEvzVDIIhcpGGRxCFXx1Jdi5n2bbdET82Oe BHmhGe5T46g5PalHlYOv/h9SX9S+BNnPp1sr12nPmbm4TP0E6L1oRyXuoi/iOg7OU/Fg WCWPPFIyi3TyqVDPIg9x47b95FkxQ71flOERdnhhoaag8ZdEKIojIIFI00B9fLKgqA3a h8YPo1zGwKaxhqjqY9g2hHjpxPAp+BUFY19tF9w37vQzisfjitM893wm8v+/Ds5UJuF2 h6pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=tcgd4aaPSGPRzTVzC56INNtyjLVaS3+dBJoFxYwcEIs=; b=edDVxZjBe8brn6e0aHJyCW6UO/X+edMjccf3BuX6ELyV2nPddgTF0MSYFzV0PjhTT/ Z5bxeES3IiddpMnGkKpxaUMukprcPjjW7SxejonzsjJBEEEaQpFoRoBYBW77WVX+HM+Y fqCAz3J3m2oy2NiewLOOP7u76iHNAkWVIDEmIKOQuESV9peq/581UfD0crZPsYWB6Iy6 7zLi8v7vZ5VUiJbZ5ssRz+ub1v18zrkK+sNOCRHeXcvsMgSShGnO+A4I6S2cxNPSvk7C 8e/69YbFQBUPiSJ4SGgnLNyoDdSfkvyc1uUGAzxPHC0ZyeP9DdhSjeP8kGeA7d68SdLj BQ4A== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWxC91onr1BOB4H7vtL8gAoiPoQAZil78HmaXwfmwvKBVOvtJsF IrAoz7kJFjlRiE8IAARqvqE= X-Google-Smtp-Source: APXvYqwOy5s9FFXo8cyC6Ae8vnCTx+VCuJlc38ntl8gbsLQgvXPc7F0z9tIxs/b8p11Z10UEZcMZsQ== X-Received: by 2002:a17:90a:a2b:: with SMTP id o40mr5653055pjo.107.1569407131318; Wed, 25 Sep 2019 03:25:31 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:9b08:: with SMTP id f8ls613383pjp.3.canary-gmail; Wed, 25 Sep 2019 03:25:29 -0700 (PDT) X-Received: by 2002:a17:90a:cb07:: with SMTP id z7mr5538878pjt.67.1569407129649; Wed, 25 Sep 2019 03:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569407129; cv=none; d=google.com; s=arc-20160816; b=zaIwB7LMU/pU23bGHeRPQsX9G4H0bTINO0n7bKfIQBVL/wE85uoT3gNJiLs1M/gmf3 XxA9BwXWBNUkQkPgumYHY0XoCHdJXHJgz7vhMzfr2Yd8/ZgeTEhj1fNIO33Wp69vWBYo mN1dkNybYN7THv9wKfzlXxmQNOlcHYstUc8ien9Ns5iTpJmghaX0I9CPxmXoHv26prV6 H0oZpcgAEQNQ5W8oAJr02ptGnSxyst99SOr1RarlpiFzK02CF5vV89Tb+EXQTYxaOS8T iTHVw4Pv5bzEKoFjy7NhlmrZO1HKN+4HOAqIPrjEot+69J8Dzjg1fM4MnIbokOuGGHIU bLsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HGQooa2vP2xvMLYRDon9VLCXRWJGQafiAwEYiTsKLMI=; b=eD31vML43f+2iKaJlBpuEpw92c8eVhZd854HNeQnvBv6JFBWhikLZm5IsgpIO4vXsM Nq79MorAYognSpPNKWZDL04GdtQXQEPgaLqA+W4R1eUj8CeqWzPFSmgDwD5WNzfZv/b7 T21C1buPgQvW9f47zhErBg7cMobzR8tFRcod4wa5hQUP9O+gaoXOZ9wLKdo48vli5NmH oM2VGgkzuMcxfJ1rOOHye1jVBCcNtkPocUsFUPVJlsgd9H5IwfYxJ9j43rHDz0gsNYi6 r9In0CLGq+goWW3Nf/jJEnsG/thCtgbcgAClMcgz1KJzJN0hkX7JZQrFlwNg0zVzcPNr N4Dg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJY09jAM; spf=pass (google.com: domain of k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com. [2607:f8b0:4864:20::d2f]) by gmr-mx.google.com with ESMTPS id x2si348339pfq.3.2019.09.25.03.25.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Sep 2019 03:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d2f as permitted sender) client-ip=2607:f8b0:4864:20::d2f; Original-Received: by mail-io1-xd2f.google.com with SMTP id h144so12371676iof.7 for ; Wed, 25 Sep 2019 03:25:29 -0700 (PDT) X-Received: by 2002:a02:48e:: with SMTP id 136mr4568088jab.20.1569407129108; Wed, 25 Sep 2019 03:25:29 -0700 (PDT) In-Reply-To: X-Original-Sender: k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NJY09jAM; spf=pass (google.com: domain of k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=k.yamamoto.08136891-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:23463 Archived-At: --0000000000007046a105935e12a1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, My pre-processing lua filter might give a hint for you. https://github.com/pandocker/pandocker-lua-filters/blob/master/lua/preproce= ss.lua (I know this filter implement is not great. PR welcome btw ) 1. make another md file ("base.md" for example) to include files by your order like: ``` markdown # #include "0-01-reagle-koerner.md" # #include "1-00-hindsight.md" # #include "1-01-reagle.md" # #include "1-02-benjakob-harrison.md" # #include "1-03-hill-shaw.md" ``` 2. let pandoc process with base.md and the filter pandoc -t docx --lua-filter=3Dpreprocess.lua base.md -o out.docx 3. the out.docx is equivalent to concatenated files by your order 2019=E5=B9=B49=E6=9C=8825=E6=97=A5(=E6=B0=B4) 17:10 Agust=C3=ADn Mart=C3=AD= n : > > In addition to adding page breaks between the chapters, I'd like to hav= e > the title (first level-1 heading, in this case) prefixed with an chapter > number taken from the file name. I want to do this dynamically, as I migh= t > rename/resort/reorganize the files based on their names. > > I'm not sure if you're artificially complicating matters. Both things can > be achieved simply by modifying your reference-doc heading styles, having > first level heading include a pagebreak before, and being numbered. Then > you can put any name to the files (numbers if you like for sorting), and > all your chapters will be sensibly numbered (independently of what the na= me > of the original file was). > > > > On Monday, September 16, 2019 at 10:15:49 PM UTC+2, Joseph wrote: >> >> >> On 9/5/19 4:48 PM, Joseph Reagle wrote: >> > ``` >> > for f in *-*-*.md; do cat $f page-break.md; done > test.md >> > ``` >> >> In addition to adding page breaks between the chapters, I'd like to have >> the title (first level-1 heading, in this case) prefixed with an chapter >> number taken from the file name. I want to do this dynamically, as I mig= ht >> rename/resort/reorganize the files based on their names. >> >> So, for example, `1-01-reagle.md` is the first chapter in the first >> section, and could have '1.' prefixed to its first heading. In looking a= t >> filters, especially panflute, all the examples are of stand-alone filter= s >> that are stateless between invocations... >> >> ``` >> 0-01-reagle-koerner.md >> 1-00-hindsight.md >> 1-01-reagle.md >> 1-02-benjakob-harrison.md >> 1-03-hill-shaw.md >> ``` >> >> Any suggestions? >> >> -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/d4057f17-ab65-4bb4-afb4-= 7ec97ab3cb22%40googlegroups.com > > . > --=20 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 e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAPBn7noaBRW%2Bg%2B_Opvb28MPrW1w1rnLC1LSyrU8xSES3%3Dt6OYg%40= mail.gmail.com. --0000000000007046a105935e12a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

> In addition to adding page breaks between the chapters, I&#= 39;d like to have the title (first level-1 heading, in this case) prefixed = with an chapter number taken from the file name. I want to do this dynamica= lly, as I might rename/resort/reorganize the files based on their names.
I'm not sure if you're artificially complicating m= atters. Both things can be achieved simply by modifying your reference-doc = heading styles, having first level heading include a pagebreak before, and = being numbered. Then you can put any name to the files (numbers if you like= for sorting), and all your chapters will be sensibly numbered (independent= ly of what the name of the original file was).


On Monday, September 16, 2019 at 10:15:49 PM UTC+2, Joseph wrote:
On 9/5/19 4:48 PM, Joseph Reagle wrote:
> ```
> =C2=A0for f in *-*-*.md; do cat $f page-break.md; done > test.m= d
> ```

In addition to adding page breaks between the chapters, I'd like to= have the title (first level-1 heading, in this case) prefixed with an chap= ter number taken from the file name. I want to do this dynamically, as I mi= ght rename/resort/reorganize the files based on their names.

So, for example, `1-01-reagle.md` is the first chapter in the first sec= tion, and could have '1.' prefixed to its first heading. In looking= at filters, especially panflute, all the examples are of stand-alone filte= rs that are stateless between invocations...

```
0-01-reagle-koerner.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0
1-00-hindsight.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 =C2=A0 =C2=A0
1-01-reagle.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0
1-02-benjakob-harrison.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
1-03-hill-shaw.md
```

Any suggestions?

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https:= //groups.google.com/d/msgid/pandoc-discuss/d4057f17-ab65-4bb4-afb4-7ec97ab3= cb22%40googlegroups.com.

--
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 view this discussion on the web visit https://g= roups.google.com/d/msgid/pandoc-discuss/CAPBn7noaBRW%2Bg%2B_Opvb28MPrW1w1rn= LC1LSyrU8xSES3%3Dt6OYg%40mail.gmail.com.
--0000000000007046a105935e12a1--