diff --git a/README.md b/README.md index c6be518d42..4402bb985d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/guides/tts.md b/docs/guides/tts.md index 1271332f22..c975894a8b 100644 --- a/docs/guides/tts.md +++ b/docs/guides/tts.md @@ -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( diff --git a/docs/migration-guide.md b/docs/migration-guide.md index 21cd47fed0..7679664eff 100644 --- a/docs/migration-guide.md +++ b/docs/migration-guide.md @@ -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` @@ -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. diff --git a/docs/scripts/hooks.py b/docs/scripts/hooks.py new file mode 100644 index 0000000000..d464e6a721 --- /dev/null +++ b/docs/scripts/hooks.py @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index ed0be2b146..45e1fc5f20 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 @@ -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