/meditor

Markup Editor for reStructedText and Markdown

Primary LanguagePythonMIT LicenseMIT

Markup Editor

Version Downloads

Markup Editor is a editor for reStructuredText and Markdown.

Tip

For bad performance, close "preview on input".

Feature

  • support Markdown and reStructuredText
  • Pygments to support Syntax Highlight
  • support MathJax
  • Format table
  • VIM mode
  • HTML Preview
  • Synchronize scroll with preview window
  • drag and drop
  • Multiple workspaces
  • Customized template
  • Peview CSS Themes
  • Multiple editor windows
  • support Markdown Graphviz

VIM

vim command:

h, j, k, l          # move left, down, up, right
~, gu, gU           # change uppper or lower case
w, b, e             # move forward or backward by word
0, ^, $             # move begin of line, first word of line, end of line
gg, G               # move document top and bottom
ctrl+f, ctrl+b      # page down and up
d, db, dw, D, dd    # delete back word, word, to end of line, line
y, yy, x, X, p      # copy, cut, paste
i, a, A, o, O       # insert, append, newline
<, >                # indent
J, I                # line join, and vertical insert
u, .                # undo and redo
/, :/, /<search>, s/<search>/<replace/  # search and replace
c, w, r             # selection change, read and write
n [file]            # new window

,f                  # format table

vim mode:

  • normal
  • insert
  • visual
  • visual block
  • command: :w, :q

MathJax

reStructuredText

inline:

:math:`E=mc^2`

block:

.. math::

    E=mc^2

Markdown

inline:

\( E=mc^2 \)

block:

\[ E=mc^2 \]
$$ E=mc^2 $$

Graphviz

Install Graphviz first! The command "dot" should be in syste m PATH. reStructuredText ----------------

.. dot:: svg
    :width: 100%
    :height: 100%
    :alt: image.svg

    digraph G {
        node[fontname="simsun"]
        edge[fontname="simsun"]

        rankdir=LR
        Earth [peripheries=2]
        Mars
        Earth -> Mars
    }

Markdown

{% dot attack_plan.svg
    digraph G {
        rankdir=LR
        Earth [peripheries=2]
        Mars
        Earth -> Mars
    }
%}

Install

in Linux:

pip3 install meditor --user

install with download from github:

# download source
git clone https://github.com/liuyug/meditor.git
cd meditor

# for Virtualenv
virtualenv ../virtualenv
# on Linux
source ../virtualenv/bin/activate
# on Window cmd
../virtualenv/scripts/activate
# on Window PowerShell
Set-ExecutionPolicy -Scope CurrentUser  RemoteSigned
../virtualenv/scripts/activate

# check version, above 3.5
python --version
pip --version

# install 3rd packages
pip install -r requirements.txt
# prepre data files
# ui window
bash ui.sh
# fetch reStructuredText documents
bash help.sh
# for Simple MathJax
bash math.sh
# for preview themes
bash themes.sh
# for icon theme that is used under win32
bash icon_theme.sh list
bash icon_theme.sh <theme name>
# install meditor
python3 setup.py install . --user

Note

If you run as user 'root' it need add environment variable "export QTWEBENGINE_DISABLE_SANDBOX=1" to disable sandboxing.

Screen Shot

check screenshot directory to view more Themes

screenshot.png

screenshot/screenshot_rst_solarized_light.png

screenshot/screenshot_md_infoq.png

Other

Iconset: NuoveXT 2 Icons by Saki