「ZIM」- 桌面维基编辑器 | A Desktop Wiki

认识

官网:https://zim-wiki.org/
文档:https://zim-wiki.org/manual/Start.html
仓库:https://github.com/zim-desktop-wiki/zim-desktop-wiki

Zim,是维基文档的图形编辑器,是桌面维基编辑器,以图形的方式直接编写维基文档。简而言之,Zim 就是款笔记软件,但是功能强大、扩展性强。

组成

应用框架
插件扩展

命令程序 and 配置文件

zim | Zim 的启动文件、主程序文件,支持 Server、导出、查找等功能;

配置的保存位置

  • 用户层面的 ZIM 全局配置文件位于:$HOME/.config/zim
  • 有关于插件的「状态数据」及「目录索引」位于:$HOME/.cache/zim

性质

Content is saved “transparently”

All pages you create in zim are saved as plain text files with wiki formatting. This means that you can access your content with any other editor or file manager without being dependent on zim. You can even have your pages in a revision control system like Git or use a custom Makefile to compile your notes into a webpage.

Any images you add are just image files that are linked from the text files. This means that zim can call your standard programs to edit images. When you embed an image in a page the context menu for the image will offer to open it with whatever image manipulation programs you have installed. After editing you just reload the page to see the result.

The editor tries to get out of your way

The best wiki is a wiki that does not interfere between you and the content

The editor tries not to bother you with tasks that distract you from the content. This means for example that files are saved automatically but also that files and directories are created and removed on the fly as you add or remove content in the wiki pages. While working on content you should not need to bother with things like the directory structure.

Related features include:

You can use wiki syntax to type formatting

If you restart zim it opens at the same place you closed it.

The wiki can be navigated completely using key bindings.

The editor allows you to organize your notes

The ability to hyperlink pages is a powerful way of organizing content. This goes further than hyperlinks in ordinary web pages. One example of this is that zim keeps track of all links and for each page shows which pages link to it, making links bidirectional. You can also link webpages or external files, when clicked zim will open these with the appropriate applications.

Since zim has the GUI layout resembling a note-taking application you can organize your pages hierarchically, allowing for example to group pages by topic. But because you also have wiki-style backtracking of links you could also have a category system by using backlinks so a page can link to multiple categories.

And more..

Zim has various plugins for things like:

Spell checking

an Equation Editor

using Calendar pages

a Task List dialog

a Tray Icon

You can export your notes to Html if you want to publish them.

构建

zim-desktop-wiki/README.md at master · zim-desktop-wiki/zim-desktop-wiki · GitHub
Zim – A Desktop Wiki/Install

安装 | CentOS | Ubuntu | Debian | 源码

该笔记将记录:在 Linux 中,安装 Zim 的方法,以及常见问题的解决方案;

下面的部分将针对不同 Zim 版本与 Linux 发行版组合进行记录,也都是我们安装过的版本;

Zim 0.74.3 on Ubuntu 22.04

apt-get install python-is-python3 gir1.2-gtk-3.0 python3-gi python3-xdg python3-pillow pkg-config libcairo2-dev
apt-get install zim

Zim 0.7.0 on CentOS 7.5

版本:Zim 0.7.0 (git branch: master)
时间:01/08/2019

# 安装依赖的软家包
yum install -y python34.x86_64 python34-gobject* python34-pyxdg.noarch

# 检出源码
git clone https://github.com/jaap-karssenberg/zim-desktop-wiki.git

# 进入源码目录
cd zim-desktop-wiki

# 安装
./setup.py install

# 运行
/usr/bin/zim

# 目前是 0.70 版本,BUG 太多

on macOS(brew)

在 macOS 中,可以使用 brew 包管理器安装:

brew install zim

# 注 1,相关依赖会自动进行安装,无需手动处理;

常见问题处理:
1)为 macOS 创建图标:Create a Mac App for Zim Wiki

Zim 0.68 on Debian 10

时间:02/14/2020

安装常见依赖包:

apt-get install python-gobject python-gtk2 python-xdg xdg-utils

为使用 Source View 插件,需要安装 libgtksourceview2 与 python-gtksourceview2 包。在 Debian 10 中,包含 libgtksourceview2.0-0 包,但不再包含 python-gtksourceview2 包,且使用 pip 也无法检索到后者。因此我们使用在 Debian 9 中的 python-gtksourceview2 包:

apt-get install libgtksourceview2.0-0
wget http://ftp.tw.debian.org/debian/pool/main/p/pygtksourceview/python-gtksourceview2_2.10.1-3_amd64.deb
dpkg -i python-gtksourceview2_2.10.1-3_amd64.deb # 可能需要安装该包的其他依赖

安装应用包

apt-get install -y zim

Zim python2-gtk2 on CentOS 7.5

版本:Zim (git branch: python2-gtk2)
时间:06/22/2019

#!/bin/sh

# !!!由于需要在命令行中使用,在服务器上执行导出功能。所以在终端先进行安装,没有桌面;
# !!!但是安装失败了,提示「RuntimeError: could not open display」错误。这是没有启动桌面导致的;
# !!!虽然安装失败了,但是源码包里的 zim.py 可以直接运行;

# 检出源码
git clone -b python2-gtk2 https://github.com/jaap-karssenberg/zim-desktop-wiki.git

# 安装依赖的软家包
# !!!这个依赖可能并不完整,主要是在发行版中的包名与作者要求的包名无法一一对应,比较难找
# !!!只能根据情况,缺啥补啥了;
yum install -y python-gobject.x86_64 pygobject2.x86_64 \
    python-gobject-base.x86_64 pygtk2.x86_64

# 进入源码目录
cd zim-desktop-wiki

# 安装(这一步会失败,提示「RuntimeError: could not open display」错误)
./setup.py install

源码安装(通用方法)

1)检出源码:使用 Git 检出源码,项目的地址:https://launchpad.net/zim
2)执行测试:如文档所述,在安装前执行 test.py 进行测试;
3)进行安装:安装方法不再做过多的介绍,详细阅读文档: http://zim-wiki.org/install.html

# 安装依赖
apt-get install libcairo2-dev libgirepository1.0-dev
pip install pycairo
pip install PyGObject # 包含 GtkSourceView 类库

# 使用 Git 检出源码
git clone -b master https://github.com/jaap-karssenberg/zim-desktop-wiki
cd zim-desktop-wiki

# 进行测试
# 安装执行之前执行 test.py 进行测试。正如文档所说的那样;
./test.py

### 开始安装
# 安装方法不再做过多的介绍,详细阅读「Install」文档;
# http://zim-wiki.org/install.html

应用

使用技巧:jaap-karssenberg/zim-wiki

我们目前正在使用的笔记软件。
现在(10/23/2023),这是我们唯一在使用的笔记软件,暂未找到更好的替代品;

  • 保存笔记存档
  • 在会议期间记笔记或讲座
  • 组织任务列表
  • 草稿博客条目和电子邮件
  • 进行头脑风暴

通过命令行导出

zim --index --verbose /mnt/zim-desktop-wiki\@local/website/pages/

zim --export --verbose --overwrite --format html \
    --template /mnt/zim-desktop-wiki\@local/website/template.html \
    --output test/ \
    /mnt/zim-desktop-wiki\@local/website/pages/

改进

# 12/17/2018 今天到 GitHub 上看了一下,它的 MASTER 分支已经是 Python 3 的实现了,原本的 Python 2 版本已经移动 python2-gtk2 分支。

# 09/02/2019 仓库标签 0.69.1 是最后一个 GTK 2 的版本,从 0.70 开始使用 Python 3 实现,并使用 GTK 3 库。或者可以使用 python2-gtk2 分支。

# 12/15/2020 今天,我们升级,直接使用 master 分支,因为我们要参与 zim 的开发 🙂

# 04/19/2023 现在,我们使用 develop 分支(其为当前的开发分支),新版本的变更特别多。

# 03/27/2024 针对众人参与的开源项目,其缺点是功能的添加需要讨论,而无法我们的偏好进行修改。所以我们 fork 出项目,希望按照我们的喜好进行调整。

参考

Zim – a desktop wiki
Zim (software) – Wikipedia
Zim User Manual
在 GitHub 上的手册
Zim – 普通人的 Org-mode