Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use mdbook for docs #101

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

(cd && git clone https://github.com/ankitects/mdbook-binaries.git)
export PATH="$HOME/mdbook-binaries:$PATH"
if [ "$CHECK" = "" ]; then
rm $HOME/mdbook-binaries/mdbook-linkcheck
fi
mdbook build
34 changes: 34 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
env:
cname: docs.ankidroid.org

name: github pages

on:
push:
branches:
- main
- test

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Build
run: .github/workflows/build.sh

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/html
cname: ${{ env.cname }}

check:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Build
run: CHECK=1 .github/workflows/build.sh
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
tools/id_rsa
*.html
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*
tools/id_rsa
*.html
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*
book
Empty file added .nojekyll
Empty file.
27 changes: 27 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[book]
authors = ["AnkiDroid Open Source Team"]
language = "en"
multilingual = false
src = "src"
title = "AnkiDroid Manual"

[build]
create-missing = true

[output.html]
git-repository-url = "https://github.com/ankidroid/ankidroiddocs/"
cname = "docs.ankidroid.org"
additional-css = ["css/kbd.css"]

[preprocessor.toc]
command = "mdbook-toc"
renderer = ["html"]

[output.linkcheck]
optional = true
warning-policy = "warn"
follow-web-links = true

[output.html.fold]
enable = true
level = 0
26 changes: 26 additions & 0 deletions css/kbd.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.ayu,
.coal,
.navy {
--kbd-bg: var(--table-header-bg);
--kbd-border: var(--bg);
}

.light {
--kbd-bg: var(--theme-hover);
--kbd-border: var(--table-header-bg);
}

.rust {
--kbd-bg: var(--table-header-bg);
--kbd-border: var(--theme-hover);
}

kbd {
margin: 0.1em 0.1em;
padding: 0.1em 0.6em;
font-family: sans-serif;
border-radius: 4px;
display: inline-block;
border: 1px var(--kbd-border) solid;
background-color: var(--kbd-bg);
}
62 changes: 62 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Summary

[Introduction](intro.md)
- [Getting started](getting-started.md)

- [The Deck List](deck-picker.md)

- [Navigation Drawer](drawer.md)

- [Deck Overview Screen](deck-overview.md)

- [Study Screen](reviewer.md)

- [Add Note Screen](adding-notes.md)

- [Edit Note Screen](editing-notes.md)

- [Finding/Searching/Browsing](browser.md)

- [Filtered Decks](filtered-deck.md)

- [Importing Anki Files](importing/importing-anki-files.md)
- [Importing Anki Databases (.anki2)](importing/importing-anki-databases.md)

- [Exporting Anki Files](exporting.md)

- [Automatic Backups](backups.md)

- [Preferences](settings.md)

- [Gestures](gestures.md)

- [Note Formatting Toolbar](note-formatting-toolbar.md)

- [Keyboard Shortcuts](keyboard-shortcuts.md)

- [Using Right-To-Left Languages with AnkiDroid](rtl.md)

- [Using Anki Desktop with AnkiDroid](anki-desktop.md)

- [Advanced Features](advanced-features/intro.md)
- [MathJax Support](advanced-features/mathjax.md)
- [Reverse Cards](advanced-features/reverse-cards.md)
- [Custom Fonts](advanced-features/custom-fonts.md)
- [Custom Card Layout](advanced-features/customizing-card-layout.md)
- [Type in the answer feature](advanced-features/type-in-answer.md)
- [Advanced Statistics](advanced-features/advanced-statistics.md)
- [Reminders](advanced-features/reminders.md)
- [Automatic Language Selection](advanced-features/set-language-hint.md)


- [Help & Supports](help.md)
- [Beta testing](beta-testing.md)
- [Contributing to AnkiDroid](contributing.md)
- [Changelog](changelog/intro.md)
- [Version 2.15](changelog/v2.15.0-to-2.15.6.md)
- [Version 2.14](changelog/v2.14.0-to-2.14.6.md)
- [Version 2.13](changelog/v2.13.0-to-2.13.5.md)
- [Version 2.11 to 2.12](changelog/v2.11.0-to-2.12.0.md)
- [Version 2.6 to 2.10](changelog/v2.6-to-2.10.md)
- [Version 2.0 to 2.5](changelog/v2.0-to-2.5.md)
- [Version 0.1 to 1.1.3](changelog/v0.1-to-1.1.3.md)
36 changes: 36 additions & 0 deletions src/adding-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Add Note Screen

<!-- toc -->

*_Note:_* _This section onwards assumes you understand what [notes, fields, card templates, and note types](https://docs.ankiweb.net/getting-started.html#notes--fields) are_

To add a new note, tap the **+** button at the bottom of the deck list and choose **Add**.

![adding.png](img/5-adding.png)

The following controls are available in the add note screen:

### Type
Allows you to select the type of note you'd like to add.
For most purposes the **Basic** note type is sufficient, but for example if you would like an extra card generated which is the reverse of the main card (i.e. shows the **Back** field on the front of the card), you could chose the **Basic (and reversed card)** note type.

### Deck
Allows you to change the deck the generated card/cards will be added to.

### Fields
Below the deck selector are the fields for the note (for example the **Basic** note type has two fields **Front** and **Back**). When you tap on a field, a keyboard will come up, allowing you to type in information.

### Media Buttons
Next to each field is an attach icon, which allows you to add media to your note (this feature is currently in the experimental phase).
Add image lets you add images either via your device's camera (if it has one), or from your photo library.
Record audio allows you to record your voice and place it into a field. The advanced editor lets you automatically search for translations or pronunciation audio files online.

### Tags
Brings up a dialog which lets you add / remove tags from the note.

### Cards
Shows the names of the cards which will be generated for the selected note type. Tapping on this button will bring up a dialog which lets you preview the source code for the card template of the selected note type. From here you can edit, preview, add, and delete card templates. See the [cards and templates section](https://docs.ankiweb.net/templates/intro.html) of the Anki Desktop manual for more information about card templates.

Long press in a text entry field to add a cloze deletion around the selected text, or an empty cloze deletion if there is no selected text.

When you've finished typing in the content of a note, tap the tick icon in the app bar at the top to add it to your collection. Alternatively, if you want to go back to what you were doing without saving, you can tap the app icon, or use the hardware back button.
29 changes: 29 additions & 0 deletions src/advanced-features/advanced-statistics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Advanced Statistics

If Advanced Statistics are enabled, it changes the **Forecast** graph so that it shows the estimated number of reviews that will be due on a given day in the future taking into account future reviews, learning new cards and failing cards. The bars and the left axis show the number of cards due on each day if you study all cards each day, while the line and the right axis show the number of unseen (shown as **learn**), young and mature cards your deck or collection will consist of if you study all cards each day. The forecast graph does count reviews that are currently overdue. It assumes that the overdue cards will be reviewed according to the **maximum reviews/day** deck option.

Advanced Statistics can be enabled in `Settings -> Advanced -> Advanced Statistics` (in plugin section).

The outcome of future reviewing, learning or failing cards affects reviews after that future review. To take this into account, the probability of each outcome is computed from the review log. Then the outcome is randomly chosen, such that an outcome which is more likely according to the review log is more likely to be chosen than an outcome which is less likely according to the review log. The settings all affect how the effect of the outcome of future reviews on subsequent reviews is taken into account.

### Compute first n days, simulate remainder
If this setting is set to a number greater than 0, instead of randomly choosing an outcome, each possible outcome is taken into account in the simulation, together with its probability. The probability is taken into account for the graph and for future reviews in which it results, which also affect the graph.
One review has a couple of possible outcomes (say 4), which all result in a review. That review also has a couple of possible outcomes and so on. If many reviews are simulated this way, many reviews (4 x 4 x 4 x ... ) have to be taken into account which increases the time it takes to compose the graph.
Therefore, for reviews later than n days from now are simulated by randomly choosing an outcome.

In summary, higher n gives a more accurate graph, but it takes more time to compose the graph.

### Precision of computation

Reviews which occur with a probability smaller than 100% minus the configured precision of the computation are simulated by randomly choosing an outcome rather than taking into account each possible outcome. This setting is only applicable if the first n days are computed.
If Advanced Statistics are disabled, the **Forecast** graph shows the estimated number of reviews that will be due on a given day in the future if you do not review cards, learn no new cards and fail no cards.

In summary, higher precision gives a more accurate graph, but it takes more time to compose the graph.

### Number of iterations of the simulation
Composes the graph several times and then displays the average of these graphs.
Each time the graph is composed, another outcome might be randomly chosen. If we average many outcomes which are randomly chosen taking into account the probabilities from the review log, the average outcome will likely be close to the average of the probabilities from the review log.
If we average many graphs, the average graph will likely be close to the graph which is generated by taking into account all possible outcomes.
If the number of graphs which are averaged is not too high, it will be faster than taking into account all possible outcomes.

In summary, a higher number of iterations gives a more accurate graph, but it takes more time to compose the graph.
15 changes: 15 additions & 0 deletions src/advanced-features/custom-fonts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Custom Fonts

AnkiDroid allows you to use non-system fonts on your cards. To set them up properly, it is strongly recommended to use the official method that is used by Anki Desktop. Please see [the corresponding section in the desktop manual](https://docs.ankiweb.net/templates/styling.html#installing-fonts) for more information.

Alternatively, you can create a new subfolder **fonts** in the main AnkiDroid directory (i.e. the folder which contains the **backups** subfolder, specified under `Settings > Advanced > AnkiDroid directory)`, copy a compatible font file (i.e. .ttf) there, and then set this as the default font under `Settings > Fonts > Default font`.

**Note:** this method will change the default font for **all** of your cards, whereas the official method can be more specific. Also, if you sync with AnkiWeb, using this method will lead to cards being displayed differently on different devices.

Only fonts in the ttf format are officially supported in Anki/AnkiDroid; the [Google Noto](https://fonts.google.com/noto) font set is highly recommended for all languages, and some other free fonts can be found [here](https://github.com/ankidroid/Anki-Android/wiki/Freely-distributable-fonts).

Please note that AnkiDroid has to load the entire font into memory in order to use it, and fonts for Asian languages can be quite large. If you have an older device and notice AnkiDroid crashing frequently after installing a font, you may have exceeded your device's memory limits. For Google Noto, it's not recommended to use the combined CJK font, rather get the individual languages [separately from here](https://github.com/googlei18n/noto-cjk).

>**Note 1**: If you have **Fetch media on sync** disabled, you may need to manually copy the font file from Anki Desktop to your AnkiDroid/collection.media folder.

>**Note 2**: If you can't get your font to work after following the steps in here and the Anki Desktop manual, please refer to the FAQ for <a href="https://github.com/ankidroid/Anki-Android/wiki/FAQ#i-followed-the-instructions-in-the-manual-but-i-still-cant-get-my-custom-font-to-work">detailed steps on how to debug font issues</a>.
6 changes: 6 additions & 0 deletions src/advanced-features/customizing-card-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Custom Card Layout
The layout of flashcards is completely customizable, although this is an advanced topic with a fairly steep learning curve, and you will probably find it a lot more convenient to do the customization with [Anki Desktop](../anki-desktop.md).

The [card templates section](https://docs.ankiweb.net/templates/intro.html) of the Anki Desktop manual has detailed instructions on how to edit note types, and most of the actions discussed there are also available from AnkiDroid by tapping **cards** at the bottom of the note editor, or choosing the **manage note types** option in the deck picker. Since detailed information on customizing card layouts is available in the Anki desktop manual, it will not be repeated here.

There is an [advanced formatting page](https://github.com/ankidroid/Anki-Android/wiki/Advanced-formatting) on the AnkiDroid wiki with various hints on how you can get the most out of your card formatting, and we encourage you to read it, and edit it freely if you have any tips that you'd like to share with the community.
10 changes: 10 additions & 0 deletions src/advanced-features/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Advanced Features

- [MathJax Support](mathjax.md)
- [Reverse Cards](reverse-cards.md)
- [Custom Fonts](custom-fonts.md)
- [Custom Card Layout](customizing-card-layout.md)
- [Type in the answer feature](type-in-answer.md)
- [Advanced Statistics](advanced-statistics.md)
- [Reminders](reminders.md)
- [Automatic Language Selection](set-language-hint.md)
14 changes: 14 additions & 0 deletions src/advanced-features/mathjax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MathJax Support
Mathjax is a modern typesetting library for math and chemistry. AnkiDroid supports Mathjax cards out of the box. Mathjax is configured to expect TeX formatting, with `\(` and `\)` delimiting inline equations and `\[` and `\]` for display equations.

To try it out, enter the following into a field:

```
\(\sqrt{x}\)
```

and preview the card.

For more details, see [Mathjax Support](https://docs.ankiweb.net/math.html#mathjax) in the Anki Manual.

[Previous workarounds](https://www.reddit.com/r/Anki/comments/ar7lxd/how_to_load_mathjax_color_extension_on_anki/egm6u5j) are no longer necessary as of AnkiDroid 2.9.
7 changes: 7 additions & 0 deletions src/advanced-features/reminders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Reminders
AnkiDroid can remind you to devote some time to reviewing cards every day at a specific time via Android's notification framework.
You can configure reminders for each options group independently.
To configure a notification go to Deck options > Reminders, then tick the checkbox and select the time you want to be notified at.
To stop receiving notifications go to Deck options > Reminders and unmark the checkbox.

Notifications only work for top level decks. Please let us know if you want us to add notifications for subdecks too.
11 changes: 11 additions & 0 deletions src/advanced-features/reverse-cards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Reverse Cards

The Anki system has [built-in note types which allow you to review cards in both directions](https://docs.ankiweb.net/getting-started.html#note-types).
When [creating new material](../adding-notes.md) in AnkiDroid, you should choose one of these note types, such as **Basic (and reversed card)**, which will automatically generate a reverse card for you.

![ReverseNoteType](../img/ReverseNoteType.png)

If you used the wrong note type when adding your material, you can change the note type via the [edit note screen](../editing-notes.md), or you can change the note type for multiple cards at once using the browser in Anki Desktop.
To do this, follow the instructions in the [syncing with Anki Desktop section](../anki-desktop.md), then in Anki Desktop open the browser, select the cards you want to change, then choose **Change note type** from the menu.

Alternatively, if your cards are using a custom card layout which doesn't include a reverse card, you can edit the note type to include a reverse card by following the instructions in the [reverse cards section](https://docs.ankiweb.net/templates/generation.html#reverse-cards) of the Anki Desktop user manual. While less convenient than using Anki Desktop, it is possible to edit the note type from directly within AnkiDroid as well; see the [custom card layout section](../advanced-features/customizing-card-layout.md) for more on this.
5 changes: 5 additions & 0 deletions src/advanced-features/set-language-hint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Automatic Language Selection
AnkiDroid has an in Automatic Language Selection feature in the Note Editor starting with AnkiDroid 2.13. This feature allows you to define a default language to be used in your keyboard for a field in a note type.


For example, if you have Russian and English note fields, and your keyboard supports the setImeHintLocales Android API, the keyboard layout will switch to Russian in the first field and back to English in the second automatically when the fields get focus. [Checkout video reference for demonstration](https://www.youtube.com/watch?v=JrxDjTrRhBE)
25 changes: 25 additions & 0 deletions src/advanced-features/type-in-answer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Type in the answer feature

AnkiDroid allows you to type in the correct answer and then compare it to the right answer. You have to set this up with Anki desktop, as described in the [Anki Desktop manual](https://docs.ankiweb.net/templates/fields.html#checking-your-answer).

Anki desktop replaces the **{{type:NN}}** field on the front of a card with an input box in the card. On AnkiDroid it is replaced with a **......** prompt instead, and a text input box is shown at the bottom. The comparison between typed text and the correct text is shown on the answer side in place of the **{{type:NN}}** field there, like on Anki desktop.

The text input box and the soft keyboard can be hidden by ticking **Disable typing in answer** in the preferences.

Even with typing disabled, the correct answer is shown on the answer side. This is done on purpose; otherwise the correct answer might not be shown at all.

To hide the comparison (e.g. because the correct answer is shown anyway), the HTML id **typeans** can be used.
Add following to the [card styling](https://docs.ankiweb.net/templates/styling.html#card-styling) using Anki Desktop.
```css
.mobile #typeans {
display: none;
}
```

The type answer prompt and the comparison have more classes that can be used to change the way they are displayed. Some of these are the same as on Anki Desktop, some are specific to AnkiDroid.

The comparison uses three classes, typeGood, typeBad and typeMissed to add green, red and gray background to the typing comparison. These three classes are used on Anki desktop as well.

The **......** prompt has the class **typePrompt**.

When typing is set to off in the preferences, the class **typeOff** is added to the prompt on the question side, and to the div element containing the comparison on the answer side. This class can be used to show the type prompt or to hide the typing comparison in this case.
Loading