help-nano
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using formatter


From: Robert Goulding
Subject: Re: Problem using formatter
Date: Sun, 24 Jul 2022 10:13:25 -0400

That works perfectly - thank you! - Robert.

On Sun, Jul 24, 2022 at 2:42 AM Benno Schulenberg <bensberg@telfort.nl> wrote:

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


--
Robert Goulding
Director, John J. Reilly Center for Science, Technology, and Values;
Director, Program in History and Philosophy of Science;
Assoc. Professor, Program of Liberal Studies,
Fellow, Medieval Institute,
University of Notre Dame.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]