[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem using formatter
From: |
Benno Schulenberg |
Subject: |
Re: Problem using formatter |
Date: |
Sun, 24 Jul 2022 08:42:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
Op 23-07-2022 om 16:59 schreef Robert Goulding:
> And I'm guessing this is because pandoc sends the converted text to stdout.
> But
> according to the nanorc manpage, the formatter command sends the buffer to a
> temporary file, executes the command on the file, and then replaces the buffer
> with the modified file. But of course pandoc does not alter the file. It
> could be
> told to, with the output file option (-o) -- but how would I do that?
If the formatter program is unable to actually replace the file (that is:
doesn't know an option like sed's --in-place), then you'll have to write
a little wrapper script. For example:
#!/bin/sh
pandoc [other options] -o $1.formatted $1 &&
mv $1.formatted $1
Benno
OpenPGP_signature
Description: OpenPGP digital signature