伟大伟大

为Mac的自带的词典添加自定义词库

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.最后

重启词典应用,在词典的偏好设置里添加自定义词典

posted @ 2022-02-07 21:14  wooHsi  阅读(1781)  评论(0)    收藏  举报