Skip to content

Commit

Permalink
update UI (#13)
Browse files Browse the repository at this point in the history
- Removed some technical stuff from the docs (they should reside in yomitan github)
- Removed footer
- Removed left navbar (I kept TOC on the right because I tend to look at the left of the page first before other things, and doesn't make sense having a sizable TOC there) 
- Kept left navbar for `Others` section, removed TOC from `Others` section (They are not related enough to put in the same file but they are not relevant enough to deserve individual space on the top bar)
- Replaced `Stroke Order` with `Multilanguage Support` from the features list
- Improve some formatting
  • Loading branch information
Casheeew authored Jul 17, 2024
1 parent b0c9317 commit b235cfd
Show file tree
Hide file tree
Showing 19 changed files with 127 additions and 1,665 deletions.
10 changes: 0 additions & 10 deletions docs/advanced/advanced-options.md

This file was deleted.

59 changes: 54 additions & 5 deletions docs/advanced/audio.md → docs/advanced/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
## Default audio sources
---
hide:
- navigation
- footer
---

## Keyboard Shortcuts

The following shortcuts are globally available:

| Shortcut | Action |
| ---------------------------------- | ------------------------ |
| <kbd>Alt</kbd> + <kbd>Insert</kbd> | Open search page. |
| <kbd>Alt</kbd> + <kbd>Delete</kbd> | Toggle extension on/off. |

The following shortcuts are available on search results:

| Shortcut | Action |
| -------------------------------- | --------------------------------------- |
| <kbd>Esc</kbd> | Cancel current search. |
| <kbd>Alt</kbd> + <kbd>PgUp</kbd> | Page up through results. |
| <kbd>Alt</kbd> + <kbd>PgDn</kbd> | Page down through results. |
| <kbd>Alt</kbd> + <kbd>End</kbd> | Go to last result. |
| <kbd>Alt</kbd> + <kbd>Home</kbd> | Go to first result. |
| <kbd>Alt</kbd> + <kbd>Up</kbd> | Go to previous result. |
| <kbd>Alt</kbd> + <kbd>Down</kbd> | Go to next result. |
| <kbd>Alt</kbd> + <kbd>B</kbd> | Go to back to source term. |
| <kbd>Alt</kbd> + <kbd>E</kbd> | Add current term as expression to Anki. |
| <kbd>Alt</kbd> + <kbd>R</kbd> | Add current term as reading to Anki. |
| <kbd>Alt</kbd> + <kbd>P</kbd> | Play audio for current term. |
| <kbd>Alt</kbd> + <kbd>K</kbd> | Add current kanji to Anki. |

---

## Audio

### Default audio sources

After looking up a term, you can click on the <img src="../ext/images/play-audio.svg" alt="" width="16" height="16"> _speaker_ button to hear the term's pronunciation. When searching for audio, multiple audio sources are checked until the first source with audio for the term is found. If no audio is found, you will hear a short click instead. Right-clicking the <img src="../ext/images/play-audio.svg" alt="" width="16" height="16"> button allows choosing the source manually.

Expand All @@ -18,22 +54,35 @@ The default audio sources for other languages are from Wikimedia Commons:

While Commons has audio for many languages, some of them have limited coverage, and you may want to add additional sources, as described below.

## Configuration
### Configuration

Audio sources can be configured in `Settings` > `Audio` > `Configure audio playback sources` to reorder them or add new ones. Besides the four sources mentioned above, you can also use your browser's inbuilt text-to-speech (TTS) engine or add a custom URL source:

### Text-to-speech (TTS)
#### Text-to-speech (TTS)

To enable this, just add a new playback source with the `Text-to-speech` type and choose your desired voice. This is the simplest way to get pronunciation audio, though there a few points to keep in mind:

- TTS voices vary between browsers and so might not support all languages. For instance, [Microsoft Edge](https://www.microsoft.com/en-us/edge) offers a wide selection of free Azure natural voices for a variety of languages. Edge provides over 300 voices, compared to around 25 in Google Chrome (see [here](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt) for a list of supported languages).
- TTS audio can be inaccurate for languages with complex pronunciation such as Japanese, where words can have multiple possible readings and pitch accents.
- ⚠️ Note that the TTS voices cannot be sent to Anki; this is a [limitation of the browser SpeechSynthesis API](https://github.com/themoeway/yomitan/issues/864).

### Custom URL
#### Custom URL

You can add a custom URL from which audio will be fetched. One use case for this is fetching audio from Forvo:

#### Yomichan Forvo Server
##### Yomichan Forvo Server

[Forvo](https://forvo.com/) is currently the largest online pronunciation database, with native pronunciation audio for various languages. One way to get Forvo audio in Yomitan is via the [Yomichan Forvo Server](https://ankiweb.net/shared/info/580654285) Anki add-on. It fetches from Forvo, at the cost of a slight delay. After installing it in Anki, add a `Custom URL (JSON)` audio source with the URL `http://localhost:8770?term={term}&reading={reading}&language=en` (replacing `en` with the desired language's ISO code).

---

## Advanced Options

Click the `Advanced` toggle switch in the bottom left corner of the Settings page to enable advanced options.

### Parse sentences using MeCab

[MeCab](https://taku910.github.io/mecab/) is a third-party program which uses its own dictionaries and parsing algorithm to decompose sentences into individual words. MeCab may provide more accurate parsing results than Yomitan's internal parser.

In order for Yomitan to use it, both MeCab and a native messaging component must be installed.
A setup guide can be found [here](https://github.com/themoeway/yomitan-mecab-installer/blob/master/README.md).
23 changes: 0 additions & 23 deletions docs/advanced/keyboard-shortcuts.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/anki/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
hide:
- navigation
- footer
---


## Anki Integration

Yomitan features automatic flashcard creation for [Anki](https://apps.ankiweb.net/), a free application designed to help you
Expand Down
Loading

0 comments on commit b235cfd

Please sign in to comment.