From b3928c7c2c02f482d341e010abd0ccbb1a11c0b9 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Sun, 7 Jul 2024 20:52:03 +0200 Subject: [PATCH] Fix doc links --- docs/features/builtin-types.mdx | 4 ++-- docs/features/callables.mdx | 8 ++++---- docs/features/classes.mdx | 2 +- docs/features/enums.mdx | 2 +- docs/features/exceptions.mdx | 4 ++-- docs/features/interfaces.mdx | 4 ++-- docs/features/suspend-functions.mdx | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/features/builtin-types.mdx b/docs/features/builtin-types.mdx index f059d39..d9162c8 100644 --- a/docs/features/builtin-types.mdx +++ b/docs/features/builtin-types.mdx @@ -4,14 +4,14 @@ title: Built-in types # Built-in types -Whenever [callables](../callables) are declared, Knee compiler's task is being able to serialize and deserialize, +Whenever [callables](callables) are declared, Knee compiler's task is being able to serialize and deserialize, both on the backend and on the frontend: - function arguments, or the property type for setters - the function return type, or the property type for getters By default, Knee provides built-in support for many commonly used types, and utilities to define others -(for example, [enums](../enums), [classes](../classes), [interfaces](../interfaces)) and even import external declarations. +(for example, [enums](enums), [classes](classes), [interfaces](interfaces)) and even import external declarations. ## Primitives diff --git a/docs/features/callables.mdx b/docs/features/callables.mdx index 0ff3c8b..1b08fb4 100644 --- a/docs/features/callables.mdx +++ b/docs/features/callables.mdx @@ -10,8 +10,8 @@ either side of the JNI interface (frontend or backend), execute your code on the ## Functions For a function to be available on the JVM side, it must be annotated with the `@Knee` annotation. -We support top-level functions and functions nested in `@KneeClass` declarations, as you can learn in [classes](../classes). -Upward functions (called from K/N, implemented on the JVM) are also available through [interfaces](../interfaces). +We support top-level functions and functions nested in `@KneeClass` declarations, as you can learn in [classes](classes). +Upward functions (called from K/N, implemented on the JVM) are also available through [interfaces](interfaces). ```kotlin // Kotlin/Native @@ -26,8 +26,8 @@ check(topLevelFunction() == 42) ## Properties For a property to be available on the JVM side, it must be annotated with the `@Knee` annotation. -We support top-level properties and properties nested in `@KneeClass` declarations, as you can learn in [classes](../classes). -Upward properties (called from K/N, implemented on the JVM) are also available through [interfaces](../interfaces). +We support top-level properties and properties nested in `@KneeClass` declarations, as you can learn in [classes](classes). +Upward properties (called from K/N, implemented on the JVM) are also available through [interfaces](interfaces). Both `var` and `val` properties are supported. diff --git a/docs/features/classes.mdx b/docs/features/classes.mdx index 6bc464f..2014f37 100644 --- a/docs/features/classes.mdx +++ b/docs/features/classes.mdx @@ -64,7 +64,7 @@ In the example above, `Post` can't be instantiated from the JVM side, while `Use ## Annotating members All callable members (functions, properties, constructors) of a class can be made available to the JVM side, but -they must be explicitly marked with the `@Knee` annotation as described in the [callables](../callables) documentation. +they must be explicitly marked with the `@Knee` annotation as described in the [callables](callables) documentation. ```kotlin @KneeClass class Car { diff --git a/docs/features/enums.mdx b/docs/features/enums.mdx index 01e19b8..255547a 100644 --- a/docs/features/enums.mdx +++ b/docs/features/enums.mdx @@ -10,7 +10,7 @@ Enums can be easily serialized through their ordinal value. You can use the `@Kn compiler that: - this native enum is expected to be serialized, so a JVM clone must be generated -- the compiler must serialize and deserialize these types whenever they are part of a [callable](../callables) declaration, e.g. a function argument or return type +- the compiler must serialize and deserialize these types whenever they are part of a [callable](callables) declaration, e.g. a function argument or return type In the following example: diff --git a/docs/features/exceptions.mdx b/docs/features/exceptions.mdx index 84bced8..c142398 100644 --- a/docs/features/exceptions.mdx +++ b/docs/features/exceptions.mdx @@ -4,7 +4,7 @@ title: Exceptions # Exceptions -Whenever a `@Knee` [callable](../callables) throws, the exception is thrown on the other side of the bridge. +Whenever a `@Knee` [callable](callables) throws, the exception is thrown on the other side of the bridge. ```kotlin // Kotlin/Native @@ -62,7 +62,7 @@ checks and can only work when such mechanism is in place. ## Custom exceptions -You may also use custom exceptions, as long as they were properly annotated as [classes](../classes). +You may also use custom exceptions, as long as they were properly annotated as [classes](classes). ```kotlin @KneeClass diff --git a/docs/features/interfaces.mdx b/docs/features/interfaces.mdx index 42f128f..e565083 100644 --- a/docs/features/interfaces.mdx +++ b/docs/features/interfaces.mdx @@ -6,7 +6,7 @@ title: Interfaces ## Annotating interfaces -> We recommend reading the [classes](../classes) documentation first. +> We recommend reading the [classes](classes) documentation first. Whenever you declare an interface, you can use the `@KneeInterface` annotation to tell the compiler that it should be processed. @@ -27,7 +27,7 @@ will be generated for the JVM sources. ## Two-way implementation -Unlike [classes](../classes), where the implementation of members is done on the Kotlin Native side and the JVM instance +Unlike [classes](classes), where the implementation of members is done on the Kotlin Native side and the JVM instance is just a wrapper around it, `@KneeInterface` interface allow implementation from both sides. This makes it a much more powerful tool! You can do either of the following: diff --git a/docs/features/suspend-functions.mdx b/docs/features/suspend-functions.mdx index c2a99bf..886d03e 100644 --- a/docs/features/suspend-functions.mdx +++ b/docs/features/suspend-functions.mdx @@ -6,7 +6,7 @@ title: Suspend functions ## Declaration -All [functions](../callables#functions) that support the `@Knee` annotation can also be marked as `suspend`. +All [functions](callables#functions) that support the `@Knee` annotation can also be marked as `suspend`. The developer UX is exactly the same: ```kotlin @@ -31,7 +31,7 @@ In the example above: - If the JVM `scope` is cancelled, the native coroutines are also cancelled - If the native coroutines are cancelled, `computeNumber` throws a `CancellationException` -- Errors are propagated up/down and the exception type, if possible, is [preserved](../exceptions) +- Errors are propagated up/down and the exception type, if possible, is [preserved](exceptions) In short, calling a `@Knee` suspend function is no different than calling a local suspend function and you can expect the same level of support. In particular Knee preserves the hierarchy of coroutines