Re: Problem using formatter
Robert Goulding <[email protected]> Sun, 24 Jul 2022 10:13:25 -0400
| Newsgroups | gmane.editors.nano.general |
|---|---|
| Message-ID | <CACE7msuxsqKuCi0F-5SoZ7GH6n6DK5CeQSWrgxp6Y5faBZ1qjA@mail.gmail.com> |
That works perfectly - thank you! - Robert. On Sun, Jul 24, 2022 at 2:42 AM Benno Schulenberg <[email protected]> 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.