slint/docs/astro
dependabot[bot] 022c7eb930
build(deps): bump the starlight_astro group across 1 directory with 3 updates (#7654)
* build(deps): bump the starlight_astro group across 1 directory with 3 updates

Bumps the starlight_astro group with 3 updates in the / directory: [@astrojs/starlight](https://github.com/withastro/starlight/tree/HEAD/packages/starlight), [starlight-links-validator](https://github.com/HiDeoo/starlight-links-validator/tree/HEAD/packages/starlight-links-validator) and [starlight-sidebar-topics](https://github.com/HiDeoo/starlight-sidebar-topics/tree/HEAD/packages/starlight-sidebar-topics).


Updates `@astrojs/starlight` from 0.31.1 to 0.32.0
- [Release notes](https://github.com/withastro/starlight/releases)
- [Changelog](https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md)
- [Commits](https://github.com/withastro/starlight/commits/@astrojs/starlight@0.32.0/packages/starlight)

Updates `starlight-links-validator` from 0.14.2 to 0.14.3
- [Release notes](https://github.com/HiDeoo/starlight-links-validator/releases)
- [Changelog](https://github.com/HiDeoo/starlight-links-validator/blob/main/packages/starlight-links-validator/CHANGELOG.md)
- [Commits](https://github.com/HiDeoo/starlight-links-validator/commits/starlight-links-validator@0.14.3/packages/starlight-links-validator)

Updates `starlight-sidebar-topics` from 0.3.0 to 0.4.0
- [Release notes](https://github.com/HiDeoo/starlight-sidebar-topics/releases)
- [Changelog](https://github.com/HiDeoo/starlight-sidebar-topics/blob/main/packages/starlight-sidebar-topics/CHANGELOG.md)
- [Commits](https://github.com/HiDeoo/starlight-sidebar-topics/commits/starlight-sidebar-topics@0.4.0/packages/starlight-sidebar-topics)

---
updated-dependencies:
- dependency-name: "@astrojs/starlight"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: starlight_astro
- dependency-name: starlight-links-validator
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: starlight_astro
- dependency-name: starlight-sidebar-topics
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: starlight_astro
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix deprecation warnings

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nigel Breslaw <nigel.breslaw@slint.dev>
2025-02-18 12:19:43 +02:00
..
public 1.9 Organise docs folder. (#7005) 2024-12-05 15:40:04 +02:00
src build(deps): bump the starlight_astro group across 1 directory with 3 updates (#7654) 2025-02-18 12:19:43 +02:00
tests Docs tests: remove leading slash (#7170) 2024-12-19 14:01:49 +02:00
.gitignore 1.9 Organise docs folder. (#7005) 2024-12-05 15:40:04 +02:00
astro.config.mjs Versionize links to the C++/Rust/Node.js docs 2025-02-03 09:49:09 +01:00
biome.json 1.9 Organise docs folder. (#7005) 2024-12-05 15:40:04 +02:00
ec.config.mjs docs: Fix sideBar div stopping slint text being selected 2025-01-13 10:01:07 +01:00
package.json build(deps): bump the starlight_astro group across 1 directory with 3 updates (#7654) 2025-02-18 12:19:43 +02:00
playwright.config.ts More robust BASE_URL support for docs (#7158) 2024-12-19 10:58:40 +02:00
README.md Janitor: Remove trailing whitespaces from all files 2025-01-10 13:23:22 +01:00
tsconfig.json 1.9 Organise docs folder. (#7005) 2024-12-05 15:40:04 +02:00
writing-style-guide.md Janitor: Remove trailing whitespaces from all files 2025-01-10 13:23:22 +01:00

Slint Documentation

Prerequisites

  • Rust
  • Node.js
  • pnpm

🚀 Project Structure

The documentation site is built with Astro Starlight and reuses it's project structure.

docs/
├── public/
├── src/
│   ├── assets/
│   ├── content/
│   │   ├── docs/
│   │   └── config.ts
│   └── env.d.ts
├── tests/
├── astro.config.mjs
├── package.json
├── tsconfig.json
└──

Starlight looks for .md or .mdx files in the src/content/docs/ directory. Each file is exposed as a route based on its file name.

Images can be added to src/assets/ and embedded in Markdown with a relative link. They will be optimized for download size and also their width and height will be extracted so the framework can render them without ugly content shifts.

Static assets, like favicons, can be placed in the public/ directory. Note that images in this folder will not be processed and optimized by Starlight.

Building the docs

The docs use a lot of autogenerated content. First create all the screenshots which will be placed at src/assets/generated/.

cargo run -p slint-docsnapper -- docs/astro/src/content --overwrite

Then generate the slint auto generated content.

cargo xtask slintdocs

This xtask also installs the npm dependencies and builds the docs. The equivalent of:

pnpm i
pnpm run build

This will build the site and place it in dist/.

Live edit the docs

To run the live hot reloading dev server run in the astro directory:

cd docs/astro/
pnpm start

This will start the dev server at localhost:4321/docs/.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
pnpm i Installs dependencies
pnpm start Starts local dev server at localhost:4321
pnpm build Build your production site to ./dist/
pnpm preview Preview your build locally, before deploying
pnpm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

👀 Want to learn more about Astro and Starlight?

Check out Starlights docs, read the Astro documentation, or jump into the Astro Discord server.