Skip to content

Commit

Permalink
Fixed link warnings in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arkivanov committed Dec 27, 2023
1 parent bcb0fc9 commit 78f737a
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions docs/component/back-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
3 changes: 1 addition & 2 deletions docs/component/child-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/component/custom-component-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion docs/component/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions docs/component/overview.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions docs/extensions/compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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<ChildStack>` 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<ChildStack>` 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:

Expand Down Expand Up @@ -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<ChildPages>` 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<ChildPages>` 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:

Expand Down
4 changes: 2 additions & 2 deletions docs/extensions/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -41,15 +41,15 @@ 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"

Since Decompose version v3.0.0-alpha01 there is just one extension module for Compose:

- `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

Expand Down Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand Down Expand Up @@ -122,15 +122,15 @@ 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

The state can be also exposed using Reaktive `Observable` or coroutines `Flow`, or any other reactive library. Follow best practices recommended for the reactive library of your choice.

## 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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
12 changes: 6 additions & 6 deletions docs/navigation/overview.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/navigation/pages/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/navigation/pages/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/navigation/slot/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit 78f737a

Please sign in to comment.