Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ dependencies {
}
```

:warning: If you target Android devices running below API 26, you must enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) in your application module.
:warning: You must enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) in your application module.

#### Using a local Git clone

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/tts.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ val navigator = factory.createNavigator()
navigator.play()
```

`TtsNavigator` implements `MediaNavigator`, so you can use all the APIs available for media-based playback. Check out the [dedicated user guide](media-navigator.md) to learn how to control `TtsNavigator` and observe playback notifications.
`TtsNavigator` implements `MediaNavigator`, so you can use all the APIs available for media-based playback. Check out the [dedicated user guide](navigator/media-navigator.md) to learn how to control `TtsNavigator` and observe playback notifications.

## Configuring the Android TTS navigator

The `AndroidTtsNavigator` implements [`Configurable`](navigator-preferences.md) and provides various settings to customize the text-to-speech experience.
The `AndroidTtsNavigator` implements [`Configurable`](navigator/preferences.md) and provides various settings to customize the text-to-speech experience.

```kotlin
navigator.submitPreferences(AndroidTtsPreferences(
Expand Down
12 changes: 6 additions & 6 deletions docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The modules now target Android SDK 34. If your app also targets it, you will nee

#### Core library desugaring

If you target Android devices running below API 26, you now must enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) in your application module.
[Core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) must be enabled in your application module.

### `Publication`

Expand Down Expand Up @@ -445,17 +445,17 @@ override fun onTap(point: PointF): Boolean {

### Upgrading to the new Preferences API

The 2.3.0 release introduces a brand new user preferences API for configuring the EPUB and PDF Navigators. This new API is easier and safer to use. To learn how to integrate it in your app, [please refer to the user guide](guides/navigator-preferences.md).
The 2.3.0 release introduces a brand new user preferences API for configuring the EPUB and PDF Navigators. This new API is easier and safer to use. To learn how to integrate it in your app, [please refer to the user guide](guides/navigator/preferences.md).

If you integrated the EPUB navigator from a previous version, follow these steps to migrate:

1. Get familiar with [the concepts of this new API](guides/navigator-preferences.md#overview).
1. Get familiar with [the concepts of this new API](guides/navigator/preferences.md#overview).
2. Remove the local HTTP server from your app, [as explained in the previous section](#removing-the-http-server).
3. Remove the whole [`UserSettings.kt`](https://github.com/readium/kotlin-toolkit/blob/f132e541a1d2c290a83974fb017efb352e0f825f/test-app/src/main/java/org/readium/r2/testapp/epub/UserSettings.kt) file from your app, if you copied it from the Test App.
4. Adapt your user settings interface to the new API using preferences editors. The [Test App](https://github.com/readium/kotlin-toolkit/tree/develop/test-app/src/main/java/org/readium/r2/testapp/reader/preferences) and the [user guide](guides/navigator-preferences.md#build-a-user-settings-interface) contain examples using Jetpack Compose.
5. [Handle the persistence of the user preferences](guides/navigator-preferences.md#save-and-restore-the-user-preferences). The settings are not stored in the `SharedPreferences` with name `org.readium.r2.settings` anymore. Instead, you are responsible for persisting and restoring the user preferences as you see fit (e.g. as a JSON file).
4. Adapt your user settings interface to the new API using preferences editors. The [Test App](https://github.com/readium/kotlin-toolkit/tree/develop/test-app/src/main/java/org/readium/r2/testapp/reader/preferences) and the [user guide](guides/navigator/preferences.md#build-a-user-settings-interface) contain examples using Jetpack Compose.
5. [Handle the persistence of the user preferences](guides/navigator/preferences.md#save-and-restore-the-user-preferences). The settings are not stored in the `SharedPreferences` with name `org.readium.r2.settings` anymore. Instead, you are responsible for persisting and restoring the user preferences as you see fit (e.g. as a JSON file).
* If you want to migrate the legacy `SharedPreferences` settings, you can use the helper `EpubPreferences.fromLegacyEpubSettings()` which will create a new `EpubPreferences` object after translating the existing user settings.
6. Make sure you [restore the stored user preferences](guides/navigator-preferences.md#setting-the-initial-navigator-preferences-and-app-defaults) when initializing the EPUB navigator.
6. Make sure you [restore the stored user preferences](guides/navigator/preferences.md#setting-the-initial-navigator-preferences-and-app-defaults) when initializing the EPUB navigator.

Please refer to the following table for the correspondence between legacy settings and new ones.

Expand Down
9 changes: 9 additions & 0 deletions docs/scripts/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import re

def on_page_markdown(markdown, page, config, files):
# Only do this for the links on the index page
if page.file.src_path == "index.md":
# This fixes the depth issue since index.md is already inside /docs
markdown = re.sub(r'(\[.*?\])\(docs/(.*?\.md)\)', r'\1(\2)', markdown)

return markdown
19 changes: 18 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ markdown_extensions:
- pymdownx.smartsymbols
- pymdownx.superfences

hooks:
- docs/scripts/hooks.py

exclude_docs: |
scripts/

validation:
links:
unrecognized_links: warn
absolute_links: warn

# Dev server binding
#dev_addr: 127.0.0.1:3001

Expand All @@ -49,11 +60,17 @@ nav:
- Migration Guide: migration-guide.md
- API Reference: api/index.html
- User Guides:
- Getting started: guides/getting-started.md
- Extracting the content of a publication: guides/content.md
- Opening a publication: guides/open-publication.md
- Navigator: guides/navigator/navigator.md
- Media navigator: guides/navigator/media-navigator.md
- Navigator preferences: guides/navigator/preferences.md
- EPUB font families: guides/navigator/epub-fonts.md
- PDF support: guides/pdf.md
- Text-to-speech: guides/tts.md
- Extracting the content of a publication: guides/content.md
- Accessibility: guides/accessibility.md
- LCP: guide/lcp.md

extra_css:
- readium_colors.css
Expand Down