A repository for windows command file that makes allows easy compilation of coffeescript in Notepad++. It is distributed under MIT licence.
First you will need the node.js coffeescript compiler for windows. Steps for obtaining this are described at http://www.davidarno.org/2012/02/02/beginners-guide-to-using-coffeescript-on-windows-with-node.js/
In order to install the command file, please follow these steps.
-
Clone this repository (https://github.com/obromios/coffee_short_black) or download and unzip the zip file.
-
Copy the short-black.bat file to a suitable location e.g. c:\Program Files\coffee_short_black
-
Choose or create a temporary directory for the temporary files, e.g. c:\temp
-
Open Notepad and click on "Run", and then choose "Run...". This will bring down a small file selection menu.
-
Use the file browser to navigate to the short-black.bat file and select it.
-
In the file selection menu, click on the file name, go to the end, and add "$(FULL_CURRENT_PATH)" "" where is the full path to the temporary directory.
-
Using the examples above, the line would now read
c:\Program Files\coffee_short_black "$(FULL_CURRENT_PATH)" "c:\temp"
-
Click on "Save..." and save with a name "coffee_short_black" and choose a convenient short cut eg. ctrl/shift C.
-
Now open a coffee script file in notepad, and either use your short cut, or go to the Run menu, and click on the coffee_short_black option towards the bottom of the dropdown.
-
If there is a compile error, then a message will occur in a new dos window. Press any key in the dos window to dismiss the message.
-
If there is no message, then the file has compiled successfully. You can see the resultant javascript by using Notepad++ to open the compiled file which is output.js.js in your temporary directory. Using the examples above, this would be at c:\temp.output.js.js.
-
If you leave the output.js.js file open in notepad, then next time you successfully compile a coffeescript file, Notepad++ will automatically switched to the output.js.js file.
This utility follows the twee naming convention for coffeescript utilities that ties it to some coffee related name. I am based in Sydney Australia where an espresso coffee is called a "short black".
Chris