diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml
index 3c3d5277108f..a65b51266eb3 100644
--- a/.github/workflows/book.yml
+++ b/.github/workflows/book.yml
@@ -12,7 +12,7 @@ on:
jobs:
build-deploy:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
name: build
steps:
- uses: actions/checkout@v4
@@ -27,6 +27,12 @@ jobs:
- run: mdbook build -d public
working-directory: book
+
+ - name: Link Checker
+ uses: lycheeverse/lychee-action@v1.8.0
+ with:
+ args: book/book
+ fail: true
- name: Deploy to stable
uses: peaceiris/actions-gh-pages@v3
diff --git a/book/src/actions.md b/book/src/actions.md
index 33ff5e69dd43..9cf72aa69373 100644
--- a/book/src/actions.md
+++ b/book/src/actions.md
@@ -23,8 +23,8 @@ Filename: Adding "win.close" was useful as a simple example.
-> However, in the future we will use the pre-defined ["window.close"](../docs/gtk4/struct.Window.html#actions) action which does exactly the same thing.
+> However, in the future we will use the pre-defined ["window.close"](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Window.html#actions) action which does exactly the same thing.
## Parameter and State
@@ -76,10 +76,10 @@ This is how our app works:
## Actionable
-Connecting actions to the "clicked" signal of buttons is a typical use case, which is why all buttons implement the [`Actionable`](../docs/gtk4/struct.Actionable.html) interface.
+Connecting actions to the "clicked" signal of buttons is a typical use case, which is why all buttons implement the [`Actionable`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Actionable.html) interface.
This way, the action can be specified by setting the "action-name" property.
If the action accepts a parameter, it can be set via the "action-target" property.
-With [`ButtonBuilder`](../docs/gtk4/builders/struct.ButtonBuilder.html), we can set everything up by calling its methods.
+With [`ButtonBuilder`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/builders/struct.ButtonBuilder.html), we can set everything up by calling its methods.
Filename: listings/actions/4/main.rs
@@ -206,8 +206,8 @@ Filename: vertical
```
-Since we connect the menu to the [`gtk::MenuButton`](../docs/gtk4/struct.MenuButton.html) via the [menu-model](../docs/gtk4/struct.MenuButton.html#menu-model) property, the `Menu` is expected to be a [`gtk::PopoverMenu`](../docs/gtk4/struct.PopoverMenu.html).
-The [documentation](../docs/gtk4/struct.PopoverMenu.html) for `PopoverMenu` also explains its `xml` syntax for the interface builder.
+Since we connect the menu to the [`gtk::MenuButton`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.MenuButton.html) via the [menu-model](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.MenuButton.html#menu-model) property, the `Menu` is expected to be a [`gtk::PopoverMenu`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.PopoverMenu.html).
+The [documentation](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.PopoverMenu.html) for `PopoverMenu` also explains its `xml` syntax for the interface builder.
Also note how we specified the target:
@@ -234,7 +234,7 @@ This is how the app looks in action:
>We changed the icon of the `MenuButton` by setting its property "icon-name" to "open-menu-symbolic".
->You can find more icons with the [Icon Library](https://apps.gnome.org/app/org.gnome.design.IconLibrary/).
+>You can find more icons with the [Icon Library](https://flathub.org/apps/org.gnome.design.IconLibrary).
>They can be embedded with [`gio::Resource`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/struct.Resource.html) and then be referenced within the composite templates (or other places).
## Settings
diff --git a/book/src/composite_templates.md b/book/src/composite_templates.md
index 90911dfeafac..555189e65d98 100644
--- a/book/src/composite_templates.md
+++ b/book/src/composite_templates.md
@@ -26,10 +26,10 @@ Filename: listings/composite_templates/1/window/imp.rs
@@ -154,9 +154,9 @@ Filename: listings/composite_templates/3/window/imp.rs
@@ -240,7 +240,7 @@ Thanks to composite templates we can
- specify handler functions for signals.
The API involved here is extensive so especially at the beginning you will want to check out the documentation.
-The basic syntax of the `ui` files is explained within [`Builder`](../docs/gtk4/struct.Builder.html#gtkbuilder-ui-definitions), syntax specific to widgets within [`Widget`](../docs/gtk4/struct.Widget.html#gtkwidget-as-gtkbuildable).
+The basic syntax of the `ui` files is explained within [`Builder`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Builder.html#gtkbuilder-ui-definitions), syntax specific to widgets within [`Widget`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Widget.html#gtkwidget-as-gtkbuildable).
If a certain widget accepts additional element, then they are typically explained in the docs of the widget.
In the following chapter, we will see how composite templates help us to create slightly bigger apps such as a To-Do app.
diff --git a/book/src/css.md b/book/src/css.md
index feb1f6c19a3f..ae84b83a2df4 100644
--- a/book/src/css.md
+++ b/book/src/css.md
@@ -47,7 +47,7 @@ We did not specify for which button the rule should apply, so it was applied to
[Class selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) are one way to choose which specific elements a CSS rule applies to.
GTK adds style classes to many of its widgets, often depending on their content.
-A [`gtk::Button`](../docs/gtk4/struct.Button.html#css-nodes), for example, will get the `text-button` style class when its content is a label.
+A [`gtk::Button`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Button.html#css-nodes), for example, will get the `text-button` style class when its content is a label.
That is why we create a new CSS rule which only applies to `button` nodes with the style class `text_button`.
@@ -63,7 +63,7 @@ Now only the font of our button becomes magenta.
## Adding Your Own Style Class
-With [`add_css_class`](../docs/gtk4/prelude/trait.WidgetExt.html#tymethod.add_css_class) we can also add our own style classes to widgets.
+With [`add_css_class`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/prelude/trait.WidgetExt.html#tymethod.add_css_class) we can also add our own style classes to widgets.
One use-case for this is when you want a rule to apply to a hand-picked set of widgets.
For example if we have two buttons, but want only one of them to have magenta font.
Relying on one of the style classes which GTK adds will not help since both will get the same ones.
@@ -96,7 +96,7 @@ Ideally however, you would give the widget a name and match with that name inste
This way your intentions are more clear, compared to matching with style classes that can apply to multiple widgets.
Again, we have two buttons but want to color only one of them magenta.
-We set the name of the first one with [`set_widget_name`](../docs/gtk4/prelude/trait.WidgetExt.html#tymethod.set_widget_name).
+We set the name of the first one with [`set_widget_name`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/prelude/trait.WidgetExt.html#tymethod.set_widget_name).
Filename: listings/css/4/main.rs
@@ -123,7 +123,7 @@ Again, the style rule only applies to the first button.
Certain styles are common enough that GTK provides CSS rules for them.
For example, if you want to indicate that your button leads to a destructive or suggested action you don't have to provide your own CSS rules.
All you have to do is to add "destructive-action" or "suggested-action" style class to your button.
-Most widgets will document these rules in their documentation under [CSS nodes](../docs/gtk4/struct.Button.html#css-nodes).
+Most widgets will document these rules in their documentation under [CSS nodes](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Button.html#css-nodes).
Filename: listings/css/5/main.rs
@@ -137,7 +137,7 @@ Filename: listings/css/6/window/window.ui
@@ -181,7 +181,7 @@ After we removed the cursor, the button returns to its original state.
In the previous examples, a widget always corresponded to a single CSS node.
This is not always the case.
-For example, [`gtk::MenuButton`](../docs/gtk4/struct.MenuButton.html) has multiple CSS nodes.
+For example, [`gtk::MenuButton`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.MenuButton.html) has multiple CSS nodes.
Let's see how that works.
First, we create a single `MenuButton`.
@@ -195,7 +195,7 @@ Filename: listings/todo/3/task_row/imp.rs
diff --git a/book/src/g_object_properties.md b/book/src/g_object_properties.md
index 046ba7a1198d..348bbfd75e05 100644
--- a/book/src/g_object_properties.md
+++ b/book/src/g_object_properties.md
@@ -3,9 +3,9 @@
Properties provide a public API for accessing state of GObjects.
Let's see how this is done by experimenting with the [`Switch`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html) widget.
-One of its properties is called [active](../docs/gtk4/struct.Switch.html#active).
+One of its properties is called [active](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html#active).
According to the GTK docs, it can be read and be written to.
-That is why `gtk-rs` provides corresponding [`is_active`](../docs/gtk4/struct.Switch.html#method.is_active) and [`set_active`](../docs/gtk4/struct.Switch.html#method.set_active) methods.
+That is why `gtk-rs` provides corresponding [`is_active`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html#method.is_active) and [`set_active`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html#method.set_active) methods.
Filename: listings/g_object_properties/1/main.rs
diff --git a/book/src/g_object_signals.md b/book/src/g_object_signals.md
index 4180e35632d2..26035f58fe21 100644
--- a/book/src/g_object_signals.md
+++ b/book/src/g_object_signals.md
@@ -5,7 +5,7 @@ For example, if we press on a button, the "clicked" signal will be emitted.
The signal then takes care that all the registered callbacks will be executed.
`gtk-rs` provides convenience methods for registering callbacks.
-In our "Hello World" example we [connected](../docs/gtk4/prelude/trait.ButtonExt.html#tymethod.connect_clicked) the "clicked" signal to a closure which sets the label of the button to "Hello World" as soon as it gets called.
+In our "Hello World" example we [connected](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/prelude/trait.ButtonExt.html#tymethod.connect_clicked) the "clicked" signal to a closure which sets the label of the button to "Hello World" as soon as it gets called.
Filename: listings/hello_world/3/main.rs
diff --git a/book/src/hello_world.md b/book/src/hello_world.md
index 14c7aa0e6785..6e6c2e4f8e2b 100644
--- a/book/src/hello_world.md
+++ b/book/src/hello_world.md
@@ -2,7 +2,7 @@
Now that we've got a working installation, let's get right into it!
-At the very least, we need to create a [`gtk::Application`](../docs/gtk4/struct.Application.html) instance with an [application id](https://developer.gnome.org/documentation/tutorials/application-id.html).
+At the very least, we need to create a [`gtk::Application`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Application.html) instance with an [application id](https://developer.gnome.org/documentation/tutorials/application-id.html).
For that we use the [builder pattern](https://rust-unofficial.github.io/patterns/patterns/creational/builder.html) which many `gtk-rs` objects support.
Note that we also import the prelude to bring the necessary traits into scope.
@@ -20,7 +20,7 @@ and has no handlers connected to the 'activate' signal. It should do one of thes
```
GTK tells us that something should be called in its `activate` step.
-So let's create a [`gtk::ApplicationWindow`](../docs/gtk4/struct.ApplicationWindow.html) there.
+So let's create a [`gtk::ApplicationWindow`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ApplicationWindow.html) there.
Filename: listings/hello_world/2/main.rs
diff --git a/book/src/list_widgets.md b/book/src/list_widgets.md
index 6403b4136fcd..f33c1d9b6f83 100644
--- a/book/src/list_widgets.md
+++ b/book/src/list_widgets.md
@@ -1,7 +1,7 @@
# List Widgets
Sometimes you want to display a list of elements in a certain arrangement.
-[`gtk::ListBox`](../docs/gtk4/struct.ListBox.html) and [`gtk::FlowBox`](../docs/gtk4/struct.FlowBox.html) are two container widgets which allow you to do this.
+[`gtk::ListBox`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ListBox.html) and [`gtk::FlowBox`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.FlowBox.html) are two container widgets which allow you to do this.
`ListBox` describes a vertical list and `FlowBox` describes a grid.
Let's explore this concept by adding labels to a `ListBox`.
@@ -14,7 +14,7 @@ Filename: listings/list_widgets/1/main.rs
@@ -79,7 +79,7 @@ Filename: listings/list_widgets/2/main.rs
@@ -157,7 +157,7 @@ That also means that in our case, multiple numbers will be bound to the same wid
### Expressions
-Situations like these are so common that GTK offers an alternative to property binding: [expressions](../docs/gtk4/struct.Expression.html).
+Situations like these are so common that GTK offers an alternative to property binding: [expressions](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Expression.html).
As a first step it allows us to remove the "bind" step.
Let's see how the "setup" step now works.
@@ -180,7 +180,7 @@ When we now activate a label, only the corresponding number visibly changes.
Let's extend our app a bit more.
We can, for example, filter our model to only allow even numbers.
-We do that by passing it to a [`gtk::FilterListModel`](../docs/gtk4/struct.FilterListModel.html) together with a [`gtk::CustomFilter`](../docs/gtk4/struct.CustomFilter.html)
+We do that by passing it to a [`gtk::FilterListModel`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.FilterListModel.html) together with a [`gtk::CustomFilter`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.CustomFilter.html)
Filename: listings/list_widgets/5/main.rs
@@ -189,7 +189,7 @@ Filename: listings/list_widgets/5/main.rs
@@ -213,7 +213,7 @@ After our changes, the application looks like this:
Often, all you want is to display a list of strings.
However, if you either need to filter and sort your displayed data or have too many elements to be displayed by `ListBox`, you will still want to use a view.
-GTK provides a convenient model for this use case: [`gtk::StringList`](../docs/gtk4/struct.StringList.html).
+GTK provides a convenient model for this use case: [`gtk::StringList`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.StringList.html).
Let's see with a small example how to use this API.
Filter and sorter is controlled by the factory, so nothing changes here.
@@ -231,7 +231,7 @@ Note that we can create a `StringList` directly from an iterator over strings.
This means we don't have to create a custom GObject for our model anymore.
As usual, we connect the label to the list item via an expression.
-Here we can use [`StringObject`](../docs/gtk4/struct.StringObject.html), which exposes its content via the [property "string"](../docs/gtk4/struct.StringObject.html#string).
+Here we can use [`StringObject`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.StringObject.html), which exposes its content via the [property "string"](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.StringObject.html#string).
Filename: listings/list_widgets/6/main.rs
@@ -245,4 +245,4 @@ We now know how to display a list of data.
Small amount of elements can be handled by `ListBox` or `FlowBox`.
These widgets are easy to use and can, if necessary, be bound to a model such as [`gio::ListStore`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/struct.ListStore.html).
Their data can then be modified, sorted and filtered more easily.
-However, if we need the widgets to be scalable, we still need to use [`ListView`](../docs/gtk4/struct.ListView.html), [`ColumnView`](../docs/gtk4/struct.ColumnView.html) or [`GridView`](../docs/gtk4/struct.GridView.html) instead.
+However, if we need the widgets to be scalable, we still need to use [`ListView`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ListView.html), [`ColumnView`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ColumnView.html) or [`GridView`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.GridView.html) instead.
diff --git a/book/src/settings.md b/book/src/settings.md
index 773b00e0cff0..9f53a4c5da6a 100644
--- a/book/src/settings.md
+++ b/book/src/settings.md
@@ -2,7 +2,7 @@
We have now learned multiple ways to handle states.
However, every time we close the application all of it is gone.
-Let's learn how to use [`gio::Settings`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/struct.Settings.html) by storing the state of a [`Switch`](../docs/gtk4/struct.Switch.html) in it.
+Let's learn how to use [`gio::Settings`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/struct.Settings.html) by storing the state of a [`Switch`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html) in it.
At the very beginning we have to create a `GSchema` xml file in order to describe the kind of data our application plans to store in the settings.
@@ -79,7 +79,7 @@ But we can make this even better.
The `Switch` has a property "active" and `Settings` allows us to bind properties to a specific setting.
So let's do exactly that.
-We can remove the [`boolean`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/prelude/trait.SettingsExt.html#tymethod.boolean) call before initializing the `Switch` as well as the [`connect_state_set`](../docs/gtk4/struct.Switch.html#method.connect_state_set) call.
+We can remove the [`boolean`](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/prelude/trait.SettingsExt.html#tymethod.boolean) call before initializing the `Switch` as well as the [`connect_state_set`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Switch.html#method.connect_state_set) call.
We then bind the setting to the property by specifying the key, object and name of the property.
Filename: listings/settings/2/main.rs
diff --git a/book/src/todo_2.md b/book/src/todo_2.md
index 3466058d5f9b..7ec7ac1ffa2f 100644
--- a/book/src/todo_2.md
+++ b/book/src/todo_2.md
@@ -116,7 +116,7 @@ Filename: listings/todo/2/resources/shortcuts.ui
@@ -159,9 +159,9 @@ Filename:
```
-In order to follow the boxed list pattern, we switched to [`gtk::ListBox`](../docs/gtk4/struct.ListBox.html), set its property "selection-mode" to "none" and added the `boxed-list` style class.
+In order to follow the boxed list pattern, we switched to [`gtk::ListBox`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ListBox.html), set its property "selection-mode" to "none" and added the `boxed-list` style class.
Let's continue with `window/imp.rs`.
The member variable `tasks_list` now describes a `ListBox` rather than a `ListView`.
diff --git a/book/src/todo_4.md b/book/src/todo_4.md
index 05b890e212b0..7c129d1debcf 100644
--- a/book/src/todo_4.md
+++ b/book/src/todo_4.md
@@ -10,10 +10,10 @@ We will start by adding an empty sidebar without any functionality.
There are a couple of steps we have to go through to get to this state.
-First, we have to replace [`gtk::ApplicationWindow`](../docs/gtk4/struct.ApplicationWindow.html) with [`adw::ApplicationWindow`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ApplicationWindow.html).
+First, we have to replace [`gtk::ApplicationWindow`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ApplicationWindow.html) with [`adw::ApplicationWindow`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ApplicationWindow.html).
The only difference between those two is that `adw::ApplicationWindow` has no titlebar area.
That comes in handy when we build up our interface with [`adw::Leaflet`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.Leaflet.html).
-In the screenshot above, the `Leaflet` behaves like a [`gtk::Box`](../docs/gtk4/struct.Box.html) and contains the collection view on the left, a separator in the middle and the task view on the right.
+In the screenshot above, the `Leaflet` behaves like a [`gtk::Box`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Box.html) and contains the collection view on the left, a separator in the middle and the task view on the right.
When using `adw::ApplicationWindow` the collection view and task view have their own [`adw::HeaderBar`](https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.HeaderBar.html) and the separator spans over the whole window.
@@ -58,7 +58,7 @@ Filename:
-We now wrap our UI in a [`gtk::Stack`](../docs/gtk4/struct.Stack.html).
+We now wrap our UI in a [`gtk::Stack`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Stack.html).
One stack page describes the placeholder page, the other describes the main page.
We will later wire up the logic to display the correct stack page in the Rust code.
@@ -363,7 +363,7 @@ Filename: listings/todo/8/window/mod.rs
diff --git a/book/src/widgets.md b/book/src/widgets.md
index 25bd73acf20d..c2a3ffe59ec3 100644
--- a/book/src/widgets.md
+++ b/book/src/widgets.md
@@ -23,11 +23,11 @@ GObject
The [GTK documentation](https://docs.gtk.org/gtk4/class.Button.html#implements) also tells us that `Button` implements the interfaces `GtkAccessible`, `GtkActionable`, `GtkBuildable`, `GtkConstraintTarget`.
Now let's compare that with the corresponding `Button` struct in `gtk-rs`.
-The [gtk-rs documentation](../docs/gtk4/struct.Button.html#implements) tells us which traits it implements.
+The [gtk-rs documentation](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.Button.html#implements) tells us which traits it implements.
We find that these traits either have a corresponding base class or interface in the GTK docs.
In the "Hello World" app we wanted to react to a button click.
This behavior is specific to a button, so we expect to find a suitable method in the `ButtonExt` trait.
-And indeed, `ButtonExt` includes the method [`connect_clicked`](../docs/gtk4/prelude/trait.ButtonExt.html#tymethod.connect_clicked).
+And indeed, `ButtonExt` includes the method [`connect_clicked`](https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/prelude/trait.ButtonExt.html#tymethod.connect_clicked).
Filename: listings/hello_world/3/main.rs