今天在網上看 scott老師講的node+mongodb 建站攻略(一期)php
就在本身親手實踐的時候發現jade語法無法高亮. 個人開發平臺是ubuntu,工具是sublime3,sublime3以前就有無法中文輸入的問題,因此仍是老思路,在網上找插件。node
打開sublime3,再打開 view > show console,把下列代碼複製到console框內mongodb
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,請粘貼下列代碼ubuntu
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')
在底部欄會看到顯示導入pakeage control成功工具
重啓sublime,而後在 preferences >package control >選擇package control:install packageui
再在選框中輸入 jade >而後重啓,便可看見jade語法高亮了。url
本文來自PHP中文網的sublime教程欄目:https://www.php.cn/tool/sublime/插件