ankidroid / ankidroid/Anki-Android

Expose 'Field filters' in 'Insert field'

Đang mở
#20,533 6 bình luận 0 reaction 1 người được giao Được @david-allison nhận Xem trên GitHub
Keep Open
Ngôn ngữ chính
Kotlin
Star
11.8k
Fork
2.9k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
167

Mô tả

## 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.