From 78f737a5a08930fb53b8af6b549586bec446b506 Mon Sep 17 00:00:00 2001 From: Arkadii Ivanov Date: Wed, 27 Dec 2023 15:06:49 +0000 Subject: [PATCH] Fixed link warnings in docs --- docs/component/back-button.md | 4 ++-- docs/component/child-components.md | 3 +-- docs/component/custom-component-context.md | 2 +- docs/component/lifecycle.md | 2 +- docs/component/overview.md | 4 ++-- docs/extensions/compose.md | 6 +++--- docs/extensions/overview.md | 4 ++-- docs/getting-started/installation.md | 8 ++++---- docs/getting-started/quick-start.md | 12 ++++++------ docs/navigation/overview.md | 12 ++++++------ docs/navigation/pages/navigation.md | 2 +- docs/navigation/pages/overview.md | 2 +- docs/navigation/slot/overview.md | 2 +- docs/navigation/stack/deeplinking.md | 2 +- docs/navigation/stack/navigation.md | 2 +- docs/navigation/stack/overview.md | 2 +- 16 files changed, 34 insertions(+), 35 deletions(-) diff --git a/docs/component/back-button.md b/docs/component/back-button.md index 9f406db19..55e670976 100644 --- a/docs/component/back-button.md +++ b/docs/component/back-button.md @@ -6,7 +6,7 @@ Some devices (e.g. Android) have hardware back buttons. A very common use case i `Child Stack` and `Child Pages` can automatically navigate back when the back button is pressed. All you need to do is to supply the `handleBackButton=true` argument when you initialize a navigation model. -Similarly, `Child Slot` can automatically dismiss the child component when the back button is pressed. see the [Child Slot](/Decompose/navigation/slot/overview/) documentation page for more information. +Similarly, `Child Slot` can automatically dismiss the child component when the back button is pressed. See the [Child Slot](../navigation/slot/overview.md) documentation page for more information. ## Manual back button handling @@ -51,4 +51,4 @@ private val backCallback = BackCallback(priority = Int.MIN_VALUE) { ... } ## Predictive Back Gesture -Decompose experimentally supports the new [Android Predictive Back Gesture](https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture), not only on Android. The UI part is covered by Compose extensions, please see the [related docs](../../extensions/compose#predictive-back-gesture). +Decompose experimentally supports the new [Android Predictive Back Gesture](https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture), not only on Android. The UI part is covered by Compose extensions, please see the [related docs](../extensions/compose.md#predictive-back-gesture). diff --git a/docs/component/child-components.md b/docs/component/child-components.md index 89ba5ab81..cc55e2bdd 100644 --- a/docs/component/child-components.md +++ b/docs/component/child-components.md @@ -5,8 +5,7 @@ Decompose provides ability to organize components as trees, so each parent compo There are two common ways to work with child components: - Navigation - when you need to dynamically switch child components. Please head to - the [Navigation](/Decompose/navigation/overview/) documentation page for more - information. + the [Navigation](../navigation/overview.md) documentation page for more information. - Manually - when you need to add a permanent child component, or to manually control its `Lifecycle`. ## Adding a child component manually diff --git a/docs/component/custom-component-context.md b/docs/component/custom-component-context.md index 7c4f1ac41..ec523fd83 100644 --- a/docs/component/custom-component-context.md +++ b/docs/component/custom-component-context.md @@ -24,7 +24,7 @@ class DefaultAppComponentContext( ## Custom child ComponentContext -The default [ComponentContext#childContext](../child-components/#adding-a-child-component-manually) extension function returns the default `ComponentContext`. In order to create custom child `ComponentContext`, a special extension function is required. +The default [ComponentContext#childContext](child-components.md#adding-a-child-component-manually) extension function returns the default `ComponentContext`. In order to create custom child `ComponentContext`, a special extension function is required. ```kotlin fun AppComponentContext.childAppContext(key: String, lifecycle: Lifecycle? = null): AppComponentContext = diff --git a/docs/component/lifecycle.md b/docs/component/lifecycle.md index 9ce85a484..0f523d1cc 100644 --- a/docs/component/lifecycle.md +++ b/docs/component/lifecycle.md @@ -44,4 +44,4 @@ class SomeComponent( ## Managing the root lifecycle -When creating a root component, it's required to supply the root lifecycle (see the [docs](../overview/#root-componentcontext) for more information about the root `ComponentContext`). The way how the root lifecycle is controlled depends on the platform. See [Quick Start](../../getting-started/quick-start) docs for details and examples. +When creating a root component, it's required to supply the root lifecycle (see the [docs](overview.md#root-componentcontext) for more information about the root `ComponentContext`). The way how the root lifecycle is controlled depends on the platform. See [Quick Start](../getting-started/quick-start.md) docs for details and examples. diff --git a/docs/component/overview.md b/docs/component/overview.md index 19f305319..e44236897 100644 --- a/docs/component/overview.md +++ b/docs/component/overview.md @@ -1,6 +1,6 @@ # Component Overview -A component is just a normal class that encapsulates some logic and possibly another (child) components. Every component has its own lifecycle, which is automatically managed by Decompose. So everything encapsulated by a component is scoped. Please head to the [Lifecycle documentation page](/Decompose/component/lifecycle/) for more information. +A component is just a normal class that encapsulates some logic and possibly another (child) components. Every component has its own lifecycle, which is automatically managed by Decompose. So everything encapsulated by a component is scoped. Please head to the [Lifecycle documentation page](lifecycle.md) for more information. UI is optional and is pluggable from outside of components. Components do not depend on UI, the UI depends on components. @@ -148,7 +148,7 @@ fun main() { Using `Value` is not mandatory, you can use any other state holders, e.g. [StateFlow](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/), [State](https://developer.android.com/jetpack/compose/state), [Observable](https://github.com/badoo/Reaktive), [LiveData](https://developer.android.com/topic/libraries/architecture/livedata), etc. -If you are using Jetpack/JetBrains Compose, `Value` can be observed in Composable functions using one of the Compose [extension modules](/Decompose/extensions/compose/). +If you are using Jetpack/JetBrains Compose, `Value` can be observed in Composable functions using one of the Compose [extension modules](../extensions/compose.md). !!!warning Even though both `Value` and `MutableValue` are thread-safe, it's recommended to subscribe and update it only on the main thread. diff --git a/docs/extensions/compose.md b/docs/extensions/compose.md index de93855f1..f5b2c9507 100644 --- a/docs/extensions/compose.md +++ b/docs/extensions/compose.md @@ -4,7 +4,7 @@ Extensions and utilities for easier integration of Decompose with Jetpack and Mu ## Setup -Please see the corresponding [Installation docs section](/Decompose/getting-started/installation/#extensions-for-jetpackjetbrains-compose). +Please see the corresponding [Installation docs section](../getting-started/installation.md#extensions-for-jetpack-and-multiplatform-compose). ### ProGuard rules for Compose for Desktop (JVM) @@ -63,7 +63,7 @@ fun main() { ## Navigating between Composable components -The [Child Stack](/Decompose/navigation/stack/overview/) navigation model provides [ChildStack](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStack.kt) as `Value` that can be observed in a `Composable` component. This makes it possible to switch child `Composable` components following the `ChildStack` changes. +The [Child Stack](../navigation/stack/overview.md) navigation model provides [ChildStack](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStack.kt) as `Value` that can be observed in a `Composable` component. This makes it possible to switch child `Composable` components following the `ChildStack` changes. Both Compose extension modules provide the [Children(...)](https://github.com/arkivanov/Decompose/blob/master/extensions-compose-jetbrains/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/Children.kt) function which has the following features: @@ -158,7 +158,7 @@ fun DialogContent(component: DialogComponent) { !!!warning This navigation model is experimental, the API is subject to change. -The [Child Pages](/Decompose/navigation/pages/overview/) navigation model provides [ChildPages](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/ChildPages.kt) as `Value` that can be observed in a `Composable` component. +The [Child Pages](../navigation/pages/overview.md) navigation model provides [ChildPages](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/ChildPages.kt) as `Value` that can be observed in a `Composable` component. Both Compose extension modules provide the [Pages(...)](https://github.com/arkivanov/Decompose/blob/master/extensions-compose-jetbrains/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/pages/Pages.kt) function which has the following features: diff --git a/docs/extensions/overview.md b/docs/extensions/overview.md index 009fc8be6..65d892d7a 100644 --- a/docs/extensions/overview.md +++ b/docs/extensions/overview.md @@ -2,5 +2,5 @@ Decompose provides extension modules for various popular libraries and frameworks: -- [Extensions for Jetpack/JetBrains Compose](/Decompose/extensions/compose/) -- [Extensions for Android views](/Decompose/extensions/android/) +- [Extensions for Jetpack/JetBrains Compose](compose.md) +- [Extensions for Android views](android.md) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 8dd2ad590..a594e9970 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -4,7 +4,7 @@ Decompose provides a number of modules, they are all published to Maven Central ## The main Decompose module -The main functionality is provided by the `decompose` module. It contains some core features like [ComponentContext](/Decompose/component/overview/#componentcontext), [Child Stack](/Decompose/navigation/stack/overview/), etc. +The main functionality is provided by the `decompose` module. It contains some core features like [ComponentContext](../component/overview.md#componentcontext), [Child Stack](../navigation/stack/overview.md), etc. ### Gradle setup @@ -41,7 +41,7 @@ Compose is currently published in two separate variants: - `extensions-compose-jetpack` - Android library for Jetpack Compose. - `extensions-compose-jetbrains` - Kotlin Multiplatform library for Multiplatform Compose. - Both modules are used to connect Compose with Decompose components. Please see the corresponding [documentation page](/Decompose/extensions/compose/). + Both modules are used to connect Compose with Decompose components. Please see the corresponding [documentation page](../extensions/compose.md). === "Since v3.0.0-alpha01" @@ -49,7 +49,7 @@ Compose is currently published in two separate variants: - `extensions-compose` - compatible with both Jetpack Compose and Multiplatform Compose. - The module is used to connect Compose with Decompose components. Please see the corresponding [documentation page](/Decompose/extensions/compose/). + The module is used to connect Compose with Decompose components. Please see the corresponding [documentation page](../extensions/compose.md). ### Gradle setup @@ -116,7 +116,7 @@ Compose is currently published in two separate variants: ## Extensions for Android views -The `extensions-android` module provides extensions to connect Android views based UI to Decompose components. Please head to the corresponding [documentation page](/Decompose/extensions/android/) for more information. +The `extensions-android` module provides extensions to connect Android views based UI to Decompose components. Please head to the corresponding [documentation page](../extensions/android.md) for more information. ### Gradle setup diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md index 80a074b08..25c309b5c 100644 --- a/docs/getting-started/quick-start.md +++ b/docs/getting-started/quick-start.md @@ -8,7 +8,7 @@ Please see the [template repository](https://github.com/arkivanov/decompose-mult class RootComponent ``` -Yes, a simplest component is just a normal class. No need to extend a class from the library, or implement an interface. +Yes, the simplest component is just a normal class. No need to extend a class from the library, or implement an interface. ## Extracting an interface @@ -22,7 +22,7 @@ It's often useful to extract an interface for a component. It makes it possible ## ComponentContext -[ComponentContext](/Decompose/component/overview/#componentcontext) is probably the most important concept of Decompose. It is an interface that provides access to various tools, like lifecycle, state preservation, instance retaining (aka Android ViewModel), back button handling, etc. Each component has its own `ComponentContext` provided by Decompose. +[ComponentContext](../component/overview.md#componentcontext) is probably the most important concept of Decompose. It is an interface that provides access to various tools, like lifecycle, state preservation, instance retaining (aka Android ViewModel), back button handling, etc. Each component has its own `ComponentContext` provided by Decompose. If your component requires `ComponentContext`, just pass it via constructor. You can also use the delegation pattern to add `ComponentContext` to `this` scope. @@ -122,7 +122,7 @@ struct DetailsView: View { ### Observing Value in other UI Frameworks -Please refer to the [docs](/Decompose/component/overview/) for information about other platforms and UI frameworks. +Please refer to the [docs](../component/overview.md) for information about other platforms and UI frameworks. ### Using Reaktive or coroutines @@ -130,7 +130,7 @@ The state can be also exposed using Reaktive `Observable` or coroutines `Flow`, ## Navigation -Decompose provides various ways to navigate, you can find more information in the [docs](/Decompose/navigation/overview/). The most common navigation pattern is [Child Stack](/Decompose/navigation/stack/overview/). +Decompose provides various ways to navigate, you can find more information in the [docs](../navigation/overview.md). The most common navigation pattern is [Child Stack](../navigation/stack/overview.md). ### Component configurations @@ -328,7 +328,7 @@ struct RootView: View { ### Child Stack with other UI Frameworks -Please refer to [samples](/Decompose/samples/) for integrations with other UI frameworks. +Please refer to [samples](../samples.md) for integrations with other UI frameworks. ## Initializing a root component @@ -538,4 +538,4 @@ private val Document.visibilityState: String ### Other platforms and UI frameworks -Please refer to [samples](/Decompose/samples/) for integrations with other platforms and UI frameworks. +Please refer to [samples](../samples.md) for integrations with other platforms and UI frameworks. diff --git a/docs/navigation/overview.md b/docs/navigation/overview.md index e0bf19a74..49d3fd808 100644 --- a/docs/navigation/overview.md +++ b/docs/navigation/overview.md @@ -1,12 +1,12 @@ # Navigation overview -Decompose provides the ability to create [permanent child components](/Decompose/navigation/stack/overview/) using the `childStack` extension function. But if you need to dynamically switch child components, then navigation comes in handy. +Decompose provides the ability to create [permanent child components](../navigation/stack/overview.md) using the `childStack` extension function. But if you need to dynamically switch child components, then navigation comes in handy. Currently, Decompose provides two predefined navigation models: -- [Child Stack](/Decompose/navigation/stack/overview/) - prefer this way if you need to organize child components in a stack and navigate between them. -- [Child Slot](/Decompose/navigation/slot/overview/) - prefer this way if you need to activate-dismiss one child component at a time. -- [Child Pages](/Decompose/navigation/pages/overview/) - prefer this way if you need to organize child components in a list with one selected component. +- [Child Stack](../navigation/stack/overview.md) - prefer this way if you need to organize child components in a stack and navigate between them. +- [Child Slot](../navigation/slot/overview.md) - prefer this way if you need to activate-dismiss one child component at a time. +- [Child Pages](../navigation/pages/overview.md) - prefer this way if you need to organize child components in a list with one selected component. If none of this fit your needs, Decompose introduces [Generic Navigation](https://arkivanov.github.io/Decompose/navigation/children/overview/) that can be used to create your own custom navigation models. It offers a flexible API and allows you to create almost any kind of navigation. @@ -15,9 +15,9 @@ It is possible to have more than one navigation model in a parent component. Mak ## Component configurations and child factories -The term `Configuration` is widely used in Decompose navigation. A configuration is a persistent class that represents a child component and contains all its arguments (not dependencies). Decompose automatically persists child configurations using [StateKeeper](/Decompose/component/state-preservation/), so child components are automatically recreated on events like Android configuration changes, process death, etc. +The term `Configuration` is widely used in Decompose navigation. A configuration is a persistent class that represents a child component and contains all its arguments (not dependencies). Decompose automatically persists child configurations using [StateKeeper](../component/state-preservation.md), so child components are automatically recreated on events like Android configuration changes, process death, etc. -Usually, you initialize a navigation by supplying a child factory function to Decompose. The function accepts a child configuration and `ComponentContext` and returns a new instance of the corresponding child component - `(Config, ComponentContext) -> Child`. When you need to navigate, you call a navigation method and pass a configuration there. Decompose automatically creates and manages a [ComponentContext](/Decompose/component/overview/#componentcontext) for every child component, and calls the provided factory function when a new instance of a child component is required. This is where you should instantiate child components and supply dependencies, the configuration only provides persistent arguments and is used to distinguish which component to create. +Usually, you initialize a navigation by supplying a child factory function to Decompose. The function accepts a child configuration and `ComponentContext` and returns a new instance of the corresponding child component - `(Config, ComponentContext) -> Child`. When you need to navigate, you call a navigation method and pass a configuration there. Decompose automatically creates and manages a [ComponentContext](../component/overview.md#componentcontext) for every child component, and calls the provided factory function when a new instance of a child component is required. This is where you should instantiate child components and supply dependencies, the configuration only provides persistent arguments and is used to distinguish which component to create. ### Configuration requirements diff --git a/docs/navigation/pages/navigation.md b/docs/navigation/pages/navigation.md index fbd77ef0d..c20277284 100644 --- a/docs/navigation/pages/navigation.md +++ b/docs/navigation/pages/navigation.md @@ -23,7 +23,7 @@ The navigation is usually performed synchronously, which means that by the time ## PagesNavigator extension functions -There are `PagesNavigator` [extension functions](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/PagesNavigatorExt.kt) to simplify the navigation. Some of which were already used in the [Child Pages overview example](../overview#example). +There are `PagesNavigator` [extension functions](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/pages/PagesNavigatorExt.kt) to simplify the navigation. Some of which were already used in the [Child Pages Overview example](overview.md#example). ### selectNext diff --git a/docs/navigation/pages/overview.md b/docs/navigation/pages/overview.md index ca109d9e0..bc3dafeb6 100644 --- a/docs/navigation/pages/overview.md +++ b/docs/navigation/pages/overview.md @@ -23,7 +23,7 @@ The `Child Pages` navigation model consists of two main entities: ### Component Configurations -Similarly to `Child Stack`, each component created and managed by the `Child Pages` has a configuration, please read the documentation about [child configurations](/Decompose/navigation/overview/#component-configurations-and-child-factories). +Similarly to `Child Stack`, each component created and managed by the `Child Pages` has a configuration, please read the documentation about [child configurations](../overview.md#component-configurations-and-child-factories). `Child Pages` adds one additional requirement for child configurations: diff --git a/docs/navigation/slot/overview.md b/docs/navigation/slot/overview.md index 29209c5f2..c699871c7 100644 --- a/docs/navigation/slot/overview.md +++ b/docs/navigation/slot/overview.md @@ -13,7 +13,7 @@ The `Child Slot` navigation consists of two main entities: ### Component Configurations -Each component created and managed by the `Child Slot` has a configuration, please read the documentation about [child configurations](/Decompose/navigation/overview/#component-configurations-and-child-factories). +Each component created and managed by the `Child Slot` has a configuration, please read the documentation about [child configurations](../overview.md#component-configurations-and-child-factories). ### Initializing the Child Slot diff --git a/docs/navigation/stack/deeplinking.md b/docs/navigation/stack/deeplinking.md index 7f6ef63b0..48d7f47eb 100644 --- a/docs/navigation/stack/deeplinking.md +++ b/docs/navigation/stack/deeplinking.md @@ -9,7 +9,7 @@ documentation. For example here is the [related documentation](https://developer ### Handling deep links -Given the basic example from the [Child Stack overview](../overview) page, we can easily handle deep +Given the basic example from the [Child Stack Overview](../overview.md) page, we can easily handle deep links. Let's say we have a link like `http://myitems.com?itemId=3`. When the user clicks on it, we want to open the details screen of the item with the provided `id`. When the user closes the details screen, they should be navigated back to the list screen. The idea is to pass parsed data from the deep link to a component responsible for navigation, in our case it is the `Root` component. diff --git a/docs/navigation/stack/navigation.md b/docs/navigation/stack/navigation.md index bf3845da8..6272d103e 100644 --- a/docs/navigation/stack/navigation.md +++ b/docs/navigation/stack/navigation.md @@ -26,7 +26,7 @@ The `Child Stack` usually performs the navigation synchronously, which means tha ## StackNavigator extension functions -There are `StackNavigator` [extension functions](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt) to simplify the navigation. Some of which were already used in the [Child Stack overview example](../overview#example). +There are `StackNavigator` [extension functions](https://github.com/arkivanov/Decompose/blob/master/decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt) to simplify the navigation. Some of which were already used in the [Child Stack Overview example](overview.md#example). ### push(configuration) diff --git a/docs/navigation/stack/overview.md b/docs/navigation/stack/overview.md index b0ce491e2..63057e4ee 100644 --- a/docs/navigation/stack/overview.md +++ b/docs/navigation/stack/overview.md @@ -15,7 +15,7 @@ The `Child Stack` navigation consists of two main entities: ### Component Configurations -Each component created and managed by the `Child Stack` has a configuration, please read the documentation about [child configurations](/Decompose/navigation/overview/#component-configurations-and-child-factories). +Each component created and managed by the `Child Stack` has a configuration, please read the documentation about [child configurations](../overview.md#component-configurations-and-child-factories). `Child Stack` adds one additional requirement for child configurations: