Skip to content

Commit d595b6e

Browse files
authored
Fix documentation links (#748)
1 parent 35a3708 commit d595b6e

5 files changed

Lines changed: 36 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ dependencies {
120120
}
121121
```
122122

123-
: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.
123+
:warning: You must enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) in your application module.
124124

125125
#### Using a local Git clone
126126

docs/guides/tts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ val navigator = factory.createNavigator()
3333
navigator.play()
3434
```
3535

36-
`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.
36+
`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.
3737

3838
## Configuring the Android TTS navigator
3939

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

4242
```kotlin
4343
navigator.submitPreferences(AndroidTtsPreferences(

docs/migration-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The modules now target Android SDK 34. If your app also targets it, you will nee
2020

2121
#### Core library desugaring
2222

23-
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.
23+
[Core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) must be enabled in your application module.
2424

2525
### `Publication`
2626

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

446446
### Upgrading to the new Preferences API
447447

448-
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).
448+
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).
449449

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

452-
1. Get familiar with [the concepts of this new API](guides/navigator-preferences.md#overview).
452+
1. Get familiar with [the concepts of this new API](guides/navigator/preferences.md#overview).
453453
2. Remove the local HTTP server from your app, [as explained in the previous section](#removing-the-http-server).
454454
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.
455-
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.
456-
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).
455+
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.
456+
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).
457457
* 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.
458-
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.
458+
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.
459459

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

docs/scripts/hooks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import re
2+
3+
def on_page_markdown(markdown, page, config, files):
4+
# Only do this for the links on the index page
5+
if page.file.src_path == "index.md":
6+
# This fixes the depth issue since index.md is already inside /docs
7+
markdown = re.sub(r'(\[.*?\])\(docs/(.*?\.md)\)', r'\1(\2)', markdown)
8+
9+
return markdown

mkdocs.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ markdown_extensions:
4141
- pymdownx.smartsymbols
4242
- pymdownx.superfences
4343

44+
hooks:
45+
- docs/scripts/hooks.py
46+
47+
exclude_docs: |
48+
scripts/
49+
50+
validation:
51+
links:
52+
unrecognized_links: warn
53+
absolute_links: warn
54+
4455
# Dev server binding
4556
#dev_addr: 127.0.0.1:3001
4657

@@ -49,11 +60,17 @@ nav:
4960
- Migration Guide: migration-guide.md
5061
- API Reference: api/index.html
5162
- User Guides:
63+
- Getting started: guides/getting-started.md
64+
- Extracting the content of a publication: guides/content.md
65+
- Opening a publication: guides/open-publication.md
66+
- Navigator: guides/navigator/navigator.md
67+
- Media navigator: guides/navigator/media-navigator.md
5268
- Navigator preferences: guides/navigator/preferences.md
5369
- EPUB font families: guides/navigator/epub-fonts.md
5470
- PDF support: guides/pdf.md
5571
- Text-to-speech: guides/tts.md
56-
- Extracting the content of a publication: guides/content.md
72+
- Accessibility: guides/accessibility.md
73+
- LCP: guide/lcp.md
5774

5875
extra_css:
5976
- readium_colors.css

0 commit comments

Comments
 (0)