As a powerful text editor in WindowsMacLinux, st provides support for the Markdown language. Markdown preview and conversion can be achieved through settings. The MarkdownPreview described in this article supports the automatic generation of Mathjax syntax and directories. (IN Windows) Installing the PackageControl installation package control extension allows you to easily add extensions for the st
As a powerful text editor in Windows, Mac, and Linux, st provides support for the Markdown language. Markdown preview and conversion can be achieved through settings. The Markdown Preview described in this article supports the automatic generation of Mathjax syntax and directories. (IN Windows) Installing the Package Control installation Package Control extension can easily add extensions for the st
As a powerful text editor in Windows, Mac, and Linux, st provides support for the Markdown language. Markdown preview and conversion can be achieved through settings. This article introducesMarkdown PreviewSupports automatic generation of Mathjax syntax and directory. (IN Windows)
Install Package Control
The installation package control extension allows you to easily add extensions for the st.
Open st, press the combination key 'control + '', And the Console appears. Enter
import urllib2,os; 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( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
When the last line of the Code is displayed, it indicates that the installation is successful. Restart st at this time.Preferences -> Package SettingsSeePackage Control.
Install markdown preview
Press the keyCtrl+Shift+pCall up the command panel and findPackage Control: install PakageThis item. Search for markdown preview and click Install.
Use
The common functions of Markdown Preview are:preview in browserAndExport HTML in Sublime TextThe former can be viewed in the browser, and the latter can save markdown as an html file.
preview in browserIt is said to be real-time, but in practice, it still needs to be saved in the st, and then the browser refresh to see the new effect. Fortunately, if markdown writes a lot, you do not need to refresh the line each time to see the effect.
Shortcut Key
St supports custom shortcut keys,markdown previewNo shortcut keys by default.preview in browserSet the shortcut key. The method is inPreferences -> Key Bindings UserAdd the following code to the brackets of the opened file (the format can be found in Key Bindings Default ):
{ "keys": ["alt+m"], "command": "markdown_preview", "args": { "target": "browser"} }
"Alt + m" can be set as your favorite button.
Set syntax highlighting and mathjax support
InPreferences ->Package Settings->Markdown Preview->Setting DefaultLines 31st and 36 in
/* Enable or not mathjax support. */ "enable_mathjax": false, /* Enable or not highlight.js support for syntax highlighting. */ "enable_highlight": false,
Change the two false values to true.
Syntax highlighting is related to the subject of the editor.Preferences ->Color SchemeFind your favorite theme.
For directory generation, as long as the article is written in accordance with the markdown syntax. Write where the directory needs to be generated
[TOC]
You can.
If you do not see the directory but only the code, it means that the simple book does not support automatic directory generation.
Print to pdf
There are many ways to convert markdown to pdf. I did not try any more. I directly used Google's Web browser's virtual printing function to generate it.
ExploitationMarkdown PreviewOfPreview in BrowserYou can see the htm effect in the browser. On the pageRight-click and choose print> Save as pdf> adjust margins.You can download the PDF file.