-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Advanced Usage
MacDown ships with a utility at MacDown.app/Contents/SharedSupport/bin/macdown. You can use this to launch MacDown straight from the Terminal. I use the following Bash function to access it:
macdown() {
"$(mdfind kMDItemCFBundleIdentifier=com.uranusjr.macdown | head -n1)/Contents/SharedSupport/bin/macdown" $@
}Note: You need to first launch MacDown at least once for this command to work. This registers
com.uranusjr.macdownto OS X so thatmdfindrecognises MacDown by that identifier.
You don't need this Bash function if you install MacDown via Homebrew (which creates a soft link for you).
Open files with MacDown:
$ macdown file.mdwill open file.md if it exists, or create a new document with that name if it does not.
You can also open more than one document this way:
$ macdown file.md another_file.md yet_another_file.mdAlternatively, you can use open -b com.uranusjr.macdown file.md or open -a MacDown file.md. Using the open command will not launch MacDown if the specified file does not exist, and therefore also won't create an empty document in this case.