ubuntu article --- download and install the open source markdown editor MarkText

ubuntu article --- download and install the open source markdown editor MarkText

Download and install MarkText on ubuntu

1. Download MarkText

MarkText is an open source markdown editor, we can download it through its official github address:

GitHub - marktext/marktext: A simple and elegant markdown editor, available for Linux, macOS and Windows.

  Download the corresponding file according to your own operating system, MacOS downloads .dmg, Windows downloads .exe, Linux downloads .AppImage, my Linux is Ubuntu64-bit operating system, so download the corresponding .AppImage file

About .AppImage files

  AppImage uses a common software format, and the entire software is packaged into AppImage. One package contains all functions, and it can be used in almost all Linux distributions. AppImage is a compressed image file that contains all dependencies and library files needed to run.

 AppImage有以下一些特点:
  • Can run on various platforms
  • No installation required, can be executed directly
  • Deletion is convenient, just delete the AppImage file
  • Do not modify system files

2. run

Run Markext, create shortcuts, write .desktop files

insert image description here
  This is the downloaded .AppImage file. We need to give it executable rights. Before that, we can change the owner of the file to ourselves instead of root, so that no root permission is required for future operations on the file.

mv [当前文件路径] [目的文件路径]  // 转移文件到我们想要存放的地方
sudo chown [用户名] [文件或目录名] // 修改文件所有者
chomd +x marktext-x86_64.AppImage // 可执行权限

3. Desktop icons

  In order to make it easier for us to double-click on the desktop to open the software like using windows, we need to write a **.desktop** file on the desktop

touch marktext.desktop
vim marktext.desktop

The content of the file is as follows:

[Desktop Entry]
Name=MarkText
Comment=Next generation markdown editor
Exec=/opt/soft/markdown/marktext-x86_64.AppImage %F
Terminal=false
Type=Application
Icon=/opt/soft/markdown/marktext.png
Categories=Office;TextEditor;Utility
MimeType=text/markdown;
Keywords=marktext;
StartupWMClass=marktext
Actions=NewWindows
StartupNotify=true

[Desktop Action NewWindows]
Name=New Window
Exec=/opt/soft/markdown/marktext-x86_64.AppImage %F
Icon=/opt/soft/markdown/marktext.png

There are several parameters in this file that need to be modified by yourself, and the rest can be copied directly

Exec=AppImage文件所在的绝对路径,后面的%F务必加上,为关联文件,跟后面的右键添加打开方式有关
Icon=软件logo所在的绝对路径,软件的logo图片下面给出
其他属性的说明可以参考文末最后一个参考连接

insert image description here
After writing the desktop file and saving it, right-click the file to allow it to run, and then double-click the file to open the marktext

insert image description here

If you want to display shortcuts in the menu, you can copy this file to the **/usr/share/applications** directory

sudo cp marktext.destop /usr/share/applications

4. Add the right-click shortcut to open

Enter defaults.list , add a line of code

cd /usr/share/applications
sudo vim defaults.list
在最后一行添加:text/markdown=marktext.desktop

insert image description here

OK~, you can see that there is already a way to open marktext!

Guess you like

Origin blog.csdn.net/m0_46825740/article/details/129861437