During my time at DevMountain, a couple of students knew they were going to miss a class and asked me to send copies of my notes [1, 2]. My notes’ files subsequently raised a fair number of questions and it became clear that other DevMountain students might appreciate knowing how to take notes in Sublime using Markdown.
Innovation comes only from readily and seamlessly sharing information rather than hoarding it.
Set Up Sublime
I figured most of this out from http://www.macstories.net/roundups/sublime-text-2-and-markdown-tips-tricks-and-links/. That article was at a high level, so there was way more detail than I really wanted to wade through. I’m also pretty sure there were several steps that turned out to be unnecessary. I believe you can get the same effect with just the following:
Install the Sublime Package Control packet manager. Literally open the link, click the “Install Now” button.
- Navigate to https://sublime.wbond.net/installation#st2
- Copy the appropriate code to your clipboard
- In Sublime,
ctrl-`
(note that is a backtick not a single quote; this opens Sublime’s console) - Paste the clipboard into the console that appears and press ‘return’
- Restart Sublime
Add the Markdown Preview Plugin [3]:
cmd+shift+P
Package Control: Install Package
Markdown Preview
Add the Markdown Preview Plugin [4]:
cmd+shift+P
Package Control: Install Package
LiveReload
Set Sublime up to display code highlighting [5, 6, 7]
- Ensure a highlighting-friendly Color scheme is being used [8] (e.g. Twigligth, idleFingers, Cobalt):
Sublime Text 2
>Preferences
>Color Scheme
> desired scheme - In
Preferences
>Package settings
>Markdown preview
>Settings - Default
, setenable_highlight
totrue
.
- Ensure a highlighting-friendly Color scheme is being used [8] (e.g. Twigligth, idleFingers, Cobalt):
Restart Sublime
Create a Markdown File
Setting up Sublime is a one-time process. Ensuring the file is recognized as a markdown file is a one-time per file process (but I promise, it’s a super-duper easy process!)
- Create the markdown document. Feel free to use the following to make sure you have everything set up correctly (and please feel free to copy-n-paste):
|
|
- Note that there should be:
- NO spaces in front of header tags (i.e.
#
). - There must be at least one space in front of bullet tags (i.e.
*
). - Inline code is surrounded by backticks (i.e.
`
; above the tab key on MacBooks), not by single quote marks (i.e.'
) - In my example, I’ve kept the definition tags (i.e.
:
) at the same level as their parent bullet. - I like definition tags when there are only one or two sub-elements. If there are more than one, I augment the definition tag with sub-bullets. If a list is deeply nested or lengthy, I tend to use just bullets and no definition elements.
- Refer to http://daringfireball.net/projects/markdown/basics and http://daringfireball.net/projects/markdown/syntax for more syntax, to include code blocks.
- NO spaces in front of header tags (i.e.
- Save the file as a markdown file:
1.cmd-s
2. The filename should end in.md
. If it doesn’t, you’ll need to explicitely tell Sublime to process it as Markdown. Of course, it’s easier - and better practice - just to give it the.md
extension.
Preview and Save the Markdown File
Command Sublime to open a preview in your browser. Note that this needs to be done whenever the file is opened, or there isn’t already a preview open in your browser.
cmd+shift+p
Markdown Preview: Preview in Browser
markdown
[8]
As you edit the document, remember to save it (
cmd-s
). Whenever you save it, the browser should do a Live Reload.
p.s. Footnotes are much, MUCH easier in Sublime’s markdown than they are in Hexo’s markdown!