Skip to content

Commit

Permalink
1.9 Organise docs folder. (#7005)
Browse files Browse the repository at this point in the history
Move astro files to docs/astro
  • Loading branch information
NigelBreslaw authored Dec 5, 2024
1 parent 160c87c commit 92534a8
Show file tree
Hide file tree
Showing 202 changed files with 73 additions and 49 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Allow deprecated warning because we are using nightly and some things might be deprecated in nightly
# for which the stable alternative is not yet available.
RUSTFLAGS: -D warnings -W deprecated
RUSTDOCFLAGS: --html-in-header=/home/runner/work/slint/slint/docs/src/utils/slint-docs-highlight.html -D warnings -W deprecated --cfg docsrs
RUSTDOCFLAGS: --html-in-header=/home/runner/work/slint/slint/docs/astro/src/utils/slint-docs-highlight.html -D warnings -W deprecated --cfg docsrs
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
RELEASE_INPUT: ${{ inputs.release }}
Expand Down Expand Up @@ -88,17 +88,17 @@ jobs:
cp -r target/aarch64-linux-android/doc/i_slint_backend_testing/ target/doc/
- name: "Generate Screenshots for Example Snippets"
run: cargo run -p slint-docsnapper -- docs/src/content --overwrite
run: cargo run -p slint-docsnapper -- docs/astro/src/content --overwrite
- name: "Install Node dependencies"
run: pnpm i --frozen-lockfile

- name: "Run lint checks"
working-directory: docs
working-directory: docs/astro
continue-on-error: true
run: pnpm lint

- name: "Run format checks"
working-directory: docs
working-directory: docs/astro
continue-on-error: true
run: pnpm format
- name: Update URL for sitemap in astro.config.mjs
Expand All @@ -109,14 +109,14 @@ jobs:
- name: "Slint Language Documentation"
run: cargo xtask slintdocs
- name: Spellcheck
working-directory: docs
working-directory: docs/astro
run: pnpm spellcheck
# Test docs
- name: Run Playwright tests
working-directory: docs
working-directory: docs/astro
run: pnpm exec playwright test
- name: Publish Test Summary Results
working-directory: docs
working-directory: docs/astro
run: npx github-actions-ctrf playwright-report/ctrf-report.json

- name: "Node docs"
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
path: |
target/doc
target/cppdocs/html
docs/dist
docs/astro/dist
api/node/docs
docs/site
- name: "Check for docs warnings in internal crates"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ jobs:
RELEASE_INPUT: ${{ github.event.inputs.release }}
run: |
if [ "$RELEASE_INPUT" != "true" ]; then
notes_file=slint-src/docs/src/utils/_templates/nightly-release-notes.md
notes_file=slint-src/docs/nightly-release-notes.md
version=nightly
download_version=$version
else
notes_file=slint-src/docs/src/utils/_templates/release-notes.md
notes_file=slint-src/docs/release-notes.md
version=$(echo artifacts/Slint-cpp-*-win64-MSVC.exe | sed -nre 's/^.*-([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p')
if [[ -z "$version" ]]; then
echo "Version not found"
Expand All @@ -591,7 +591,7 @@ jobs:
download_version=v$version
fi
echo "VERSION=$version" >> $GITHUB_OUTPUT
cat $notes_file slint-src/docs/src/utils/_templates/release-artifacts.md > release-notes.md
cat $notes_file slint-src/docs/release-artifacts.md > release-notes.md
sed -i -e "s,{version},$version,g" release-notes.md
sed -i -e "s,{download_version},$download_version,g" release-notes.md
sed -i -e "s,{major_version},$major_version,g" release-notes.md
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ node_modules
/_deps
.DS_Store
Pipfile.lock
/docs/src/content/collections/enums/
/docs/src/content/collections/structs/
/docs/astro/src/content/collections/enums/
/docs/astro/src/content/collections/structs/
/playwright-report

# Ignore all package-lock.json files
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if(SLINT_BUILD_EXAMPLES)
add_subdirectory(demos)
endif()
if(SLINT_BUILD_TESTING AND (SLINT_FEATURE_COMPILER OR SLINT_COMPILER))
add_subdirectory(docs/src/content/code/)
add_subdirectory(docs/astro/src/content/code/)
endif()

feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ When opening a pull request, you will be asked to sign a

## Internal documentation

- [Development guide](docs/src/utils/_templates//development.md)
- [Building Slint from sources in this repository](docs/src/utils/_templates/building.md)
- [Testing](docs/src/utils/_templates//testing.md)
- [GitHub issues triage and labels](docs/src/utils/_templates/triage.md)
- [Development guide](docs/development.md)
- [Building Slint from sources in this repository](docs/building.md)
- [Testing](docs/testing.md)
- [GitHub issues triage and labels](docs/triage.md)

## Coding Style

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ use the Slint markup language and how to interact with a Slint user interface
from supported programming languages.

The `docs` folder contains a lot more information, including
[build instructions](docs/src/utils/_templates//building.md), and
[internal developer docs](docs/src/utils/_templates//development.md).
[build instructions](docs/building.md), and
[internal developer docs](docs/development.md).

Refer to the README of each language directory in the `api` folder:

Expand Down
17 changes: 9 additions & 8 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ path = [
"**/slint-logo-**.pdf",
"**/slint-logo-**.png",
"**/slint-logo-**.svg",
"docs/src/content/docs/reference/elements/slint-logo.png",
"docs/astro/public/favicon.svg",
"docs/astro/src/content/docs/reference/elements/slint-logo.png",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "Copyright © SixtyFPS GmbH <info@slint.dev>"
Expand Down Expand Up @@ -80,13 +81,13 @@ path = [
"docs/**/book.toml",
"docs/**/package.json",
"docs/public/**.svg",
"docs/src/assets/**.svg",
"docs/src/assets/**.webp",
"docs/src/assets/getting-started/**.webp",
"docs/src/content/docs/reference/elements/mini-banner.png",
"docs/src/misc/**.json",
"docs/src/misc/**.jsonc",
"docs/src/utils/_templates/**.md",
"docs/astro/src/assets/**.svg",
"docs/astro/src/assets/**.webp",
"docs/astro/src/assets/getting-started/**.webp",
"docs/astro/src/content/docs/reference/elements/mini-banner.png",
"docs/astro/src/misc/**.json",
"docs/astro/src/misc/**.jsonc",
"docs/astro/src/utils/_templates/**.md",

"examples/**.json",
"examples/**/LC_MESSAGES/**.mo",
Expand Down
4 changes: 2 additions & 2 deletions api/cpp/docs/_templates/base.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "!base.html" %}
{% block scripts %}
{{ super() }}
{% include "../../../../docs/src/utils/slint-docs-preview.html" %}
{% include "../../../../docs/src/utils/slint-docs-highlight.html" %}
{% include "../../../../docs/astro/src/utils/slint-docs-preview.html" %}
{% include "../../../../docs/astro/src/utils/slint-docs-highlight.html" %}
{% endblock %}
2 changes: 1 addition & 1 deletion api/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You need to install the following components:
* **[pnpm](https://www.pnpm.io/)**
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer)

You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/src/utils/_templates/building.md#prerequisites>
You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>

## Using Slint

Expand Down
2 changes: 1 addition & 1 deletion api/node/cover.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Slint-node comes with pre-built binaries for macOS, Linux, and Windows. If you'd
without pre-built binaries, you need to additional software:

* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer) * Depending on your operating system, you may need additional components. For a list of required system libraries,
see <https://github.com/slint-ui/slint/blob/master/docs/src/utils/_templates/building.md#prerequisites>.
see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>.

## Getting Started (Node.js)

Expand Down
4 changes: 2 additions & 2 deletions api/rs/slint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ i-slint-backend-qt = { workspace = true, features = [ "enable" ], optional = tru
[package.metadata.docs.rs]
rustdoc-args = [
# "--html-in-header",
# "docs/src/utils/slint-docs-preview.html",
# "docs/astro/src/utils/slint-docs-preview.html",
"--html-in-header",
"docs/src/utils/slint-docs-highlight.html",
"docs/astro/src/utils/slint-docs-highlight.html",
]
features = ["document-features", "log", "gettext", "renderer-software", "renderer-femtovg", "raw-window-handle-06"]
2 changes: 1 addition & 1 deletion demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ python3 -m http.server
---
### Running the C++ Examples

* **When compiling Slint from sources:** If you follow the [C++ build instructions](/docs/src/utils/_templates/building.md#c-build), this will build the C++
* **When compiling Slint from sources:** If you follow the [C++ build instructions](/docs/building.md#c-build), this will build the C++
examples as well by default
* **From [installed binary packages](/api/cpp/README.md#binary-packages):** Simply run cmake in one of the example directory containing a CMakeLists.txt

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/README.md → docs/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ not be processed and optimized by Starlight.
The docs use a lot of autogenerated content. First create all the screenshots which will be placed at `src/assets/generated/`.

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

Then generate the slint auto generated content.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/biome.json → docs/astro/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../biome.json"],
"extends": ["../../biome.json"],
"formatter": {
"ignore": ["archive/**", ".astro"]
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/src/utils/_templates/building.md → docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ cargo xtask slintdocs --show-warnings
Run the following command to generate the documentation using rustdoc in the `target/doc/` sub-folder:

```sh
RUSTDOCFLAGS="--html-in-header=$PWD/docs/src/utils/slint-docs-preview.html --html-in-header=$PWD/docs/src/utils/slint-docs-highlight.html" cargo doc --no-deps --features slint/document-features,slint/log
RUSTDOCFLAGS="--html-in-header=$PWD/docs/astro/src/utils/slint-docs-preview.html --html-in-header=$PWD/docs/astro/src/utils/slint-docs-highlight.html" cargo doc --no-deps --features slint/document-features,slint/log
```

Note: `--html-in-header` arguments passed to rustdoc via `RUSTDOCFLAGS` are used to enable syntax highlighting and live-preview for Slint example snippets.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

# Embedded Tutorial template


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

This GitHub release is a nightly snapshot of Slint development. It serves to provide access to pre-release binaries.

The attached binaries are updated once a day by a GitHub action building from the `master` branch.
Expand Down
17 changes: 17 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

# Slint Documentation

```
docs/
├── astro/ # The Astro project that builds the Slint langauge docs
├── README.md # This file
├── building.md # How to build Slint
├── development.md # How to develop Slint
├── embedded-tutorials.md # Embedded tutorials template
├── install_qt.md # How to install Qt
├── nightly-release-notes.md # Release note template
├── release-artifacts.md
├── platform-integrations.md # Platform integrations template
└── release-notes.md # Release note template
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

# Assets

## C++ SDK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

Slint {version} is a patch release that fixes several bugs and crashes. For a complete list of changes, check out the [ChangeLog](https://github.com/slint-ui/slint/blob/master/CHANGELOG.md).

Upgrading to Slint {version}:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ python3 -m http.server
---
### Running the C++ Examples

* **When compiling Slint from sources:** If you follow the [C++ build instructions](/docs/src/utils/_templates/building.md#c-build), this will build the C++
* **When compiling Slint from sources:** If you follow the [C++ build instructions](/docs/building.md#c-build), this will build the C++
examples as well by default
* **From [installed binary packages](/api/cpp/README.md#binary-packages):** Simply run cmake in one of the example directory containing a CMakeLists.txt

Expand Down
4 changes: 2 additions & 2 deletions internal/backends/qt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() {
println!("cargo:rustc-cfg=no_qt");
println!(
"cargo:warning=Could not find a Qt installation. The Qt backend will not be functional. \
See https://github.com/slint-ui/slint/blob/master/docs/src/utils/_templates/install_qt.md for more info"
See https://github.com/slint-ui/slint/blob/master/docs/install_qt.md for more info"
);
println!("cargo:warning= {}", std::env::var("DEP_QT_ERROR_MESSAGE").unwrap());
return;
Expand All @@ -28,7 +28,7 @@ fn main() {
println!("cargo:rustc-cfg=no_qt");
println!(
"cargo:warning=Qt {} is not supported, you need at least Qt 5.15. The Qt backend will not be functional. \
See https://github.com/slint-ui/slint/blob/master/docs/src/utils/_templates/install_qt.md for more info",
See https://github.com/slint-ui/slint/blob/master/docs/install_qt.md for more info",
qt_version
);
return;
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ packages:
- "examples/carousel/node"
- "examples/todo/node"
- "examples/memory"
- "docs/editor"
- "docs"
- "docs/astro"
1 change: 0 additions & 1 deletion xtask/src/license_headers_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ lazy_static! {
("^editors/tree-sitter-slint/corpus/", LicenseLocation::NoLicense), // liberal license
("^api/cpp/docs/_static/", LicenseLocation::NoLicense),
("^api/cpp/docs/_templates/", LicenseLocation::NoLicense),
("^docs/src/utils/_templates/", LicenseLocation::NoLicense),
("^docs/quickstart/theme/", LicenseLocation::NoLicense),
("^editors/tree-sitter-slint/queries/", LicenseLocation::NoLicense), // liberal license

Expand Down
6 changes: 3 additions & 3 deletions xtask/src/slintdocs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn generate() -> Result<(), Box<dyn std::error::Error>> {

let root = super::root_dir();

let docs_source_dir = root.join("docs");
let docs_source_dir = root.join("docs/astro");

{
let sh = Shell::new()?;
Expand All @@ -32,7 +32,7 @@ fn write_individual_enum_files(
root_dir: &Path,
enums: &std::collections::BTreeMap<String, EnumDoc>,
) -> Result<(), Box<dyn std::error::Error>> {
let enums_dir = root_dir.join("docs/src/content/collections/enums");
let enums_dir = root_dir.join("docs/astro/src/content/collections/enums");
create_dir_all(&enums_dir).context(format!(
"Failed to create folder holding individual enum doc files {enums_dir:?}"
))?;
Expand Down Expand Up @@ -224,7 +224,7 @@ fn write_individual_struct_files(
root_dir: &Path,
structs: std::collections::BTreeMap<String, StructDoc>,
) -> Result<(), Box<dyn std::error::Error>> {
let structs_dir = root_dir.join("docs/src/content/collections/structs");
let structs_dir = root_dir.join("docs/astro/src/content/collections/structs");
create_dir_all(&structs_dir).context(format!(
"Failed to create folder holding individual structs doc files {structs_dir:?}"
))?;
Expand Down

0 comments on commit 92534a8

Please sign in to comment.