ankidroid / ankidroid/Anki-Android
Expose 'Field filters' in 'Insert field'
- Langage dominant
- Kotlin
- Étoiles
- 11.8k
- Forks
- 2.9k
- Merge moyen
- 2 j 3 h
- PR mergées (30 j)
- 167
Description
## Context
https://docs.ankiweb.net/templates/fields.html lists a number of field filters, the most common of which are `{{type:Field}}` and `{{cloze:Field}}`.
Multiple filters may exist are applied right to left (inside-out/functional composition): `{{hint:text:Front}}` is applied: `hint(text(Front))`
Our UI for inserting fields:
The field filters we can apply:
* text
* cloze
* cloze-only
* hint
* type [special-cased]
* type:nc
* type:cloze
* furigana
* kana
* kanji
* tts [3 options]
* lang (required)
* voices
* speed
* tts-voices
* Not applied to a field; likely not necessary to expose
## Problem(s)
* The list of field filters is not discoverable, unless a user reads the manual
* In particular, TTS is often requested, and appears to be a feature we don't support at all
* Many combinations of field filters do not make sense. A few examples:
* `tts` and `type` are terminal fields, no fields should come after them
* `text` strips HTML, so shouldn't be applied after `hint`
* `cloze` should not be applied to a non-cloze note
* `tts` requires a `lang` option, and provides an arbitrary list of options for Anki clients to handle.
## Proposed solution
After/during AnkiDroid's 'basic' field selection
* Display the available field filters which can be applied to a field, along with a brief description
* Allow a 'chain' of filters to be built
* At each stage of the chain, display only the available filters to the user
* For the TTS filter, allow options to be set before adding it to the chain of filters. Modify the existing screen for 'tts-voices:'
* Display the rendered Field chain as text `{{text:hint:Field}}` and allow it to be inserted
* (optional) render the current chain as HTML, using the context of the field if opened from the Card Template Editor, and allowing a user to input arbitrary field text.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.