The MarkText recommended in this issue is a simple and elegant open source Markdown editor.

MarkText is Markdown’s live preview (WYSIWYG) editor with a variety of functional Markdown extensions, our philosophy is to keep it clean, simple, and minimal. The application is built on top of Electron using HTML, JS, and CSS. Currently we are using some native node libraries and our UI is built using Vue/Vuex. MarkText can be divided into three parts: Muya’s core, main process, and renderer process.
Muya provides live preview and markdown editing through multiple modules based on a block structure. You can think of it as an editor backend, With modules for Markdown parsing, a data store as a block structure, Markdown document conversion according to CommonMark and GitHub Flavored Markdown specifications, and some additional specifications, event listeners, and exporters, To generate standalone HTML and Markdown files, as well as a WYSIWYG editor. Muya, like MarkText, is single-threaded and uses asynchronous functions to improve performance.
class=”pgc-h-arrow-right” data-track=”4″>
- Live preview (WYSIWYG) and a clean interface for a distraction-free writing experience.
- supports CommonMark Spec, GitHub Flavored Markdown Spec, and optional Pandoc markdown.
- Markdown extensions, such as mathematical expressions (KaTeX), front end, and emojis.
- supports paragraph and inline style shortcuts to improve your writing efficiency.
- Output HTML and PDF files.
- Various topics: Cadmium Light, Material Dark, etc.
- Multiple editing modes: source code mode, typewriter mode, focus mode.
- Paste the image directly from the clipboard.
class=”pgc-h-arrow-right” data-track=”20″>
interface
The sidebar consists of three panels, and you can switch the sidebar by pressing CmdOrCtrl+ J:
-
- Open the root directory of file system Explorer (tree view)
- Find
in the file
- The directory of the selected TAB
Switch tags
MarkText can be used as a single editor, but opens all files in a separate TAB. Tabs can switch B with CmdOrCtrl++Alt and reorder with drag and drop.
Open and modify markdown file
You can use the menu File -> Open File or press CmdOrCtrl+O to open the file dialog to select the reduced price file. Another way is to launch MarkText with a directory or file from the command line.
Save the file you edited
With some modifications, you can use a different file name by CmdOrCtrl+ Save file S or by using Save as .
Open a directory
MarkText also supports opening directories through CmdOrCtrl++ or the sidebar button Open Folder. After opening the directory, all files and directories are displayed in the view of the sidebar tree. The tree view allows you to open more files, browse and modify files or directories in the open root directory. Above the tree view is the location of all open files. You can also use Quick Open (+) to quickly open files from an open root directory or editor, and navigate by the arrow keys or select files by mouse. To view another sidebar panel, such as looking in a file, click the left sidebar icon.
class=”pgc-h-arrow-right” data-track=”37″>
You can control and modify all preferences or preferences.json in the application data directory for editing.
- General application Settings
- Settings that control the appearance of the editor
- Markdown related Settings
- Application theme
- How to handle the image options
class=”pgc-h-arrow-right” data-track=”44″>
Apple
You can either download the latest version from the release page with marktext-%version%.dmg or install MarkText using the homebrew cask. To use Homebrew-cask, you only need to install Homebrew.
brew install - cask tag text < / span > < / code > < / pre >
Windows
Windows simply download and install MarkText through the install wizard (), marktext-setup-%version%.exe then choose whether to install by user or machine wide. Alternatively, install MarkText using a package manager, such as Chocolatey or Winget.
To use Chocolatey, you need to install Chocolatey:
choco install marktext
other
Linux, macOS, and Windows all binaries can be downloaded from the release page.
Example
Open a markdown document and render it
MarkdownDocument is a document that represents a markdown file or untitled document on disk. To get the markdown document, you can use a function that asynchronously returns a RawMarkdownDocument (= with some additional information) in the main process loadMarkdownFile. MarkdownDocument
General steps to open a file:
-
- Click File -> Open File and display a file dialog box that issues the app-open-file-by-id file with the editor window ID to open the file and resolve the absolute file path in it.
- The application (App instance) tries to find the editor for the specified openTab and calls the editor window. If an editor window does not exist, a new one is created.
- The editor window attempts to load the markdown file, loadMarkdownFile and sends the result mt::open-new-tab to the renderer process via an event.
- Each open file is also added to the file system viewer, and the full path is saved to keep track of the files open in the current editor window.
< li data – track = “64” > the incident in the SRC/renderer/store/editor. The trigger in the js (renderer process), some checks and create a said on the document and the new document TAB status.
- The newly created TAB is either opened and file-changed issues an event, or simply added to the TAB state.
- Both Muya and the source code editor listen for this event and change the markdown document accordingly.
class=”pgc-h-arrow-right” data-track=”68″> Theme style
graphite lamp
—END—
Open source License: MIT License