Skip to main content
Author:

Ondřej Tůma <mcbig@zeropage.cz>

contributors:

The Formiko Team

Formiko is a reStructuredText and MarkDown editor and live previewer. It is written in Python with Gtk4, GtkSourceView and WebKit. It uses Docutils and a MarkDown-to-reStructuredText converter. If you want to donate to the development, you can do so via the paypal link.

Features:

  • GtkSourceView based editor with syntax highlighting

  • optional Vim editor support

  • vertical or horizontal window splitting

  • preview mode with auto scroll

  • periodic save file

  • json and html preview

  • spell check

  • linked file opening

It supports these parsers and writers:

Custom directives

Formiko registers additional directives that are available in both reStructuredText and MarkDown (via M2R2) documents.

.. file-tree:: <path>

Renders a directory tree rooted at path (relative to the source file) as a bullet list.

Options:

:depth: <n>

Maximum display depth. Default is 2.

:include: <pattern>

Show only files matching the glob pattern (e.g. *.md). Directories with no matching files are hidden automatically.

:exclude: <pattern>

Hide files matching the glob pattern. Applied after :include:.

:links:

Turn file names into hyperlinks pointing to the files, with paths relative to the source document.

Example:

.. file-tree:: docs
   :depth: 3
   :include: *.rst
   :links:
.. mdinclude:: <file>

Includes a Markdown file and converts it to reStructuredText inline. Requires m2r2. The directive is intended for Markdown files, but works in RST documents as well.

Options:

:start-line: <n>

Start reading the file from line n.

:end-line: <n>

Stop reading the file at line n.

Example:

.. mdinclude:: CONTRIBUTING.md
   :start-line: 3

Vim support

Formiko has Neovim editor support aka formiko-vim command. This runs Neovim editor in Vte.Terminal.

Requirements:

  • Python 3

  • GTK 4

  • gobject-introspection

  • PyGObject

  • WebKitGTK 6.x

  • GtkSourceView 5.x

  • libspelling 1.x

  • gir files for all Gtk libraries

  • vte - neovim support

  • docutils - reStructuredText support

  • jsonpath-ng - JSON Search path support

development:

  • pygobject-stubs

Installation

Flatpak

Formiko exists in the Flathub repository as cz.zeropage.Formiko. If you are new with Flatpak, see setup guide.

# add Flathub repository as root
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

# install Formiko as user
flatpak install flathub cz.zeropage.Formiko

# run Formiko
flatpak run cz.zeropage.Formiko

Debian based

Debian-based distributions sometimes use versions in package names. Here is an example for the Debian Forky version. If you use a different version, your gtksource or webkit2 may have a different version name.

# python3, gtk4 etc are in dependencies
apt install python3-pip python3-gi python3-docutils python3-jsonpath-ng \
            python3-pygments gir1.2-gtksource-5 gir1.2-webkit-6.0 \
            gir1.2-spelling-1 gir1.2-adw

pip3 install formiko --break-system-packages

# languages
apt install hunspell-en-us  # or other language you want

# neovim
apt install gir1.2-vte-3.91 neovim python3-pynvim

NetBSD

Broken at this moment - the WebKit with GTK4 and the libspelling packages are not available at this moment

Installation process can be different for each BSD releases. It’s about which Python release is default. By this, you can change py313 to your right version.

NetBSD use pkgsrc, so some binaries are stored in /usr/pkg/bin directory. Formiko call neovim directly. If you want to use neovim version with pkgsrc, you must fix VIM_PATH variable in formiko/vim.py file.

# python3.13 is in dependencies, as is gtk4
pkgin install py313-pip py313-gobject3 py313-docutils gtksourceview5 \
              libadwaita librsvg webkit-gtk
pip3.6 install jsonpath-ng formiko

# optionally
pkgin install neovim pynvim
pip3.6 install m2r2 docutils-tinyhtmlwriter

FreeBSD

Installation process can be different for each BSD releases. It’s about which Python release is default. By this, you can change py311 to your right version.

On FreeBSD you must install all these packages:

pkg install py311-pygobject py311-docutils py311-pygments py311-pip \
    gtksourceview5 webkit2-gtk_60 libspelling py311-jsonpath-ng \
    libadwaita

pip-3.11 install formiko

Optionally

# MarkDown, and tiny writer support
pip-3.11 install m2r2 docutils-tinyhtmlwriter

# languages
pkg install en-hunspell  # or other language you want

# neovim
pkg install vte3 neovim py311-pynvim py311-typing-extensions

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

formiko-2.0.0.tar.gz (161.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

formiko-2.0.0-py3-none-any.whl (164.1 kB view details)

Uploaded Python 3

File details

Details for the file formiko-2.0.0.tar.gz.

File metadata

  • Download URL: formiko-2.0.0.tar.gz
  • Upload date:
  • Size: 161.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for formiko-2.0.0.tar.gz
Algorithm Hash digest
SHA256 2092f452f8959acac8caadf4c7eabe8a37c082c540abdcb962c2f428fc1e96d9
MD5 dd15d182d7d07174bf13b0930c85839c
BLAKE2b-256 6813ed43f3eb0b27a0061500c078c95187c6c14717fb4f5f51e5a82d67b61a1a

See more details on using hashes here.

File details

Details for the file formiko-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: formiko-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 164.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for formiko-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71d2419a09f5dd79a999d653aad588a57c53a231bc79e7fbf927cfcb1fdc2508
MD5 d38d798902de948b6ed399f093ab34b1
BLAKE2b-256 dcec3b1f61664fd4349521cb1d19aafd32f092cef8d36f3ea3ce95c58afc49be

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

1.5.0

2 files

1.4.3

2 files

1.4.2

2 files

1.4.0

2 files

1.3.0

1 file

1.2.1

1 file

1.2.0

1 file

1.1.0

3 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page