LeaVerou / brep

Write batch find & replace scripts that transform files with a simple human-readable syntax
12 stars 0 forks source link

A way to output result files in another folder #6

Closed DmitrySharabin closed 2 months ago

DmitrySharabin commented 2 months ago

Experimenting with https://github.com/LeaVerou/phd/issues/6, I thought how nice it would be if Bafr supported this feature. In that case, we could keep temporary .tex files in one place and remove them in one shot when we no longer need them.

It would be nice if we could specify such a folder either as a CLI parameter or a global setting (or both). I'm unsure about the parameter's name. At first, I thought of something like folder, but with the files setting, it might be seen as a folder where the source files live. Another option might be output.

Suppose we go with output, then we can do the following:

bafr script.bafr.yaml --output=processed

And

files: content/*.md
output: processed
replace:
- from: <br>
LeaVerou commented 2 months ago

Yup, I was thinking of that too. I think path would make more sense. The path would be resolved relative to the file’s existing path if relative, so we could do things like path: ...

LeaVerou commented 2 months ago

This has now been implemented.