今天在慕課網(wǎng)上看 scott老師講的node+mongodb 建站攻略(一期)
就在自己親手實(shí)踐的時(shí)候發(fā)現(xiàn)jade語法沒法高亮. 我的開發(fā)平臺(tái)是ubuntu,工具是sublime3,sublime3之前就有沒法中文輸入的問題,所以還是老思路,在網(wǎng)上找插件
(1)打開sublime3,再打開 view > show console,把下列代碼復(fù)制到console框內(nèi)
import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
如果你是sublime2,請(qǐng)粘貼下列代碼
import urllib2,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
在底部欄會(huì)看到顯示導(dǎo)入pakeage control成功
(2)重啟sublime,然后在 preferences >package control >選擇package control: install package >再在選框中輸入 jade >然后重啟,即可看見jade語法高亮了
參考資料package control