goldendict-ng/website/docs/custom_dictionary.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.4 KiB
Markdown
Raw Normal View History

2023-07-26 10:06:20 +00:00
A `metadata.toml`, which uses [toml](https://toml.io) format, can be used to customize or override some properties of a certain dictionary. It is also used in [auto grouping by metadata](manage_groups.md)
2023-07-26 10:06:20 +00:00
The `metadata.toml` should be placed on each dictionary's root folder (beside dictionary files) like
```
.
├── Cambridge
2023-07-26 10:06:20 +00:00
│ ├── metadata.toml < here
│ ├── Cambridge.idx
│ ├── Cambridge.info
│ ├── Cambridge.syn
│ └── Cambridge.dict.dz
└── Collins
2023-07-26 10:06:20 +00:00
├── metadata.toml < here
├── res.zip
2023-07-26 10:06:20 +00:00
└── Collins.dsl
```
## Override display name
2023-07-26 10:06:20 +00:00
Some dictionary formats' display is embedded inside the dictionary, which cannot be easily changed, but you can add the following to override it.
```toml
[metadata]
name = "New Name"
```
2023-07-26 10:06:20 +00:00
This `New Name` will be appeared as the dictionary name.
## Disable full-text search
feat: customize dictionary's fullindex option with metadata.toml (#1000) * feat: customize dictionary's fullindex option with metadata.toml * [autofix.ci] apply automated fixes * feat: display fulltext status in the dictionary info dialog * [autofix.ci] apply automated fixes * doc: add document about how to enable dictionary's fullindex feature * Update src/metadata.cc Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update src/ui/dictinfo.ui Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/mkdocs.yml Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * add images * feat: show fulltext search status in dictionary info dialog * Update dictinfo.cc * [autofix.ci] apply automated fixes * ui: change layout --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com> Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2023-07-26 02:03:20 +00:00
```toml
fts=false
[metadata]
name="New Name"
```
2023-07-26 09:58:11 +00:00
The `fts` field's value can be `on/off`, `1/0` ,`true/false` etc.
feat: customize dictionary's fullindex option with metadata.toml (#1000) * feat: customize dictionary's fullindex option with metadata.toml * [autofix.ci] apply automated fixes * feat: display fulltext status in the dictionary info dialog * [autofix.ci] apply automated fixes * doc: add document about how to enable dictionary's fullindex feature * Update src/metadata.cc Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update src/ui/dictinfo.ui Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/mkdocs.yml Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * add images * feat: show fulltext search status in dictionary info dialog * Update dictinfo.cc * [autofix.ci] apply automated fixes * ui: change layout --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com> Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2023-07-26 02:03:20 +00:00
```
fts=false
```
will disable the current dictionary's full-text search.
2023-07-26 10:06:20 +00:00
You can check the full-text search status on each dictionary's info dialog.
feat: customize dictionary's fullindex option with metadata.toml (#1000) * feat: customize dictionary's fullindex option with metadata.toml * [autofix.ci] apply automated fixes * feat: display fulltext status in the dictionary info dialog * [autofix.ci] apply automated fixes * doc: add document about how to enable dictionary's fullindex feature * Update src/metadata.cc Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update src/ui/dictinfo.ui Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/mkdocs.yml Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * Update website/docs/custom_dictionary.md Co-authored-by: shenleban tongying <shenlebantongying@gmail.com> * add images * feat: show fulltext search status in dictionary info dialog * Update dictinfo.cc * [autofix.ci] apply automated fixes * ui: change layout --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com> Co-authored-by: shenleban tongying <shenlebantongying@gmail.com>
2023-07-26 02:03:20 +00:00
2023-07-26 09:58:11 +00:00
![](img/dictionary-info-fullindex.png)
2024-11-14 03:48:06 +00:00
Note that it is possible to enable full text for a single dictionary by disabling full-text search in the Preferences dialog, and set `fts=true` for that dictionary.