(I asked this on StackOverflow a couple of days ago. No answers so far, so I’m cross-posting here.)
imglist = () -> list = [ #begin-preprocess read-from-img-dir #end-preprocess ] return list
How can I configure Atom to call a preprocessor when the file is saved to produce input like the following to the coffeescript transpiler?
imglist = () -> list = [ "img/foo.jpeg", "img/bar.jpeg", # ... ] return list
Just to be clear, I’m not asking how to write the text processing code in the example above – reading and reformatting filenames is easy. I’m asking whether Atom has hooks I can use to
- Pass the edit buffer text to a preprocessor, and
- Pass the output of the preprocessor to the coffeescript transpiler.