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.最后
重啟詞典應用,在詞典的偏好設置里添加自定義詞典