public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Merging and converting a Windows folder?
Date: Thu, 19 Jan 2023 10:28:40 +0100	[thread overview]
Message-ID: <CADAJKhCQ0w7VXPPYBvE=0qJ7ip1TyMe3bWvJH3oGmF1b4tuBnA@mail.gmail.com> (raw)
In-Reply-To: <8da3b66e-f14a-49d3-9b65-826df906073an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2490 bytes --]

You can just list the files on the command line as multiple inputs and
pandoc will merge them automatically:

pandoc -o merged.ext chap-1.md chap-2.md chap-3.md

(where .ext is .html, .pdf or whatever.)

Tip: if the files have different names you can give them leading
zero-padded (all with the same number of digits) at the start of the file
names:

0010-foreword.md
0020-introduction.md
0030-problem.md
0040-this.md
...
0070-that.md
...
0100-conclusions.md

And then you should be able to just say

pandoc -o merged.ext *.md

and the files should be correctly ordered by the shell.

The point of "spacing out" the numbers as I did above is that if you add or
rearrange a file you can just change its number to something intermediate
instead of renumbering all the files; e.g. if you want to move the "that"
chapter to before the "this" chapter you just rename it 0035-that.md. I
realize that e.g. in a dissertation you are not as likely to rearrange
chapters, but e.g. in documentation, where I work nowadays, it happens with
some frequency.

I hope this is helpful.

/bpj

Den ons 18 jan. 2023 15:58Robert Kingett <kingettspeaks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> I've tried to look online, for both a powershell command and a CMD
> command, possibly even a batch file, that would concatenate/merge multiple
> Markdown, .MD, files in a directory and then output it as one, merged,
> file, but nothing I've found works, so could someone point me in the right
> direction?
>
> --
> 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/8da3b66e-f14a-49d3-9b65-826df906073an%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/8da3b66e-f14a-49d3-9b65-826df906073an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CADAJKhCQ0w7VXPPYBvE%3D0qJ7ip1TyMe3bWvJH3oGmF1b4tuBnA%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3906 bytes --]

  parent reply	other threads:[~2023-01-19  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 14:58 Robert Kingett
     [not found] ` <8da3b66e-f14a-49d3-9b65-826df906073an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-18 21:41   ` John O'Regan
2023-01-19  9:28   ` BPJ [this message]
     [not found]     ` <CADAJKhCQ0w7VXPPYBvE=0qJ7ip1TyMe3bWvJH3oGmF1b4tuBnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-01-19 12:15       ` kingettspeaks-Re5JQEeQqe8AvxtiuMwx3w
     [not found]         ` <477e4f86-2bf8-cffd-1512-05441b8fdb42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-01-19 18:18           ` BPJ
     [not found]             ` <CADAJKhBcuFVLOSJHbb-9gYW1RqrdiLOrqCHb8aBPZETqeBtV2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-22 18:09               ` Robert Kingett
2023-01-19 20:44       ` Robert Kingett

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='CADAJKhCQ0w7VXPPYBvE=0qJ7ip1TyMe3bWvJH3oGmF1b4tuBnA@mail.gmail.com' \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@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).