From f6da11e1537d40fcab1630bd96343e1deee35802 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Fri, 13 Dec 2024 21:08:34 +0200 Subject: [PATCH] 1.9 Docs improve reference structure --- docs/astro/astro.config.mjs | 186 +++++++++++------- docs/astro/ec.config.mjs | 2 +- .../backends-and-renderers/backend_winit.md | 1 + .../{translations.md => translations.mdx} | 98 +++++---- .../content/docs/reference/elements/text.mdx | 4 +- .../docs/reference/global-functions/math.mdx | 2 +- .../focusscope.mdx | 0 .../key.mdx => keyboard-input/overview.mdx} | 4 +- .../textinput.mdx | 0 .../docs/reference/layouts/overview.mdx | 5 + .../src/content/docs/reference/overview.mdx | 11 ++ .../docs/reference/primitive-types.mdx | 4 +- .../{ => basic-widgets}/button.mdx | 0 .../{ => basic-widgets}/checkbox.mdx | 0 .../{ => basic-widgets}/combobox.mdx | 0 .../{ => basic-widgets}/progressindicator.mdx | 0 .../{ => basic-widgets}/slider.mdx | 0 .../{ => basic-widgets}/spinbox.mdx | 0 .../{ => basic-widgets}/spinner.mdx | 0 .../{ => basic-widgets}/standardbutton.mdx | 0 .../{ => basic-widgets}/switch.mdx | 0 .../std-widgets/{ => layouts}/gridbox.mdx | 0 .../std-widgets/{ => layouts}/groupbox.mdx | 0 .../{ => layouts}/horizontalbox.mdx | 0 .../std-widgets/{ => layouts}/verticalbox.mdx | 0 .../std-widgets/{ => misc}/aboutslint.mdx | 0 .../std-widgets/{ => misc}/datepicker.mdx | 0 .../std-widgets/{ => misc}/timepicker.mdx | 0 .../std-widgets/{ => views}/lineedit.mdx | 0 .../std-widgets/{ => views}/listview.mdx | 0 .../std-widgets/{ => views}/scrollview.mdx | 0 .../{ => views}/standardlistview.mdx | 0 .../{ => views}/standardtableview.mdx | 0 .../std-widgets/{ => views}/tabwidget.mdx | 0 .../std-widgets/{ => views}/textedit.mdx | 0 .../src/content/docs/tutorial/conclusion.md | 1 + .../src/content/docs/tutorial/quickstart.mdx | 1 + docs/astro/tests/smoke-test.spec.ts | 5 +- internal/core-macros/link-data.json | 24 +-- 39 files changed, 216 insertions(+), 132 deletions(-) rename docs/astro/src/content/docs/guide/development/{translations.md => translations.mdx} (94%) rename docs/astro/src/content/docs/reference/{gestures => keyboard-input}/focusscope.mdx (100%) rename docs/astro/src/content/docs/reference/{gestures/key.mdx => keyboard-input/overview.mdx} (94%) rename docs/astro/src/content/docs/reference/{elements => keyboard-input}/textinput.mdx (100%) create mode 100644 docs/astro/src/content/docs/reference/layouts/overview.mdx create mode 100644 docs/astro/src/content/docs/reference/overview.mdx rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/button.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/checkbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/combobox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/progressindicator.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/slider.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/spinbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/spinner.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/standardbutton.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => basic-widgets}/switch.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => layouts}/gridbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => layouts}/groupbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => layouts}/horizontalbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => layouts}/verticalbox.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => misc}/aboutslint.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => misc}/datepicker.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => misc}/timepicker.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/lineedit.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/listview.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/scrollview.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/standardlistview.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/standardtableview.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/tabwidget.mdx (100%) rename docs/astro/src/content/docs/reference/std-widgets/{ => views}/textedit.mdx (100%) diff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjs index dbf3e4359bb..14fcc568945 100644 --- a/docs/astro/astro.config.mjs +++ b/docs/astro/astro.config.mjs @@ -172,103 +172,150 @@ export default defineConfig({ }, { label: "Reference", - link: "reference/primitive-types", + link: "reference/overview", icon: "information", items: [ { - label: "Primitive Types", - slug: "reference/primitive-types", + label: "Overview", + slug: "reference/overview", }, { - label: "Colors & Brushes", - slug: "reference/colors-and-brushes", - }, - { - label: "Common Properties & Callbacks", - slug: "reference/common", - }, - { - label: "Basic Elements", + label: "Types and Properties", collapsed: true, - autogenerate: { - directory: "reference/elements", - }, - }, - { - label: "Gestures & Keyboard", - collapsed: true, - autogenerate: { - directory: "reference/gestures", - }, - }, - { - label: "Layouts", - collapsed: true, - autogenerate: { - directory: "reference/layouts", - }, - }, - { - label: "Window", - collapsed: true, - autogenerate: { directory: "reference/window" }, + items: [ + { + label: "Primitive Types", + slug: "reference/primitive-types", + }, + { + label: "Common Properties & Callbacks", + slug: "reference/common", + }, + { + label: "Colors & Brushes", + slug: "reference/colors-and-brushes", + }, + ], }, { - label: "Std-Widgets", + label: "Visual Elements", collapsed: true, items: [ - "reference/std-widgets/overview", - "reference/std-widgets/style", { - label: "UI Widgets", + label: "Basic Elements", + autogenerate: { + directory: "reference/elements", + }, + }, + { + label: "Gestures", + autogenerate: { + directory: "reference/gestures", + }, + }, + { + label: "Keyboard Input", items: [ - "reference/std-widgets/aboutslint", - "reference/std-widgets/button", - "reference/std-widgets/checkbox", - "reference/std-widgets/combobox", - "reference/std-widgets/datepicker", - "reference/std-widgets/lineedit", - "reference/std-widgets/listview", - "reference/std-widgets/progressindicator", - "reference/std-widgets/scrollview", - "reference/std-widgets/slider", - "reference/std-widgets/spinbox", - "reference/std-widgets/spinner", - "reference/std-widgets/standardbutton", - "reference/std-widgets/standardlistview", - "reference/std-widgets/standardtableview", - "reference/std-widgets/switch", - "reference/std-widgets/tabwidget", - "reference/std-widgets/textedit", - "reference/std-widgets/timepicker", + { + label: "Overview", + slug: "reference/keyboard-input/overview", + }, + { + label: "HorizontalLayout", + slug: "reference/keyboard-input/focusscope", + }, + { + label: "VerticalLayout", + slug: "reference/keyboard-input/textinput", + }, ], }, { - label: "Layout Widgets", + label: "Layouts", items: [ - "reference/std-widgets/gridbox", - "reference/std-widgets/groupbox", - "reference/std-widgets/horizontalbox", - "reference/std-widgets/verticalbox", + { + label: "Overview", + slug: "reference/layouts/overview", + }, + { + label: "GridLayout", + slug: "reference/layouts/gridlayout", + }, + { + label: "HorizontalLayout", + slug: "reference/layouts/horizontallayout", + }, + { + label: "VerticalLayout", + slug: "reference/layouts/verticallayout", + }, ], }, + { + label: "Window", + autogenerate: { + directory: "reference/window", + }, + }, ], }, { - label: "Global Structs and Enums", - slug: "reference/global-structs-enums", + label: "Globals", + collapsed: true, + items: [ + { + label: "Global Structs and Enums", + slug: "reference/global-structs-enums", + }, + { + label: "Global Functions", + collapsed: true, + items: [ + { + label: "Math", + slug: "reference/global-functions/math", + }, + { + label: "animation-tick() / debug()", + slug: "reference/global-functions/builtinfunctions", + }, + ], + }, + ], }, { - label: "Global Functions", + label: "Std-Widgets", collapsed: true, items: [ + "reference/std-widgets/overview", + "reference/std-widgets/style", + { + label: "Basic Widgets", + autogenerate: { + directory: + "reference/std-widgets/basic-widgets", + }, + }, + { + label: "Views", + autogenerate: { + directory: + "reference/std-widgets/views", + }, + }, { - label: "Math", - slug: "reference/global-functions/math", + label: "Layouts", + autogenerate: { + directory: + "reference/std-widgets/layouts", + }, }, { - label: "animation-tick() / debug()", - slug: "reference/global-functions/builtinfunctions", + label: "Misc", + autogenerate: { + directory: + "reference/std-widgets/misc", + }, }, ], }, @@ -351,7 +398,6 @@ export default defineConfig({ ]), starlightLinksValidator({ errorOnLocalLinks: false, - exclude: ["**/index.mdx"], }), ], social: { diff --git a/docs/astro/ec.config.mjs b/docs/astro/ec.config.mjs index f116723624c..10adbd89123 100644 --- a/docs/astro/ec.config.mjs +++ b/docs/astro/ec.config.mjs @@ -69,7 +69,7 @@ function languageLabel() { inset-inline-end: calc(var(--ec-brdWd) + var(--ec-uiPadInl) ); direction: ltr; font-size: 0.8rem; - color: #767676; + color:rgb(169, 169, 169); opacity: 1; transition: opacity 0.3s; } diff --git a/docs/astro/src/content/docs/guide/backends-and-renderers/backend_winit.md b/docs/astro/src/content/docs/guide/backends-and-renderers/backend_winit.md index febc0b6350e..97b3b803a03 100644 --- a/docs/astro/src/content/docs/guide/backends-and-renderers/backend_winit.md +++ b/docs/astro/src/content/docs/guide/backends-and-renderers/backend_winit.md @@ -2,6 +2,7 @@ title: Winit Backend description: Winit Backend +next: false --- The Winit backend uses the [winit](https://docs.rs/winit/latest/winit/) library to interact with the diff --git a/docs/astro/src/content/docs/guide/development/translations.md b/docs/astro/src/content/docs/guide/development/translations.mdx similarity index 94% rename from docs/astro/src/content/docs/guide/development/translations.md rename to docs/astro/src/content/docs/guide/development/translations.mdx index 0f49737b756..92d179dacd5 100644 --- a/docs/astro/src/content/docs/guide/development/translations.md +++ b/docs/astro/src/content/docs/guide/development/translations.mdx @@ -1,10 +1,11 @@ --- +// cSpell: ignore msgfmt msgctx msginit poedit Lokalize Transifex title: Translations description: Translations --- - +import { Tabs, TabItem, FileTree } from '@astrojs/starlight/components'; Slint's translation infrastructure makes your application available in different languages. @@ -139,9 +140,14 @@ Slint can use the [Gettext](https://www.gnu.org/software/gettext/) library to lo Gettext expects translation files - called message catalogs - in following directory hierarchy: -``` -dir_name/locale/LC_MESSAGES/domain_name.mo -``` + + +- dir_name/ + - locale/ e.g. `fr`, `en`, `de`, etc + - LC_MESSAGES/ + - domain_name.mo + + - `dir_name`: the base directory that you can choose freely. - `locale`: The name of the user's locale for a given target language, such as `fr` for French, or `de` for German. @@ -150,38 +156,13 @@ dir_name/locale/LC_MESSAGES/domain_name.mo - `domain_name`: Selected based on the programming language you're using Slint with. -:::info - +:::tip[Tip] Read the [Gettext documentation](https://www.gnu.org/software/gettext/manual/gettext.html#Locating-Catalogs) for more information. - ::: -### Select and Load Translations with Rust - -First, enable the `gettext` feature of the `slint` crate in the `features` section to gain access to the translations API -and activate run-time translation support. - -Next, use the `slint::init_translations!` macro to specify the base location of your `.mo` files. This is -the `dir_name` in the scheme of the previous section. Slint expects the `.mo` files to be in the -corresponding sub-directories and their file name - `domain_name` - must match the package name -in your `Cargo.toml`. This is often the same as the crate name. - -For example: - -```rust -slint::init_translations!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/")); -``` - -For example, if your `Cargo.toml` contains the following lines and the user's locale is `fr`: - -```toml -[package] -name = "gallery" -``` - -With these settings, Slint looks for `gallery.mo` in the `lang/fr/LC_MESSAGES/gallery.mo`. - -### Select and Load Translations with C++ +### Select and Load Translations + + First, enable the `SLINT_FEATURE_GETTEXT` cmake option when compiling Slint to gain access to the translations API and activate run-time translation support. @@ -220,6 +201,33 @@ int main() For example, if you're using the above and the user's locale is `fr`, Slint looks for `my_application.mo` in the `lang/fr/LC_MESSAGES/` directory. + + + +First, enable the `gettext` feature of the `slint` crate in the `features` section to gain access to the translations API +and activate run-time translation support. + +Next, use the `slint::init_translations!` macro to specify the base location of your `.mo` files. This is +the `dir_name` in the scheme of the previous section. Slint expects the `.mo` files to be in the +corresponding sub-directories and their file name - `domain_name` - must match the package name +in your `Cargo.toml`. This is often the same as the crate name. + +For example: + +```rust +slint::init_translations!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/")); +``` + +For example, if your `Cargo.toml` contains the following lines and the user's locale is `fr`: + +```toml +[package] +name = "gallery" +``` + +With these settings, Slint looks for `gallery.mo` in the `lang/fr/LC_MESSAGES/gallery.mo`. + + ## Bundled Translations @@ -233,7 +241,19 @@ Translation files should be organized in the following hierarchy: path//LC_MESSAGES/.po ``` -### Bundling with Rust +### Bundling + + +Set the `SLINT_BUNDLE_TRANSLATIONS` property in CMake: + +```cmake +set_property(TARGET my_application PROPERTY SLINT_BUNDLE_TRANSLATIONS "${CMAKE_CURRENT_SOURCE_DIR}/lang") +``` + +the `` is the cmake target name. + + + ```rust let config = slint_build::CompilerConfiguration::new() @@ -241,16 +261,10 @@ let config = slint_build::CompilerConfiguration::new() ``` The `` is the crate name. + + -### Bundling with C++ - -Set the `SLINT_BUNDLE_TRANSLATIONS` property in CMake: - -```cmake -set_property(TARGET my_application PROPERTY SLINT_BUNDLE_TRANSLATIONS "${CMAKE_CURRENT_SOURCE_DIR}/lang") -``` -the `` is the cmake target name. ### Selecting a Translation diff --git a/docs/astro/src/content/docs/reference/elements/text.mdx b/docs/astro/src/content/docs/reference/elements/text.mdx index b4ed5d11870..edeffb1f85d 100644 --- a/docs/astro/src/content/docs/reference/elements/text.mdx +++ b/docs/astro/src/content/docs/reference/elements/text.mdx @@ -6,7 +6,7 @@ description: Text element api. import SlintProperty from '/src/components/SlintProperty.astro'; import CodeSnippetMD from '/src/components/CodeSnippetMD.astro'; - +import Link from '/src/components/Link.astro'; ```slint playground @@ -74,7 +74,7 @@ Text { :::note[Note] Make sure the font is loaded before using it in a `Text` element. - See ??????. + See for more. ::: diff --git a/docs/astro/src/content/docs/reference/global-functions/math.mdx b/docs/astro/src/content/docs/reference/global-functions/math.mdx index 00923d42ab5..d641fc3eaeb 100644 --- a/docs/astro/src/content/docs/reference/global-functions/math.mdx +++ b/docs/astro/src/content/docs/reference/global-functions/math.mdx @@ -26,7 +26,7 @@ Some of the math functions can be used in a postfix style which can make the cod x: -10.abs(); // sets x to 10 ``` -#### **T type** +**T type** Many of the math functions can be used with any such as `angle`, `duration`, `float`, `int`, `length`, and `percent`. These are represented on this page as `T`. ## General Math Functions diff --git a/docs/astro/src/content/docs/reference/gestures/focusscope.mdx b/docs/astro/src/content/docs/reference/keyboard-input/focusscope.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/gestures/focusscope.mdx rename to docs/astro/src/content/docs/reference/keyboard-input/focusscope.mdx diff --git a/docs/astro/src/content/docs/reference/gestures/key.mdx b/docs/astro/src/content/docs/reference/keyboard-input/overview.mdx similarity index 94% rename from docs/astro/src/content/docs/reference/gestures/key.mdx rename to docs/astro/src/content/docs/reference/keyboard-input/overview.mdx index 1adf4901064..ce4b3a3d8b4 100644 --- a/docs/astro/src/content/docs/reference/gestures/key.mdx +++ b/docs/astro/src/content/docs/reference/keyboard-input/overview.mdx @@ -1,7 +1,7 @@ --- -title: Key Namespace -description: Key Namespace +title: Key Handling Overview +description: Key Handling Overview --- import Link from '/src/components/Link.astro'; diff --git a/docs/astro/src/content/docs/reference/elements/textinput.mdx b/docs/astro/src/content/docs/reference/keyboard-input/textinput.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/elements/textinput.mdx rename to docs/astro/src/content/docs/reference/keyboard-input/textinput.mdx diff --git a/docs/astro/src/content/docs/reference/layouts/overview.mdx b/docs/astro/src/content/docs/reference/layouts/overview.mdx new file mode 100644 index 00000000000..734d1561687 --- /dev/null +++ b/docs/astro/src/content/docs/reference/layouts/overview.mdx @@ -0,0 +1,5 @@ +--- + +title: Common Properties +description: Layout Common Properties +--- diff --git a/docs/astro/src/content/docs/reference/overview.mdx b/docs/astro/src/content/docs/reference/overview.mdx new file mode 100644 index 00000000000..a1d4c63ed47 --- /dev/null +++ b/docs/astro/src/content/docs/reference/overview.mdx @@ -0,0 +1,11 @@ +--- + +title: Reference Overview +description: Reference Overview +prev: false +--- + +This section contains the API reference for all aspects of the Slint language. All the +elements, properties, functions, callbacks and namespaces. It also contains the API +reference for the `std-widgets` library. A set of cross platform components that can +be used to build desktop applications. diff --git a/docs/astro/src/content/docs/reference/primitive-types.mdx b/docs/astro/src/content/docs/reference/primitive-types.mdx index 693c0a29cb0..b5e84d49a8e 100644 --- a/docs/astro/src/content/docs/reference/primitive-types.mdx +++ b/docs/astro/src/content/docs/reference/primitive-types.mdx @@ -7,7 +7,9 @@ description: All Slint types import SlintProperty from '/src/components/SlintProperty.astro'; import Link from '/src/components/Link.astro'; -All properties in Slint have a type. Slint knows these basic types: +Slint is a statically typed language and offers a rich range of primitive types. + +## Primitive Types ### bool diff --git a/docs/astro/src/content/docs/reference/std-widgets/button.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/button.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/button.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/button.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/checkbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/checkbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/checkbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/checkbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/combobox.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/combobox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/combobox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/combobox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/progressindicator.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/progressindicator.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/progressindicator.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/progressindicator.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/slider.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/slider.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/slider.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/slider.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/spinbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/spinbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/spinbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/spinbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/spinner.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/spinner.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/spinner.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/spinner.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/standardbutton.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/standardbutton.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/standardbutton.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/standardbutton.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/switch.mdx b/docs/astro/src/content/docs/reference/std-widgets/basic-widgets/switch.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/switch.mdx rename to docs/astro/src/content/docs/reference/std-widgets/basic-widgets/switch.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/gridbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/layouts/gridbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/gridbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/layouts/gridbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/groupbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/layouts/groupbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/groupbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/layouts/groupbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/horizontalbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/layouts/horizontalbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/horizontalbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/layouts/horizontalbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/verticalbox.mdx b/docs/astro/src/content/docs/reference/std-widgets/layouts/verticalbox.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/verticalbox.mdx rename to docs/astro/src/content/docs/reference/std-widgets/layouts/verticalbox.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/aboutslint.mdx b/docs/astro/src/content/docs/reference/std-widgets/misc/aboutslint.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/aboutslint.mdx rename to docs/astro/src/content/docs/reference/std-widgets/misc/aboutslint.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/datepicker.mdx b/docs/astro/src/content/docs/reference/std-widgets/misc/datepicker.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/datepicker.mdx rename to docs/astro/src/content/docs/reference/std-widgets/misc/datepicker.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/timepicker.mdx b/docs/astro/src/content/docs/reference/std-widgets/misc/timepicker.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/timepicker.mdx rename to docs/astro/src/content/docs/reference/std-widgets/misc/timepicker.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/lineedit.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/lineedit.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/lineedit.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/lineedit.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/listview.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/listview.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/listview.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/listview.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/scrollview.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/scrollview.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/scrollview.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/scrollview.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/standardlistview.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/standardlistview.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/standardlistview.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/standardlistview.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/standardtableview.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/standardtableview.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/standardtableview.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/standardtableview.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/tabwidget.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/tabwidget.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/tabwidget.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/tabwidget.mdx diff --git a/docs/astro/src/content/docs/reference/std-widgets/textedit.mdx b/docs/astro/src/content/docs/reference/std-widgets/views/textedit.mdx similarity index 100% rename from docs/astro/src/content/docs/reference/std-widgets/textedit.mdx rename to docs/astro/src/content/docs/reference/std-widgets/views/textedit.mdx diff --git a/docs/astro/src/content/docs/tutorial/conclusion.md b/docs/astro/src/content/docs/tutorial/conclusion.md index 59fe2729987..2ce9b6284bc 100644 --- a/docs/astro/src/content/docs/tutorial/conclusion.md +++ b/docs/astro/src/content/docs/tutorial/conclusion.md @@ -2,6 +2,7 @@ title: Conclusion description: Conclusion +next: false --- This tutorial showed you how to combine built-in Slint elements with C++, Rust, or NodeJS code to build a diff --git a/docs/astro/src/content/docs/tutorial/quickstart.mdx b/docs/astro/src/content/docs/tutorial/quickstart.mdx index e0f88554bcf..1cb0975ba13 100644 --- a/docs/astro/src/content/docs/tutorial/quickstart.mdx +++ b/docs/astro/src/content/docs/tutorial/quickstart.mdx @@ -2,6 +2,7 @@ title: Intro description: Intro +prev: false --- This tutorial introduces you to the Slint framework in a playful way by implementing a memory game. It combines the Slint language for the graphics with the game rules implemented in C++, Rust, or NodeJS. diff --git a/docs/astro/tests/smoke-test.spec.ts b/docs/astro/tests/smoke-test.spec.ts index 9308592555e..4270fa1ecdb 100644 --- a/docs/astro/tests/smoke-test.spec.ts +++ b/docs/astro/tests/smoke-test.spec.ts @@ -9,9 +9,10 @@ test("smoke test", async ({ page }) => { .getByLabel("Main") .getByRole("link", { name: "Reference" }) .click(); - await page.locator("summary").filter({ hasText: "Basic Elements" }).click(); - await page.getByRole("link", { name: "Image", exact: true }).click(); + await page.getByText("Visual Elements").click(); + await page.getByRole("link", { name: "Image" }).click(); await page.getByRole("link", { name: "colorize" }).click(); await expect(page.locator("#colorize")).toContainText("colorize"); await page.getByRole("link", { name: "brush", exact: true }).click(); + await expect(page.locator("#brush")).toContainText("brush"); }); diff --git a/internal/core-macros/link-data.json b/internal/core-macros/link-data.json index d3d3935eba1..d05f09315f9 100644 --- a/internal/core-macros/link-data.json +++ b/internal/core-macros/link-data.json @@ -44,13 +44,15 @@ "Expressions": { "href": "/guide/language/coding/expressions-and-statements/" }, - "float": { "href": "/reference/primitive-types#float" }, "FocusHandling": { "href": "/guide/development/focus" }, + "FontHandling": { + "href": "/guide/development/fonts" + }, "GridLayout": { "href": "/reference/layouts/gridlayout" }, @@ -58,7 +60,7 @@ "href": "/reference/global-structs-enums" }, "HorizontalBox": { - "href": "/reference/std-widgets/horizontalbox" + "href": "/reference/std-widgets/layouts/horizontalbox" }, "HorizontalLayout": { "href": "/reference/layouts/horizontallayout" @@ -73,16 +75,16 @@ "href": "/reference/primitive-types#int" }, "KeyEvent": { - "href": "/reference/gestures/key" + "href": "/reference/keyboard-input/overview" }, "length": { "href": "/reference/primitive-types#length" }, "ListView": { - "href": "/reference/std-widgets/listview" + "href": "/reference/std-widgets/views/listview" }, "LineEdit": { - "href": "/reference/std-widgets/lineedit" + "href": "/reference/std-widgets/views/lineedit" }, "LinuxkmsBackend": { "href": "/guide/backends-and-renderers/backend_linuxkms" @@ -109,7 +111,7 @@ "href": "/reference/window/popupwindow" }, "ProgressIndicator": { - "href": "/reference/std-widgets/progressindicator" + "href": "/reference/std-widgets/basic-widgets/progressindicator" }, "Purity": { "href": "/guide/language/concepts/reactivity" @@ -124,10 +126,10 @@ "href": "/guide/language/coding/file" }, "ScrollView": { - "href": "/reference/std-widgets/scrollview" + "href": "/reference/std-widgets/views/scrollview" }, "StandardButton": { - "href": "/reference/std-widgets/standardbutton" + "href": "/reference/std-widgets/basic-widgets/standardbutton" }, "StringType": { "href": "/reference/primitive-types#string" @@ -142,10 +144,10 @@ "href": "/reference/elements/text/" }, "TextEdit": { - "href": "/reference/std-widgets/textedit" + "href": "/reference/std-widgets/views/textedit" }, "TextInput": { - "href": "/reference/elements/textinput/" + "href": "/reference/keyboard-input/textinput/" }, "Timer": { "href": "/reference/elements/timer/" @@ -154,7 +156,7 @@ "href": "/reference/primitive-types" }, "VerticalBox": { - "href": "/reference/std-widgets/verticalbox" + "href": "/reference/std-widgets/layouts/verticalbox" }, "VerticalLayout": { "href": "/reference/layouts/verticallayout"