1.准备词库mdx、css文件
2.安装Dictionary Development Kit
https://github.com/SebastianSzturo/Dictionary-Development-Kit
安装后目录结构如下:
/Applications/Utilities/Dictionary\ Development\ Kit
├── README.md
├── bin
├── documents
├── project_templates
└── samples
3.下载pyglossary
https://github.com/ilius/pyglossary
4. 安装词典
cd $pyglossary-path
python3 $pyglossary-path/main.py --write-format=AppleDict dict.mdx $directory-name
cd $directory-name
复制词典原来附随的css样式,粘贴到$directory-name下的css文件中.
在.plist文件
第10行更改的CFBundleDisplayName值,这将会是是词库在词典显示的名字
make && make install
词典将会安装到~/Library/Dictionaries
目录
5.最后
重启词典应用,在词典的偏好设置里添加自定义词典