diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index f3a597df33..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Order is important; the last matching pattern takes the most precedence. -* @tauri-apps/wg-doc - -# Disabled until wg-devops has active members -# .github @tauri-apps/wg-devops diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 1127829cd2..0000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,133 +0,0 @@ -# Contributing - -Welcome to Tauri Docs! We're excited to have you 🥳 - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/tauri-apps/tauri-docs/tree/v2) -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/tauri-apps/tauri-docs/tree/v2) - -There are a number of ways to get involved: - -- See if there are any [good first issues](https://github.com/tauri-apps/tauri-docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) that catch your eye -- [Write a guide or recipe](#write-documentation) -- [Translating existing documentation](#translations-i18n) - -Reach out to us on [Discord](https://discord.com/invite/tauri) on the [`#docs` channel](https://discord.com/channels/616186924390023171/662624589037436928) if you have any questions! - -## Getting Started - -1. Clone this repo -2. Run `pnpm i && pnpm dev:setup` -3. Run `pnpm dev` to start the local server - -Note: Dynamically generated pages will result in a 404 error until you run `pnpm build` for the first time. - -### Gitpod - -[Allow Gitpod to open new tabs](https://www.gitpod.io/docs/configure/user-settings/browser-settings) so you immediately when the environment is done loading get a new tab popping up with the documentation. - -## Write Documentation - -We have the following types of documents that roughly follow the types defined by [Diátaxis](https://diataxis.fr/): - -- **[Guide](#guide)**: Learning-oriented -- **[Recipe](#recipe)**: Task-oriented -- **[Reference](#recipe)**: Information-oriented -- **[Blog Post](#blog-post)**: Understanding-oriented - -Use this chart to help you figure out where the right place for your content is: - -| If the content describes… | …and serves the user's… | …then it must belong to… | -| ------------------------- | ----------------------- | ------------------------- | -| practical steps | study | [a guide](#guide) | -| practical steps | work | [a recipe](#recipe) | -| theoretical knowledge | work | [a reference](#reference) | -| theoretical knowledge | study | [a blog post](#blog-post) | - -### Writing Style - -**Dictionary** - -| Word | Description | -| -------- | ------------------------------------ | -| app | A Tauri app, prefer over application | -| web view | Where the UI is rendered | - -- Use an [oxford comma](https://www.grammarly.com/blog/what-is-the-oxford-comma-and-why-do-people-care-so-much-about-it/) in paragraphs, but not in headings and titles -- Use [title case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case) for headings and titles -- Make headings as succinct as possible to help the reader quickly find the content they need -- Use [simple present tense](https://www.grammarly.com/blog/simple-present/) for verbs - -### New Features / Version Display - -When writing about a new feature, display the version it was introduced. -Use the `SinceVersion` component for this, located at [`src/components/SinceVersion.astro`](../src//components/SinceVersion.astro). -Place it directly under the header, which describes the new feature. -When creating a new page add a Badge with the text `New` and variant `tip`. -The lifetime of this badge should not exceed 6 Months. - -#### Example -Example file `my-new-page.mdx` -```mdx ---- -title: My New Page -sidebar: - badge: - text: New - variant: tip ---- -import SinceVersion from '../path/to/SinceVersion.astro'; - - - -Documentation about 'My New Page'... - -``` - -### Guide - -Located in [`/src/content/docs/plugin/`](https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/plugin) - -Guides are learning-oriented and take the reader through a specific journey such as starting a new project, and overview of a specific feature, or how to follow a specific flow such as building and bundling their app. They follow a similar philosophy to [tutorials in Diátaxis](https://diataxis.fr/tutorials). - -The reader should be familiar with the concepts covered by the end of the guide and should set them up with the knowledge required to being experimenting with that topic themselves. - -### Recipe - -Located in [`/src/content/docs/learn/`](https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/learn) - -Recipes are designed to guide the reader through a specific task similar and have a clear outcome and objective. This could be something like setting up authentication using Firebase, adding a Python binary using sidecar, or requesting admin access on a user's machine. They are similar to [how-to guides in Diátaxis](https://diataxis.fr/how-to-guides) (not to be confused with our own guides mentioned above). - -The prerequisites for a recipe should be clearly stated. If there are a lot of steps required before getting into the relevant information about the recipe then you may want to link out to another guide, recipe, or external resource and state those as a prerequisite at the top of the recipe. - -### Reference - -Located in [`/src/content/docs/reference/`](https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/reference), although they should be auto-generated when possible. - -References are where all the nuts and bolts of Tauri's API are documented. These should be generated from upstream repos when possible and written following the best practices described by [references in Diátaxix](https://diataxis.fr/reference). - -These should be as succinct and to the point as possible so that the reader can quickly find the relevant information. - -If you'd like to view the API references locally then you must run `pnpm dev:setup` before `pnpm dev` to initialize all of the submodules. Now the `http://localhost:3000/2/reference/` routes are available to preview. - -### Blog Post - -Located in [`/src/content/docs/blog/`](https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/blog) - -Topics that are around understanding something can be written as a blog post (we welcome submissions to the Tauri blog from anyone). Blog posts are a good option because they help the reader understand that information is accurate at the time of writing (and of course can always be updated later if it becomes stale). Blog posts follow the goals of [explanation in Diátaxis](https://diataxis.fr/explanation), but not all blog posts necessarily fit this specific format. - -### Diagrams - -We use [Astro D2](https://astro-d2.vercel.app/) to generate diagrams. Because Netlify does not support compiling the diagrams in its end we have to push the prebuilt images manually. This is annoying, but not the end of the world seeing as we've previously been pushing the images manually anyway. - -If you make an update to a diagram you'll need to [install D2](https://github.com/terrastruct/d2/blob/master/docs/INSTALL.md) on your system, then when you run either the `build` or `dev` commands you'll need to enable building the diagrams by setting the environment variable `CONTEXT=d2`. - -```sh -# Adapt the command as relevant for your system to define the variable -CONTEXT=d2 pnpm dev -``` - -## Translations (i18n) - -Thanks for your interest in helping to translate the documentation! Visit the [translation status page](https://v2.tauri.app/contribute/translate-status) to see which docs are ready for translation, need updated, or need reviewed. - -Read the [Translating Guide](./TRANSLATING.md) for more information. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index a3128a4691..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2019-2024 Tauri Programme within The Commons Conservancy -# SPDX-License-Identifier: Apache-2.0 -# SPDX-License-Identifier: MIT - -blank_issues_enabled: true -contact_links: - - name: 💬 Discord Chat - url: https://discord.com/invite/tauri - about: Ask questions and talk to other Tauri users and the maintainers diff --git a/.github/ISSUE_TEMPLATE/page_request.yml b/.github/ISSUE_TEMPLATE/page_request.yml deleted file mode 100644 index 92b1b378b4..0000000000 --- a/.github/ISSUE_TEMPLATE/page_request.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2019-2024 Tauri Programme within The Commons Conservancy -# SPDX-License-Identifier: Apache-2.0 -# SPDX-License-Identifier: MIT - -name: 🤔 v2 Page Request -title: '[request] ' -description: Request a new page or updated content -labels: - - enhancement - - discuss - -body: - - type: input - id: question - attributes: - label: Question you want answered - description: The question you were trying to get answered by going to the website and couldn't find. Even if you weren't looking to get a specific question answered try to encapsulate the essence of your issue in the form of a question. - placeholder: "How do I register a new State?" - validations: - required: true - - - type: textarea - id: answer - attributes: - label: Where did you look for an answer? - description: Think back on how you navigate the site in order to find the answer to your question so we get a better idea of how people interact with the site. - placeholder: First I tried searching for the issue, then I went to the sidebar to find a relevant page... - validations: - required: true - - - type: input - id: url - attributes: - label: Page URL - description: If applicable, copy-paste the URL to the page you want updated. - placeholder: "https://v2.tauri.app/some/specific/page" - - - type: textarea - id: context - attributes: - label: Additional context - description: Add any other context about the problem here. - - - type: checkboxes - attributes: - label: Are you willing to work on this yourself? - description: If so don't hesitate to reach out on Discord to us, we're more than happy to help you get set up with contributing! - options: - - label: I want to work on this myself - required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 2c4cdb3ec8..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ - - -#### Description - -- What does this PR change? Give us a brief description. -- Closes # - - diff --git a/.github/TRANSLATING.md b/.github/TRANSLATING.md deleted file mode 100644 index 1fb11de321..0000000000 --- a/.github/TRANSLATING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Translations (i18n) - -Thanks for your interest in helping translate the Tauri docs! Visit the [translation status page](https://v2.tauri.app/contribute/translate-status) to see which docs are ready for translation, need updated, or need reviewed. - -To ensure a translation is consistent across multiple contributions, be sure to [communicate with others contributors in the `#docs` channel on Discord](https://discord.com/invite/tauri) and consult with reliable external resources such as [Microsoft terminology search](https://msit.powerbi.com/view?r=eyJrIjoiODJmYjU4Y2YtM2M0ZC00YzYxLWE1YTktNzFjYmYxNTAxNjQ0IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9) during translation. - -## Enabling a Language - -If you seek to contribute but find your language missing please let us know in https://github.com/tauri-apps/tauri-docs/issues/1611. Once we have enough support for a particular language then we'll be able to enable it with the community's support. - -### Maintainer Checklist for Adding New Languages - -- Update https://github.com/tauri-apps/tauri-docs/blob/v2/locales.json -- Update https://github.com/tauri-apps/tauri-docs/blob/v2/.github/labeler.yml - -## Starting a Translation - -Before you start working on a translation, look through the [open pull requests](https://v2.tauri.app/contribute/translate-status#needs-review) to see if anyone else is already working on the page for that language. - -If that page isn't in the list, then now it's time for you to lead the effort! So here's how to start: - -1. Head to [translation status page](https://v2.tauri.app/contribute/translate-status). -2. Look for missing translation in corresponding languages. -3. Make sure no one else has been working on the corresponding page. -4. Click `Create page +` which will help you automagically fork the repository and create the corresponding page. You might want to copy the contents of English page as a starting point. -5. Translate the page following the [translation guidelines](#translation-guidelines). -6. Once your translation is done, initiate a pull request. - -Note that you may submit a draft pull request before your translation is complete: e.g., you may want to ask for help with translations or simply indicate to others that you're already translating a specific page. However, your pull request will not be merged until the translation is complete. - -## Updating a Translation - -### Corrections - -If you notice spelling or grammar errors, typos, or opportunities for better phrasing, open a pull request with your suggested fix. If you see a problem that you aren't sure of or don't have time to fix, open an issue. - -### Broken Links - -When broken links are found, try to fix them across all translations. Ideally, only update the linked URLs, so that translation review will not be necessary. - -## Translation Guidelines - -Here are some guidelines to help with the translation. - -**Markdown Formatting** - -- [ ] Preserve the Markdown formatting. This includes headers (#, ##, etc.), lists (*, -, 1.), and inline styles like bold, italic, and code. -- [ ] Ensure that links ([link text](URL)) remain functional and direct to the correct locations. -- [ ] Ensure code blocks (triple backticks ```) are unchanged in terms of their syntax and content. -- [ ] Double-check tables, making sure their structure remains intact. Using the Prettier formatter is a great way to do this. - -**Terminology** - -- [ ] Familiarize yourself with key Tauri terms and ensure they're translated consistently. It may be helpful to look at other, already translated pages as a reference. -- [ ] For some terms, it might be appropriate to keep them in English and provide a translation in parentheses. -- [ ] If a term has no definitive way to translate, be sure to [communicate with others contributors in the `#docs` channel on Discord](https://discord.com/invite/tauri) or through pull request and consult with reliable external resources such as [Microsoft terminology search](https://msit.powerbi.com/view?r=eyJrIjoiODJmYjU4Y2YtM2M0ZC00YzYxLWE1YTktNzFjYmYxNTAxNjQ0IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9). - -**Code and Command Examples** - -- [ ] Avoid translating code unless it contains explanatory comments. Translated comments should retain the original meaning. -- [ ] Ensure command-line examples remain functional. Only translate the descriptive parts, not the actual commands. - -**Link Descriptions** - -- [ ] If link descriptions (text that appears when you hover over a link) are present, make sure to translate them, but ensure they still describe the link's destination correctly. - -**Consistency** - -- [ ] Ensure that the terminology and style are consistent throughout the document. -- [ ] If the document refers to other sections within itself, double-check that these references are accurate post-translation. - -**Cultural Considerations** - -- [ ] Ensure that examples, metaphors, or idioms are culturally relevant or adapt them so that they are. -- [ ] Avoid terms or examples that might be considered offensive or inappropriate in the target language or culture. - -**Images and Alt Text** - -- [ ] If the document contains images with text, consider whether the text in the image needs to be translated. -- [ ] Translate the alt text (a description of the image for accessibility purposes) for each image. - -**Feedback** - -- [ ] If there are parts of the original document that are unclear or might be misunderstood, communicate with the original author or a knowledgeable person to seek clarity. - -Remember, the main goal of the translation is to make the content as accessible and clear to the new audience as it was to the original audience. Always prioritize clarity and accuracy. - -Thank you for your interest in contributing; we're excited to have you! Reach out on the [`#docs` channel on Discord](https://discord.com/invite/tauri) if you have any questions along the way. diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index fcaec757b4..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,19 +0,0 @@ -# See https://github.com/actions/labeler - -i18n: - - src/content/docs/es/**/* - - src/content/docs/fr/**/* - - src/content/docs/it/**/* - - src/content/docs/zh-cn/**/* - -"i18n: es": - - src/content/docs/es/**/* - -"i18n: fr": - - src/content/docs/fr/**/* - -"i18n: it": - - src/content/docs/it/**/* - -"i18n: zh-cn": - - src/content/docs/zh-cn/**/* diff --git a/.github/sponsors/crabnebula.svg b/.github/sponsors/crabnebula.svg deleted file mode 100644 index 94af70f6ef..0000000000 --- a/.github/sponsors/crabnebula.svg +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml deleted file mode 100644 index c4811e6d88..0000000000 --- a/.github/workflows/assign.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: 'Auto Assign' - -on: - pull_request_target: - types: [opened] - -jobs: - auto_assign: - runs-on: ubuntu-latest - steps: - - name: Auto-assign PR to author - if: ${{ github.event.pull_request.user.type != 'Bot' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # The gh cli currently does not consider the pr author an assignable user if they aren't part of the org - run: gh api -X POST /repos/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number }}/assignees -f "assignees[]=${{ github.event.pull_request.user.login }}" - #run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.event.pull_request.user.login }} -R ${{ github.repository }} - - - name: Auto-assign Renovate PRs - if: ${{ github.event.pull_request.user.type == 'Bot' && github.event.pull_request.user.login == 'renovate[bot]' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # The gh cli currently does not consider the pr author an assignable user if they aren't part of the org - run: gh api -X POST /repos/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number }}/assignees -f "assignees[]=vasfvitor" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index c720392298..0000000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Adapted from https://github.com/withastro/starlight/blob/main/.github/workflows/format.yml - -name: 'Check formatting' - -on: - pull_request: - -jobs: - format: - runs-on: ubuntu-latest - steps: - - name: Check out code using Git - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: 'pnpm' - - - run: pnpm i - - - name: Check formatting - run: pnpm format:check diff --git a/.github/workflows/congrats.yml b/.github/workflows/congrats.yml deleted file mode 100644 index 1c24dad45e..0000000000 --- a/.github/workflows/congrats.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Congrats' - -on: - push: - branches: [v2] - -jobs: - congrats: - uses: tauri-apps/automation/.github/workflows/congrats.yml@main - secrets: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 15b12e3ab8..0000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Pull Request Labeler' - -on: - pull_request_target: - -jobs: - add_labels: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - env: - NETLIFY_BUILD_KEY: ${{ secrets.NETLIFY_BUILD_KEY }} - steps: - - id: label-pr - uses: actions/labeler@v4 - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' - # Trigger prod netlify re-build to refresh i18n dashboard - - name: Rebuild i18n Dashboard - if: contains(steps.label-pr.outputs.all-labels, 'i18n') - run: curl -X POST -d {} https://api.netlify.com/build_hooks/$NETLIFY_BUILD_KEY diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml deleted file mode 100644 index 5cc76f5368..0000000000 --- a/.github/workflows/priority.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: 'Priority Updater' - -on: - issues: - types: [opened] - pull_request_target: - types: [opened] - -jobs: - set_statuses: - runs-on: ubuntu-latest - if: ${{ !contains(github.event.issue.labels.*.name, 'manual') && !contains(github.event.pull_request.labels.*.name, 'manual') }} - steps: - - name: Get project data - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: | - echo "PROJECT_ID=$(gh project view 27 --owner tauri-apps --format json --jq '.id')" >> $GITHUB_ENV - gh project field-list 27 --owner tauri-apps --format json > project_data.json - echo 'PRIORITY_FIELD_ID='$(jq '.fields[] | select(.name== "Priority") | .id' project_data.json) >> $GITHUB_ENV - echo 'LOW_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Low") | .id' project_data.json) >> $GITHUB_ENV - echo 'MEDIUM_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Medium") | .id' project_data.json) >> $GITHUB_ENV - echo 'HIGH_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="High") | .id' project_data.json) >> $GITHUB_ENV - echo 'CRITICAL_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Critical") | .id' project_data.json) >> $GITHUB_ENV - - - name: Default priority - run: | - echo 'PRIORITY_ID='${{ env.LOW_PRIORITY_ID }} >> $GITHUB_ENV - - - name: Add project item / Get item id - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: | - echo "ITEM_ID=$(gh project item-add 27 --owner tauri-apps --url https://github.com/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number || github.event.issue.number }} --format json --jq '.id')" >> $GITHUB_ENV - - - name: Set fields - if: ${{ github.event.issue.status == 'open' || github.event.pull_request.status == 'open' }} - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: | - gh project item-edit --id ${{ env.ITEM_ID }} --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.PRIORITY_FIELD_ID }} --single-select-option-id ${{ env.PRIORITY_ID }} diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml deleted file mode 100644 index c84146a12b..0000000000 --- a/.github/workflows/status.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: 'Status Updater' - -on: - issues: - pull_request_target: - -jobs: - set_statuses: - runs-on: ubuntu-latest - if: ${{ !contains(github.event.issue.labels.*.name, 'manual') && !contains(github.event.pull_request.labels.*.name, 'manual') }} - steps: - - name: Get project data - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: | - echo "PROJECT_ID=$(gh project view 27 --owner tauri-apps --format json --jq '.id')" >> $GITHUB_ENV - gh project field-list 27 --owner tauri-apps --format json > project_data.json - echo 'STATUS_FIELD_ID='$(jq '.fields[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'BACKLOG_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="🪵 Backlog") | .id' project_data.json) >> $GITHUB_ENV - echo 'READY_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="💪 Ready") | .id' project_data.json) >> $GITHUB_ENV - echo 'IN_PROGRESS_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="🏗️ In progress") | .id' project_data.json) >> $GITHUB_ENV - echo 'IN_REVIEW_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="📋 In review") | .id' project_data.json) >> $GITHUB_ENV - echo 'DONE_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="✅ Done") | .id' project_data.json) >> $GITHUB_ENV - - - name: Add project item / Get item id - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: echo "ITEM_ID=$(gh project item-add 27 --owner tauri-apps --url https://github.com/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number || github.event.issue.number }} --format json --jq '.id')" >> $GITHUB_ENV - - #===== PULL REQUESTS =====# - - name: Is In progress - if: ${{ github.event_name == 'pull_request_target' && (github.event.pull_request.draft == true || github.event.pull_request.mergeable == false) }} - run: echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV - - - name: Is In review - if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.draft == false && github.event.pull_request.mergeable == true }} - run: echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV - #===== END PULL REQUESTS =====# - - #===== ISSUES =====# - - name: Is Ready - if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.milestone != null) }} - run: echo 'STATUS_ID='${{ env.READY_STATUS_ID }} >> $GITHUB_ENV - - - name: Is In progress - if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.milestone != null && github.event.issue.assignees[0] != null) }} - run: echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV - - - name: Is In review - if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.pull_request.merged_at != null) }} - run: echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV - - - name: Is Backlog - if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] == null || github.event.issue.milestone == null || contains(github.event.issue.labels.*.name, 'upstream') || contains(github.event.issue.labels.*.name, 'discuss')) }} - run: echo 'STATUS_ID='${{ env.BACKLOG_STATUS_ID }} >> $GITHUB_ENV - #===== END ISSUES =====# - - - name: Set fields - if: ${{ github.event.issue.status == 'open' || github.event.pull_request.status == 'open' }} - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: gh project item-edit --id ${{ env.ITEM_ID }} --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.STATUS_FIELD_ID }} --single-select-option-id ${{ env.STATUS_ID }} diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bcfed603f7..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,12 +0,0 @@ -[submodule "packages/plugins-workspace"] - path = packages/plugins-workspace - url = https://github.com/tauri-apps/plugins-workspace.git - branch = v2 -[submodule "packages/awesome-tauri"] - path = packages/awesome-tauri - url = https://github.com/tauri-apps/awesome-tauri - branch = dev -[submodule "packages/tauri"] - path = packages/tauri - url = https://github.com/tauri-apps/tauri.git - branch = dev diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d45484de76..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,29 +0,0 @@ -{ - "printWidth": 100, - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5", - "useTabs": false, - "plugins": ["prettier-plugin-astro"], - "overrides": [ - { - "files": "*.astro", - "options": { - "parser": "astro" - } - }, - { - "files": ["*.json", "*.md", "*.toml", "*.yml"], - "options": { - "useTabs": false - } - }, - { - "files": ["*.md", "*.mdx"], - "options": { - "printWidth": 80 - } - } - ] -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 22a15055d6..0000000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d642209762..0000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e66e920719..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "files.encoding": "utf8", - "prettier.documentSelectors": ["**/*.astro"], - "[astro]": { - "editor.defaultFormatter": "astro-build.astro-vscode" - } -} diff --git a/LICENSE b/LICENSE index cac2185963..77895cc6fd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,136 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of authorship +and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific works +("Commons") that the public can reliably and without fear of later claims of +infringement build upon, modify, incorporate in other works, reuse and +redistribute as freely as possible in any form whatsoever and for any purposes, +including without limitation commercial purposes. These owners may contribute to +the Commons to promote the ideal of a free culture and the further production of +creative, cultural and scientific works, or to gain reputation or greater +distribution for their Work in part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any expectation of +additional consideration or compensation, the person associating CC0 with a Work +(the "Affirmer"), to the extent that he or she is an owner of Copyright and +Related Rights in the Work, voluntarily elects to apply CC0 to the Work and +publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be + protected by copyright and related or neighboring rights ("Copyright and + Related Rights"). Copyright and Related Rights include, but are not limited + to, the following: + +i. the right to reproduce, adapt, distribute, perform, display, communicate, and +translate a Work; ii. moral rights retained by the original author(s) and/or +performer(s); iii. publicity and privacy rights pertaining to a person's image +or likeness depicted in a Work; iv. rights protecting against unfair competition +in regards to a Work, subject to the limitations in paragraph 4(a), below; v. +rights protecting the extraction, dissemination, use and reuse of data in a +Work; vi. database rights (such as those arising under Directive 96/9/EC of the +European Parliament and of the Council of 11 March 1996 on the legal protection +of databases, and under any national implementation thereof, including any +amended or successor version of such directive); and vii. other similar, +equivalent or corresponding rights throughout the world based on applicable law +or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, + applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and + unconditionally waives, abandons, and surrenders all of Affirmer's Copyright + and Related Rights and associated claims and causes of action, whether now + known or unknown (including existing as well as future claims and causes of + action), in the Work (i) in all territories worldwide, (ii) for the maximum + duration provided by applicable law or treaty (including future time + extensions), (iii) in any current or future medium and for any number of + copies, and (iv) for any purpose whatsoever, including without limitation + commercial, advertising or promotional purposes (the "Waiver"). Affirmer + makes the Waiver for the benefit of each member of the public at large and to + the detriment of Affirmer's heirs and successors, fully intending that such + Waiver shall not be subject to revocation, rescission, cancellation, + termination, or any other legal or equitable action to disrupt the quiet + enjoyment of the Work by the public as contemplated by Affirmer's express . + +3. Public License Fallback. Should any part of the Waiver for any reason be + judged legally invalid or ineffective under applicable law, then the Waiver + shall be preserved to the maximum extent permitted taking into account + Affirmer's express . In addition, to the extent the Waiver is so judged + Affirmer hereby grants to each affected person a royalty-free, non + transferable, non sublicensable, non exclusive, irrevocable and unconditional + license to exercise Affirmer's Copyright and Related Rights in the Work (i) + in all territories worldwide, (ii) for the maximum duration provided by + applicable law or treaty (including future time extensions), (iii) in any + current or future medium and for any number of copies, and (iv) for any + purpose whatsoever, including without limitation commercial, advertising or + promotional purposes (the "License"). The License shall be deemed effective + as of the date CC0 was applied by Affirmer to the Work. Should any part of + the License for any reason be judged legally invalid or ineffective under + applicable law, such partial invalidity or ineffectiveness shall not + invalidate the remainder of the License, and in such case Affirmer hereby + affirms that he or she will not (i) exercise any of his or her remaining + Copyright and Related Rights in the Work or (ii) assert any associated claims + and causes of action with respect to the Work, in either case contrary to + +4. Limitations and Disclaimers. + +a. No trademark or patent rights held by Affirmer are waived, abandoned, +surrendered, licensed or otherwise affected by this document. b. Affirmer offers +the Work as-is and makes no representations or warranties of any kind concerning +the Work, express, implied, statutory or otherwise, including without limitation +warranties of title, merchantability, fitness for a particular purpose, non +infringement, or the absence of latent or other defects, accuracy, or the +present or absence of errors, whether or not discoverable, all to the greatest +extent permissible under applicable law. c. Affirmer disclaims responsibility +for clearing rights of other persons that may apply to the Work or any use +thereof, including without limitation any person's Copyright and Related Rights +in the Work. Further, Affirmer disclaims responsibility for obtaining any +necessary consents, permissions or other rights required for any use of the +Work. d. Affirmer understands and acknowledges that Creative Commons is not a +party to this document and has no duty or obligation with respect to this CC0 or +use of the Work. + +--- + +Note: The above license applies only to the modifications made by PlayForm to +the original work. The original work is licensed under the following licenses +and is subject to their terms and conditions: + MIT License Copyright (c) 2020-2023 Tauri Programme within the Commons Conservancy -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 7053d67ad6..0000000000 --- a/README.md +++ /dev/null @@ -1,40 +0,0 @@ -![README Banner](https://github.com/tauri-apps/tauri-docs/assets/61861940/ab6fd2f5-07b7-46b2-9125-77cba0064c1b) - -[![Netlify Status](https://api.netlify.com/api/v1/badges/6dc81a5e-32ac-46f4-80c5-198f4a536e26/deploy-status)](https://app.netlify.com/sites/tauri-docs-starlight/deploys) - -Welcome to the home for Tauri 2.0 documentation - we're excited to have you! ✨ - -This repo is used to build the docs for Tauri at https://tauri.app. - -If you are looking for the old v1 docs, see [here](https://github.com/tauri-apps/tauri-docs/tree/v1). - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/tauri-apps/tauri-docs/tree/v2) -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/tauri-apps/tauri-docs/tree/v2) - -## Get Involved - -- [Join us on Discord](https://discord.com/invite/tauri) in the [`#docs` channel](https://discord.com/channels/616186924390023171/662624589037436928) to ask any questions or give feedback -- Check out the [Tauri 2.0 Documentation Roadmap](https://github.com/tauri-apps/tauri-docs/issues/1344) and see if there's anything you'd like to get involved in -- Read the [contributing guidelines](.github/CONTRIBUTING.md) to learn how to get up and running - -## Partners - - - - - - - -
- - CrabNebula - -
- -For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri). - -## License - -MIT License - -Copyright (c) 2020-2023 Tauri Programme within The Commons Conservancy diff --git a/src/assets/about/governance/diagram.svg b/Source/assets/about/governance/diagram.svg similarity index 100% rename from src/assets/about/governance/diagram.svg rename to Source/assets/about/governance/diagram.svg diff --git a/src/assets/blog/crabnebula.svg b/Source/assets/blog/crabnebula.svg similarity index 99% rename from src/assets/blog/crabnebula.svg rename to Source/assets/blog/crabnebula.svg index a9bb4609d3..40e24131b5 100644 --- a/src/assets/blog/crabnebula.svg +++ b/Source/assets/blog/crabnebula.svg @@ -1,31 +1,31 @@ -

This is a stub and is waiting for contributions. Get involved by - visiting us on GitHub or visiting us on GitHub or joining us on Discord.

diff --git a/src/components/UpgradeBadge.astro b/Source/components/UpgradeBadge.astro similarity index 100% rename from src/components/UpgradeBadge.astro rename to Source/components/UpgradeBadge.astro diff --git a/src/components/list/Community.astro b/Source/components/list/Community.astro similarity index 83% rename from src/components/list/Community.astro rename to Source/components/list/Community.astro index 904a932979..c20ec4abe4 100644 --- a/src/components/list/Community.astro +++ b/Source/components/list/Community.astro @@ -10,12 +10,12 @@ const list: Entry[] = [ { name: 'Have something to share?', description: 'Open a pull request to show us your amazing resource', - href: 'https://github.com/tauri-apps/tauri-docs/pulls', + href: 'HTTPS://github.com/tauri-apps/tauri-docs/pulls', }, { name: 'Github OAuth with Lucia', description: 'Authenticate users with a simple JS server', - href: 'https://lucia-auth.com/guidebook/github-oauth-native/tauri', + href: 'HTTPS://lucia-auth.com/guidebook/github-oauth-native/tauri', }, ]; --- diff --git a/src/components/list/Directory.astro b/Source/components/list/Directory.astro similarity index 100% rename from src/components/list/Directory.astro rename to Source/components/list/Directory.astro diff --git a/src/components/list/Features.astro b/Source/components/list/Features.astro similarity index 100% rename from src/components/list/Features.astro rename to Source/components/list/Features.astro diff --git a/src/components/list/JavaScript.astro b/Source/components/list/JavaScript.astro similarity index 100% rename from src/components/list/JavaScript.astro rename to Source/components/list/JavaScript.astro diff --git a/src/components/overrides/Footer.astro b/Source/components/overrides/Footer.astro similarity index 100% rename from src/components/overrides/Footer.astro rename to Source/components/overrides/Footer.astro diff --git a/src/components/overrides/Header.astro b/Source/components/overrides/Header.astro similarity index 98% rename from src/components/overrides/Header.astro rename to Source/components/overrides/Header.astro index 4718a7473b..182330bb24 100644 --- a/src/components/overrides/Header.astro +++ b/Source/components/overrides/Header.astro @@ -181,7 +181,7 @@ Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ? text-decoration: none; } - /* From https://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro */ + /* From HTTPS://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro */ label { --sl-label-icon-size: 0.875rem; --sl-caret-size: 1.25rem; diff --git a/src/components/overrides/PageFrame.astro b/Source/components/overrides/PageFrame.astro similarity index 100% rename from src/components/overrides/PageFrame.astro rename to Source/components/overrides/PageFrame.astro diff --git a/src/components/overrides/SiteTitle.astro b/Source/components/overrides/SiteTitle.astro similarity index 94% rename from src/components/overrides/SiteTitle.astro rename to Source/components/overrides/SiteTitle.astro index 7d5e3ccd52..2c1377c49d 100644 --- a/src/components/overrides/SiteTitle.astro +++ b/Source/components/overrides/SiteTitle.astro @@ -1,7 +1,7 @@ --- // This is heavily adapted from Starlight components: -// https://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro -// https://github.com/withastro/starlight/blob/main/packages/starlight/components/LanguageSelect.astro +// HTTPS://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro +// HTTPS://github.com/withastro/starlight/blob/main/packages/starlight/components/LanguageSelect.astro import type { Props } from '@astrojs/starlight/props'; import Default from '@astrojs/starlight/components/SiteTitle.astro'; @@ -99,7 +99,7 @@ const links: Link[] = [ text-decoration: none; } - /* From https://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro */ + /* From HTTPS://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro */ label { --sl-label-icon-size: 0.875rem; --sl-caret-size: 1.25rem; diff --git a/src/components/overrides/TableOfContents.astro b/Source/components/overrides/TableOfContents.astro similarity index 100% rename from src/components/overrides/TableOfContents.astro rename to Source/components/overrides/TableOfContents.astro diff --git a/src/components/overrides/TableOfContents/TableOfContentsList.astro b/Source/components/overrides/TableOfContents/TableOfContentsList.astro similarity index 95% rename from src/components/overrides/TableOfContents/TableOfContentsList.astro rename to Source/components/overrides/TableOfContents/TableOfContentsList.astro index 655b4b753a..fe13c11b01 100644 --- a/src/components/overrides/TableOfContents/TableOfContentsList.astro +++ b/Source/components/overrides/TableOfContents/TableOfContentsList.astro @@ -83,7 +83,7 @@ const { toc, isMobile = false, depth = 0, collapseLevel = 1 } = Astro.props; height: 16px; transition: 0.2s; /* Chevron SVG icon (Black) */ - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23000000'%3E%3Cpath d='m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg xmlns='HTTP://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23000000'%3E%3Cpath d='m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center right; background-size: 16px 16px; @@ -97,7 +97,7 @@ const { toc, isMobile = false, depth = 0, collapseLevel = 1 } = Astro.props; :root[data-theme='dark'] { details > summary::after { /* Chevron SVG icon (White) */ - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg xmlns='HTTP://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z'/%3E%3C/svg%3E"); } } diff --git a/Source/components/overrides/TableOfContents/starlight-toc.ts b/Source/components/overrides/TableOfContents/starlight-toc.ts new file mode 100644 index 0000000000..62b236e468 --- /dev/null +++ b/Source/components/overrides/TableOfContents/starlight-toc.ts @@ -0,0 +1,151 @@ +import { PAGE_TITLE_ID } from "node_modules/@astrojs/starlight/constants"; + +export class StarlightTOC extends HTMLElement { + private _current = this.querySelector( + 'a[aria-current="true"]', + ); + + private minH = parseInt(this.dataset.minH || "2", 10); + + private maxH = parseInt(this.dataset.maxH || "3", 10); + + protected set current(link: HTMLAnchorElement) { + if (link === this._current) return; + + if (this._current) this._current.removeAttribute("aria-current"); + + link.setAttribute("aria-current", "true"); + + this._current = link; + } + + private onIdle = (cb: IdleRequestCallback) => + (window.requestIdleCallback || ((cb) => setTimeout(cb, 1)))(cb); + + constructor() { + super(); + + this.onIdle(() => this.init()); + } + + private init = (): void => { + /** All the links in the table of contents. */ + const links = [...this.querySelectorAll("a")]; + + /** Test if an element is a table-of-contents heading. */ + const isHeading = (el: Element): el is HTMLHeadingElement => { + if (el instanceof HTMLHeadingElement) { + // Special case for page title h1 + if (el.id === PAGE_TITLE_ID) return true; + // Check the heading level is within the user-configured limits for the ToC + const level = el.tagName[1]; + + if (level) { + const int = parseInt(level, 10); + + if (int >= this.minH && int <= this.maxH) return true; + } + } + + return false; + }; + + /** Walk up the DOM to find the nearest heading. */ + const getElementHeading = ( + el: Element | null, + ): HTMLHeadingElement | null => { + if (!el) return null; + + const origin = el; + + while (el) { + if (isHeading(el)) return el; + // Assign the previous sibling’s last, most deeply nested child to el. + el = el.previousElementSibling; + + while (el?.lastElementChild) { + el = el.lastElementChild; + } + // Look for headings amongst siblings. + const h = getElementHeading(el); + + if (h) return h; + } + // Walk back up the parent. + return getElementHeading(origin.parentElement); + }; + + /** Handle intersections and set the current link to the heading for the current intersection. */ + const setCurrent: IntersectionObserverCallback = (entries) => { + for (const { isIntersecting, target } of entries) { + if (!isIntersecting) continue; + + const heading = getElementHeading(target); + + if (!heading) continue; + + const link = links.find( + (link) => + link.hash === "#" + encodeURIComponent(heading.id), + ); + + if (link) { + this.current = link; + + break; + } + } + }; + + // Observe elements with an `id` (most likely headings) and their siblings. + // Also observe direct children of `.content` to include elements before + // the first heading. + const toObserve = document.querySelectorAll( + "main [id], main [id] ~ *, main .content > *", + ); + + let observer: IntersectionObserver | undefined; + + const observe = () => { + if (observer) return; + + observer = new IntersectionObserver(setCurrent, { + rootMargin: this.getRootMargin(), + }); + + toObserve.forEach((h) => observer!.observe(h)); + }; + + observe(); + + let timeout: NodeJS.Timeout; + + window.addEventListener("resize", () => { + // Disable intersection observer while window is resizing. + if (observer) observer.disconnect(); + + clearTimeout(timeout); + + timeout = setTimeout(() => this.onIdle(observe), 200); + }); + }; + + private getRootMargin(): `-${number}px 0% ${number}px` { + const navBarHeight = + document.querySelector("header")?.getBoundingClientRect().height || + 0; + // `` only exists in mobile ToC, so will fall back to 0 in large viewport component. + const mobileTocHeight = + this.querySelector("summary")?.getBoundingClientRect().height || 0; + /** Start intersections at nav height + 2rem padding. */ + const top = navBarHeight + mobileTocHeight + 32; + /** End intersections `53px` later. This is slightly more than the maximum `margin-top` in Markdown content. */ + const bottom = top + 53; + + const height = document.documentElement.clientHeight; + + return `-${top}px 0% ${bottom - height}px`; + } +} + +customElements.define("tauri-starlight-toc", StarlightTOC); diff --git a/src/components/overrides/ThemeSelect.astro b/Source/components/overrides/ThemeSelect.astro similarity index 100% rename from src/components/overrides/ThemeSelect.astro rename to Source/components/overrides/ThemeSelect.astro diff --git a/src/components/plugins/.gitignore b/Source/components/plugins/.gitignore similarity index 100% rename from src/components/plugins/.gitignore rename to Source/components/plugins/.gitignore diff --git a/src/components/plugins/Compatibility.astro b/Source/components/plugins/Compatibility.astro similarity index 100% rename from src/components/plugins/Compatibility.astro rename to Source/components/plugins/Compatibility.astro diff --git a/src/components/plugins/CustomLinkCard.astro b/Source/components/plugins/CustomLinkCard.astro similarity index 96% rename from src/components/plugins/CustomLinkCard.astro rename to Source/components/plugins/CustomLinkCard.astro index 4eee9abae6..b61e9a61cf 100644 --- a/src/components/plugins/CustomLinkCard.astro +++ b/Source/components/plugins/CustomLinkCard.astro @@ -52,7 +52,7 @@ const { title, description, footer, ...attributes } = Astro.props; line-height: var(--sl-line-height-headings); } - /* a11y fix for https://github.com/withastro/starlight/issues/487 */ + /* a11y fix for HTTPS://github.com/withastro/starlight/issues/487 */ a::before { content: ''; position: absolute; diff --git a/src/components/plugins/TableCompatibility.astro b/Source/components/plugins/TableCompatibility.astro similarity index 100% rename from src/components/plugins/TableCompatibility.astro rename to Source/components/plugins/TableCompatibility.astro diff --git a/src/components/plugins/_helpers.ts b/Source/components/plugins/_helpers.ts similarity index 50% rename from src/components/plugins/_helpers.ts rename to Source/components/plugins/_helpers.ts index 0840373224..f059a51a1f 100644 --- a/src/components/plugins/_helpers.ts +++ b/Source/components/plugins/_helpers.ts @@ -1,74 +1,83 @@ export interface PluginSupport { - platform: string; - level: string; - // possible markdown - notes?: string; + platform: string; + + level: string; + // possible markdown + notes?: string; } export interface PluginData { - rustVersion: string; - support: PluginSupport[]; + rustVersion: string; + + support: PluginSupport[]; } -type Platform = 'windows' | 'linux' | 'ios' | 'macos' | 'android'; +type Platform = "windows" | "linux" | "ios" | "macos" | "android"; // ids from /public/assets/platforms.svg sprite type IconId = - | 'material-symbols-android' - | 'simple-icons-ios' - | 'simple-icons-macos' - | 'cib-linux' - | 'bi-windows'; + | "material-symbols-android" + | "simple-icons-ios" + | "simple-icons-macos" + | "cib-linux" + | "bi-windows"; export function getSupportText(supportLevel: string) { - switch (supportLevel) { - case 'full': - return 'Full support'; - case 'partial': - return 'Partial support'; - case 'none': - return 'No support'; - default: - return `Support: ${supportLevel}`; - } + switch (supportLevel) { + case "full": + return "Full support"; + + case "partial": + return "Partial support"; + + case "none": + return "No support"; + + default: + return `Support: ${supportLevel}`; + } } export function getSupportIcon(supportLevel: string) { - const supportLabel = getSupportText(supportLevel); - switch (supportLevel) { - case 'full': - return ``; - case 'partial': - return ` `; - case 'none': - return ` `; - default: - return ` + + default: + return ` `; - } + } } // depends on /assets/platforms.svg function renderPlatformIcon(iconId: IconId) { - return ` + return `
@@ -77,20 +86,23 @@ function renderPlatformIcon(iconId: IconId) { `; } -export function getPlatformSupportIcon(supportLevel: string, platform: Platform): string { - const iconMap: Record = { - windows: 'bi-windows', - linux: 'cib-linux', - ios: 'simple-icons-ios', - macos: 'simple-icons-macos', - android: 'material-symbols-android', - }; +export function getPlatformSupportIcon( + supportLevel: string, + platform: Platform, +): string { + const iconMap: Record = { + windows: "bi-windows", + linux: "cib-linux", + ios: "simple-icons-ios", + macos: "simple-icons-macos", + android: "material-symbols-android", + }; - const iconId = iconMap[platform]; + const iconId = iconMap[platform]; - if (supportLevel !== 'full' && supportLevel !== 'partial') { - return ''; - } + if (supportLevel !== "full" && supportLevel !== "partial") { + return ""; + } - return renderPlatformIcon(iconId); + return renderPlatformIcon(iconId); } diff --git a/Source/content/config.ts b/Source/content/config.ts new file mode 100644 index 0000000000..c64baadd42 --- /dev/null +++ b/Source/content/config.ts @@ -0,0 +1,10 @@ +import { i18nSchema } from "@astrojs/starlight/schema"; +import { defineCollection } from "astro:content"; +import { docsSchema } from "src/schemas/docsSchema"; + +export const collections = { + docs: defineCollection({ + schema: docsSchema, + }), + i18n: defineCollection({ type: "data", schema: i18nSchema() }), +}; diff --git a/src/content/docs/404.md b/Source/content/docs/404.md similarity index 100% rename from src/content/docs/404.md rename to Source/content/docs/404.md diff --git a/src/content/docs/_fragments/cta.mdx b/Source/content/docs/_fragments/cta.mdx similarity index 100% rename from src/content/docs/_fragments/cta.mdx rename to Source/content/docs/_fragments/cta.mdx diff --git a/src/content/docs/_it/develop/Debug/vscode.mdx b/Source/content/docs/_it/develop/Debug/vscode.mdx similarity index 100% rename from src/content/docs/_it/develop/Debug/vscode.mdx rename to Source/content/docs/_it/develop/Debug/vscode.mdx diff --git a/src/content/docs/about/book.md b/Source/content/docs/about/book.md similarity index 100% rename from src/content/docs/about/book.md rename to Source/content/docs/about/book.md diff --git a/src/content/docs/about/governance.md b/Source/content/docs/about/governance.md similarity index 100% rename from src/content/docs/about/governance.md rename to Source/content/docs/about/governance.md diff --git a/src/content/docs/about/index.mdx b/Source/content/docs/about/index.mdx similarity index 100% rename from src/content/docs/about/index.mdx rename to Source/content/docs/about/index.mdx diff --git a/src/content/docs/about/philosophy.md b/Source/content/docs/about/philosophy.md similarity index 100% rename from src/content/docs/about/philosophy.md rename to Source/content/docs/about/philosophy.md diff --git a/src/content/docs/about/trademark.md b/Source/content/docs/about/trademark.md similarity index 100% rename from src/content/docs/about/trademark.md rename to Source/content/docs/about/trademark.md diff --git a/src/content/docs/blog/create-tauri-app-version-3-released.md b/Source/content/docs/blog/create-tauri-app-version-3-released.md similarity index 100% rename from src/content/docs/blog/create-tauri-app-version-3-released.md rename to Source/content/docs/blog/create-tauri-app-version-3-released.md diff --git a/src/content/docs/blog/create-tauri-app-version-3-released/header.jpg b/Source/content/docs/blog/create-tauri-app-version-3-released/header.jpg similarity index 100% rename from src/content/docs/blog/create-tauri-app-version-3-released/header.jpg rename to Source/content/docs/blog/create-tauri-app-version-3-released/header.jpg diff --git a/src/content/docs/blog/cve-2024-24576.md b/Source/content/docs/blog/cve-2024-24576.md similarity index 100% rename from src/content/docs/blog/cve-2024-24576.md rename to Source/content/docs/blog/cve-2024-24576.md diff --git a/src/content/docs/blog/partnership-crabnebula.md b/Source/content/docs/blog/partnership-crabnebula.md similarity index 100% rename from src/content/docs/blog/partnership-crabnebula.md rename to Source/content/docs/blog/partnership-crabnebula.md diff --git a/src/content/docs/blog/partnership-crabnebula/header.png b/Source/content/docs/blog/partnership-crabnebula/header.png similarity index 100% rename from src/content/docs/blog/partnership-crabnebula/header.png rename to Source/content/docs/blog/partnership-crabnebula/header.png diff --git a/src/content/docs/blog/roadmap-to-tauri-2-0.md b/Source/content/docs/blog/roadmap-to-tauri-2-0.md similarity index 100% rename from src/content/docs/blog/roadmap-to-tauri-2-0.md rename to Source/content/docs/blog/roadmap-to-tauri-2-0.md diff --git a/src/content/docs/blog/roadmap-to-tauri-2-0/header.png b/Source/content/docs/blog/roadmap-to-tauri-2-0/header.png similarity index 100% rename from src/content/docs/blog/roadmap-to-tauri-2-0/header.png rename to Source/content/docs/blog/roadmap-to-tauri-2-0/header.png diff --git a/src/content/docs/blog/tauri-1-0.md b/Source/content/docs/blog/tauri-1-0.md similarity index 100% rename from src/content/docs/blog/tauri-1-0.md rename to Source/content/docs/blog/tauri-1-0.md diff --git a/src/content/docs/blog/tauri-1-1.mdx b/Source/content/docs/blog/tauri-1-1.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-1.mdx rename to Source/content/docs/blog/tauri-1-1.mdx diff --git a/src/content/docs/blog/tauri-1-2.mdx b/Source/content/docs/blog/tauri-1-2.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-2.mdx rename to Source/content/docs/blog/tauri-1-2.mdx diff --git a/src/content/docs/blog/tauri-1-3.mdx b/Source/content/docs/blog/tauri-1-3.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-3.mdx rename to Source/content/docs/blog/tauri-1-3.mdx diff --git a/src/content/docs/blog/tauri-1-4.mdx b/Source/content/docs/blog/tauri-1-4.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-4.mdx rename to Source/content/docs/blog/tauri-1-4.mdx diff --git a/src/content/docs/blog/tauri-1-5.mdx b/Source/content/docs/blog/tauri-1-5.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-5.mdx rename to Source/content/docs/blog/tauri-1-5.mdx diff --git a/src/content/docs/blog/tauri-1-6.mdx b/Source/content/docs/blog/tauri-1-6.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-6.mdx rename to Source/content/docs/blog/tauri-1-6.mdx diff --git a/src/content/docs/blog/tauri-1-7.mdx b/Source/content/docs/blog/tauri-1-7.mdx similarity index 100% rename from src/content/docs/blog/tauri-1-7.mdx rename to Source/content/docs/blog/tauri-1-7.mdx diff --git a/src/content/docs/blog/tauri-2-0-0-alpha-3.md b/Source/content/docs/blog/tauri-2-0-0-alpha-3.md similarity index 100% rename from src/content/docs/blog/tauri-2-0-0-alpha-3.md rename to Source/content/docs/blog/tauri-2-0-0-alpha-3.md diff --git a/src/content/docs/blog/tauri-2-0-0-alpha-4.mdx b/Source/content/docs/blog/tauri-2-0-0-alpha-4.mdx similarity index 100% rename from src/content/docs/blog/tauri-2-0-0-alpha-4.mdx rename to Source/content/docs/blog/tauri-2-0-0-alpha-4.mdx diff --git a/src/content/docs/blog/tauri-2-0-0-beta.md b/Source/content/docs/blog/tauri-2-0-0-beta.md similarity index 100% rename from src/content/docs/blog/tauri-2-0-0-beta.md rename to Source/content/docs/blog/tauri-2-0-0-beta.md diff --git a/src/content/docs/blog/tauri-2-0-0-release-candidate.mdx b/Source/content/docs/blog/tauri-2-0-0-release-candidate.mdx similarity index 100% rename from src/content/docs/blog/tauri-2-0-0-release-candidate.mdx rename to Source/content/docs/blog/tauri-2-0-0-release-candidate.mdx diff --git a/src/content/docs/blog/tauri-2.0.mdx b/Source/content/docs/blog/tauri-2.0.mdx similarity index 100% rename from src/content/docs/blog/tauri-2.0.mdx rename to Source/content/docs/blog/tauri-2.0.mdx diff --git a/src/content/docs/blog/tauri-board-elections-2024.md b/Source/content/docs/blog/tauri-board-elections-2024.md similarity index 100% rename from src/content/docs/blog/tauri-board-elections-2024.md rename to Source/content/docs/blog/tauri-board-elections-2024.md diff --git a/src/content/docs/blog/tauri-board-elections-and-governance-updates.md b/Source/content/docs/blog/tauri-board-elections-and-governance-updates.md similarity index 100% rename from src/content/docs/blog/tauri-board-elections-and-governance-updates.md rename to Source/content/docs/blog/tauri-board-elections-and-governance-updates.md diff --git a/src/content/docs/blog/tauri-community-growth-and-feedback.md b/Source/content/docs/blog/tauri-community-growth-and-feedback.md similarity index 100% rename from src/content/docs/blog/tauri-community-growth-and-feedback.md rename to Source/content/docs/blog/tauri-community-growth-and-feedback.md diff --git a/src/content/docs/blog/tauri-egui-0-1.md b/Source/content/docs/blog/tauri-egui-0-1.md similarity index 100% rename from src/content/docs/blog/tauri-egui-0-1.md rename to Source/content/docs/blog/tauri-egui-0-1.md diff --git a/src/content/docs/blog/tauri-mobile-alpha.mdx b/Source/content/docs/blog/tauri-mobile-alpha.mdx similarity index 100% rename from src/content/docs/blog/tauri-mobile-alpha.mdx rename to Source/content/docs/blog/tauri-mobile-alpha.mdx diff --git a/src/content/docs/blog/tauri-programme-turns-1-and-board-elections.md b/Source/content/docs/blog/tauri-programme-turns-1-and-board-elections.md similarity index 100% rename from src/content/docs/blog/tauri-programme-turns-1-and-board-elections.md rename to Source/content/docs/blog/tauri-programme-turns-1-and-board-elections.md diff --git a/src/content/docs/blog/tauri_1_0_images/github_stars_dark.png b/Source/content/docs/blog/tauri_1_0_images/github_stars_dark.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/github_stars_dark.png rename to Source/content/docs/blog/tauri_1_0_images/github_stars_dark.png diff --git a/src/content/docs/blog/tauri_1_0_images/hackernews.jpg b/Source/content/docs/blog/tauri_1_0_images/hackernews.jpg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/hackernews.jpg rename to Source/content/docs/blog/tauri_1_0_images/hackernews.jpg diff --git a/src/content/docs/blog/tauri_1_0_images/header.png b/Source/content/docs/blog/tauri_1_0_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/header.png rename to Source/content/docs/blog/tauri_1_0_images/header.png diff --git a/src/content/docs/blog/tauri_1_0_images/hoodie.jpg b/Source/content/docs/blog/tauri_1_0_images/hoodie.jpg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/hoodie.jpg rename to Source/content/docs/blog/tauri_1_0_images/hoodie.jpg diff --git a/src/content/docs/blog/tauri_1_0_images/ossc_logo_dark.png b/Source/content/docs/blog/tauri_1_0_images/ossc_logo_dark.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/ossc_logo_dark.png rename to Source/content/docs/blog/tauri_1_0_images/ossc_logo_dark.png diff --git a/src/content/docs/blog/tauri_1_0_images/ossinsight.jpg b/Source/content/docs/blog/tauri_1_0_images/ossinsight.jpg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/ossinsight.jpg rename to Source/content/docs/blog/tauri_1_0_images/ossinsight.jpg diff --git a/src/content/docs/blog/tauri_1_0_images/padloc_logo_dark.svg b/Source/content/docs/blog/tauri_1_0_images/padloc_logo_dark.svg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/padloc_logo_dark.svg rename to Source/content/docs/blog/tauri_1_0_images/padloc_logo_dark.svg diff --git a/src/content/docs/blog/tauri_1_0_images/prisma_logo.svg b/Source/content/docs/blog/tauri_1_0_images/prisma_logo.svg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/prisma_logo.svg rename to Source/content/docs/blog/tauri_1_0_images/prisma_logo.svg diff --git a/src/content/docs/blog/tauri_1_0_images/prisma_logo_dark.svg b/Source/content/docs/blog/tauri_1_0_images/prisma_logo_dark.svg similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/prisma_logo_dark.svg rename to Source/content/docs/blog/tauri_1_0_images/prisma_logo_dark.svg diff --git a/src/content/docs/blog/tauri_1_0_images/spacedrive_logo_dark.png b/Source/content/docs/blog/tauri_1_0_images/spacedrive_logo_dark.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/spacedrive_logo_dark.png rename to Source/content/docs/blog/tauri_1_0_images/spacedrive_logo_dark.png diff --git a/src/content/docs/blog/tauri_1_0_images/state_of_js.png b/Source/content/docs/blog/tauri_1_0_images/state_of_js.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/state_of_js.png rename to Source/content/docs/blog/tauri_1_0_images/state_of_js.png diff --git a/src/content/docs/blog/tauri_1_0_images/worker_conf_2022.png b/Source/content/docs/blog/tauri_1_0_images/worker_conf_2022.png similarity index 100% rename from src/content/docs/blog/tauri_1_0_images/worker_conf_2022.png rename to Source/content/docs/blog/tauri_1_0_images/worker_conf_2022.png diff --git a/src/content/docs/blog/tauri_1_1_images/header.png b/Source/content/docs/blog/tauri_1_1_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_1_images/header.png rename to Source/content/docs/blog/tauri_1_1_images/header.png diff --git a/src/content/docs/blog/tauri_1_2_images/header.png b/Source/content/docs/blog/tauri_1_2_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_2_images/header.png rename to Source/content/docs/blog/tauri_1_2_images/header.png diff --git a/src/content/docs/blog/tauri_1_3_images/header.png b/Source/content/docs/blog/tauri_1_3_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_3_images/header.png rename to Source/content/docs/blog/tauri_1_3_images/header.png diff --git a/src/content/docs/blog/tauri_1_4_images/header.png b/Source/content/docs/blog/tauri_1_4_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_4_images/header.png rename to Source/content/docs/blog/tauri_1_4_images/header.png diff --git a/src/content/docs/blog/tauri_1_5_images/header.png b/Source/content/docs/blog/tauri_1_5_images/header.png similarity index 100% rename from src/content/docs/blog/tauri_1_5_images/header.png rename to Source/content/docs/blog/tauri_1_5_images/header.png diff --git a/src/content/docs/blog/tauri_2_0_0_alpha_0/android-preview.png b/Source/content/docs/blog/tauri_2_0_0_alpha_0/android-preview.png similarity index 100% rename from src/content/docs/blog/tauri_2_0_0_alpha_0/android-preview.png rename to Source/content/docs/blog/tauri_2_0_0_alpha_0/android-preview.png diff --git a/src/content/docs/blog/tauri_2_0_0_alpha_0/header.png b/Source/content/docs/blog/tauri_2_0_0_alpha_0/header.png similarity index 100% rename from src/content/docs/blog/tauri_2_0_0_alpha_0/header.png rename to Source/content/docs/blog/tauri_2_0_0_alpha_0/header.png diff --git a/src/content/docs/blog/tauri_2_0_0_alpha_0/ios-preview.png b/Source/content/docs/blog/tauri_2_0_0_alpha_0/ios-preview.png similarity index 100% rename from src/content/docs/blog/tauri_2_0_0_alpha_0/ios-preview.png rename to Source/content/docs/blog/tauri_2_0_0_alpha_0/ios-preview.png diff --git a/src/content/docs/blog/tauri_community_growth_and_feedback/header.jpg b/Source/content/docs/blog/tauri_community_growth_and_feedback/header.jpg similarity index 100% rename from src/content/docs/blog/tauri_community_growth_and_feedback/header.jpg rename to Source/content/docs/blog/tauri_community_growth_and_feedback/header.jpg diff --git a/src/content/docs/blog/tauri_community_growth_and_feedback/search_preview.gif b/Source/content/docs/blog/tauri_community_growth_and_feedback/search_preview.gif similarity index 100% rename from src/content/docs/blog/tauri_community_growth_and_feedback/search_preview.gif rename to Source/content/docs/blog/tauri_community_growth_and_feedback/search_preview.gif diff --git a/src/content/docs/blog/tauri_egui_0_1_images/example.png b/Source/content/docs/blog/tauri_egui_0_1_images/example.png similarity index 100% rename from src/content/docs/blog/tauri_egui_0_1_images/example.png rename to Source/content/docs/blog/tauri_egui_0_1_images/example.png diff --git a/src/content/docs/concept/Inter-Process Communication/brownfield.md b/Source/content/docs/concept/Inter-Process Communication/brownfield.md similarity index 100% rename from src/content/docs/concept/Inter-Process Communication/brownfield.md rename to Source/content/docs/concept/Inter-Process Communication/brownfield.md diff --git a/src/content/docs/concept/Inter-Process Communication/index.mdx b/Source/content/docs/concept/Inter-Process Communication/index.mdx similarity index 100% rename from src/content/docs/concept/Inter-Process Communication/index.mdx rename to Source/content/docs/concept/Inter-Process Communication/index.mdx diff --git a/src/content/docs/concept/Inter-Process Communication/isolation.md b/Source/content/docs/concept/Inter-Process Communication/isolation.md similarity index 100% rename from src/content/docs/concept/Inter-Process Communication/isolation.md rename to Source/content/docs/concept/Inter-Process Communication/isolation.md diff --git a/src/content/docs/concept/architecture.mdx b/Source/content/docs/concept/architecture.mdx similarity index 100% rename from src/content/docs/concept/architecture.mdx rename to Source/content/docs/concept/architecture.mdx diff --git a/src/content/docs/concept/index.mdx b/Source/content/docs/concept/index.mdx similarity index 100% rename from src/content/docs/concept/index.mdx rename to Source/content/docs/concept/index.mdx diff --git a/src/content/docs/concept/process-model.md b/Source/content/docs/concept/process-model.md similarity index 100% rename from src/content/docs/concept/process-model.md rename to Source/content/docs/concept/process-model.md diff --git a/src/content/docs/concept/size.mdx b/Source/content/docs/concept/size.mdx similarity index 100% rename from src/content/docs/concept/size.mdx rename to Source/content/docs/concept/size.mdx diff --git a/src/content/docs/develop/Debug/crabnebula-devtools.mdx b/Source/content/docs/develop/Debug/crabnebula-devtools.mdx similarity index 100% rename from src/content/docs/develop/Debug/crabnebula-devtools.mdx rename to Source/content/docs/develop/Debug/crabnebula-devtools.mdx diff --git a/src/content/docs/develop/Debug/index.mdx b/Source/content/docs/develop/Debug/index.mdx similarity index 100% rename from src/content/docs/develop/Debug/index.mdx rename to Source/content/docs/develop/Debug/index.mdx diff --git a/src/content/docs/develop/Debug/neovim.mdx b/Source/content/docs/develop/Debug/neovim.mdx similarity index 100% rename from src/content/docs/develop/Debug/neovim.mdx rename to Source/content/docs/develop/Debug/neovim.mdx diff --git a/src/content/docs/develop/Debug/rustrover.mdx b/Source/content/docs/develop/Debug/rustrover.mdx similarity index 100% rename from src/content/docs/develop/Debug/rustrover.mdx rename to Source/content/docs/develop/Debug/rustrover.mdx diff --git a/src/content/docs/develop/Debug/vscode.mdx b/Source/content/docs/develop/Debug/vscode.mdx similarity index 100% rename from src/content/docs/develop/Debug/vscode.mdx rename to Source/content/docs/develop/Debug/vscode.mdx diff --git a/src/content/docs/develop/Plugins/develop-mobile.mdx b/Source/content/docs/develop/Plugins/develop-mobile.mdx similarity index 100% rename from src/content/docs/develop/Plugins/develop-mobile.mdx rename to Source/content/docs/develop/Plugins/develop-mobile.mdx diff --git a/src/content/docs/develop/Plugins/index.mdx b/Source/content/docs/develop/Plugins/index.mdx similarity index 100% rename from src/content/docs/develop/Plugins/index.mdx rename to Source/content/docs/develop/Plugins/index.mdx diff --git a/src/content/docs/develop/Tests/WebDriver/Example/index.mdx b/Source/content/docs/develop/Tests/WebDriver/Example/index.mdx similarity index 100% rename from src/content/docs/develop/Tests/WebDriver/Example/index.mdx rename to Source/content/docs/develop/Tests/WebDriver/Example/index.mdx diff --git a/src/content/docs/develop/Tests/WebDriver/Example/selenium.mdx b/Source/content/docs/develop/Tests/WebDriver/Example/selenium.mdx similarity index 100% rename from src/content/docs/develop/Tests/WebDriver/Example/selenium.mdx rename to Source/content/docs/develop/Tests/WebDriver/Example/selenium.mdx diff --git a/src/content/docs/develop/Tests/WebDriver/Example/webdriverio.mdx b/Source/content/docs/develop/Tests/WebDriver/Example/webdriverio.mdx similarity index 100% rename from src/content/docs/develop/Tests/WebDriver/Example/webdriverio.mdx rename to Source/content/docs/develop/Tests/WebDriver/Example/webdriverio.mdx diff --git a/src/content/docs/develop/Tests/WebDriver/ci.md b/Source/content/docs/develop/Tests/WebDriver/ci.md similarity index 100% rename from src/content/docs/develop/Tests/WebDriver/ci.md rename to Source/content/docs/develop/Tests/WebDriver/ci.md diff --git a/src/content/docs/develop/Tests/WebDriver/index.mdx b/Source/content/docs/develop/Tests/WebDriver/index.mdx similarity index 100% rename from src/content/docs/develop/Tests/WebDriver/index.mdx rename to Source/content/docs/develop/Tests/WebDriver/index.mdx diff --git a/src/content/docs/develop/Tests/index.mdx b/Source/content/docs/develop/Tests/index.mdx similarity index 100% rename from src/content/docs/develop/Tests/index.mdx rename to Source/content/docs/develop/Tests/index.mdx diff --git a/src/content/docs/develop/Tests/mocking.md b/Source/content/docs/develop/Tests/mocking.md similarity index 100% rename from src/content/docs/develop/Tests/mocking.md rename to Source/content/docs/develop/Tests/mocking.md diff --git a/src/content/docs/develop/_sections/frontend-listen.mdx b/Source/content/docs/develop/_sections/frontend-listen.mdx similarity index 100% rename from src/content/docs/develop/_sections/frontend-listen.mdx rename to Source/content/docs/develop/_sections/frontend-listen.mdx diff --git a/src/content/docs/develop/calling-frontend.mdx b/Source/content/docs/develop/calling-frontend.mdx similarity index 100% rename from src/content/docs/develop/calling-frontend.mdx rename to Source/content/docs/develop/calling-frontend.mdx diff --git a/src/content/docs/develop/calling-rust.mdx b/Source/content/docs/develop/calling-rust.mdx similarity index 100% rename from src/content/docs/develop/calling-rust.mdx rename to Source/content/docs/develop/calling-rust.mdx diff --git a/src/content/docs/develop/configuration-files.mdx b/Source/content/docs/develop/configuration-files.mdx similarity index 100% rename from src/content/docs/develop/configuration-files.mdx rename to Source/content/docs/develop/configuration-files.mdx diff --git a/src/content/docs/develop/index.mdx b/Source/content/docs/develop/index.mdx similarity index 100% rename from src/content/docs/develop/index.mdx rename to Source/content/docs/develop/index.mdx diff --git a/src/content/docs/develop/resources.mdx b/Source/content/docs/develop/resources.mdx similarity index 100% rename from src/content/docs/develop/resources.mdx rename to Source/content/docs/develop/resources.mdx diff --git a/src/content/docs/develop/sidecar.mdx b/Source/content/docs/develop/sidecar.mdx similarity index 100% rename from src/content/docs/develop/sidecar.mdx rename to Source/content/docs/develop/sidecar.mdx diff --git a/src/content/docs/develop/state-management.mdx b/Source/content/docs/develop/state-management.mdx similarity index 100% rename from src/content/docs/develop/state-management.mdx rename to Source/content/docs/develop/state-management.mdx diff --git a/src/content/docs/develop/updating-dependencies.mdx b/Source/content/docs/develop/updating-dependencies.mdx similarity index 100% rename from src/content/docs/develop/updating-dependencies.mdx rename to Source/content/docs/develop/updating-dependencies.mdx diff --git a/src/content/docs/distribute/Pipelines/crabnebula-cloud.mdx b/Source/content/docs/distribute/Pipelines/crabnebula-cloud.mdx similarity index 100% rename from src/content/docs/distribute/Pipelines/crabnebula-cloud.mdx rename to Source/content/docs/distribute/Pipelines/crabnebula-cloud.mdx diff --git a/src/content/docs/distribute/Pipelines/github.mdx b/Source/content/docs/distribute/Pipelines/github.mdx similarity index 100% rename from src/content/docs/distribute/Pipelines/github.mdx rename to Source/content/docs/distribute/Pipelines/github.mdx diff --git a/src/content/docs/distribute/Sign/android.mdx b/Source/content/docs/distribute/Sign/android.mdx similarity index 100% rename from src/content/docs/distribute/Sign/android.mdx rename to Source/content/docs/distribute/Sign/android.mdx diff --git a/src/content/docs/distribute/Sign/ios.mdx b/Source/content/docs/distribute/Sign/ios.mdx similarity index 100% rename from src/content/docs/distribute/Sign/ios.mdx rename to Source/content/docs/distribute/Sign/ios.mdx diff --git a/src/content/docs/distribute/Sign/linux.mdx b/Source/content/docs/distribute/Sign/linux.mdx similarity index 100% rename from src/content/docs/distribute/Sign/linux.mdx rename to Source/content/docs/distribute/Sign/linux.mdx diff --git a/src/content/docs/distribute/Sign/macos.mdx b/Source/content/docs/distribute/Sign/macos.mdx similarity index 100% rename from src/content/docs/distribute/Sign/macos.mdx rename to Source/content/docs/distribute/Sign/macos.mdx diff --git a/src/content/docs/distribute/Sign/windows.mdx b/Source/content/docs/distribute/Sign/windows.mdx similarity index 100% rename from src/content/docs/distribute/Sign/windows.mdx rename to Source/content/docs/distribute/Sign/windows.mdx diff --git a/src/content/docs/distribute/app-store.mdx b/Source/content/docs/distribute/app-store.mdx similarity index 100% rename from src/content/docs/distribute/app-store.mdx rename to Source/content/docs/distribute/app-store.mdx diff --git a/src/content/docs/distribute/appimage.mdx b/Source/content/docs/distribute/appimage.mdx similarity index 100% rename from src/content/docs/distribute/appimage.mdx rename to Source/content/docs/distribute/appimage.mdx diff --git a/src/content/docs/distribute/aur.mdx b/Source/content/docs/distribute/aur.mdx similarity index 100% rename from src/content/docs/distribute/aur.mdx rename to Source/content/docs/distribute/aur.mdx diff --git a/src/content/docs/distribute/crabnebula-cloud.mdx b/Source/content/docs/distribute/crabnebula-cloud.mdx similarity index 100% rename from src/content/docs/distribute/crabnebula-cloud.mdx rename to Source/content/docs/distribute/crabnebula-cloud.mdx diff --git a/src/content/docs/distribute/debian.mdx b/Source/content/docs/distribute/debian.mdx similarity index 100% rename from src/content/docs/distribute/debian.mdx rename to Source/content/docs/distribute/debian.mdx diff --git a/src/content/docs/distribute/dmg.mdx b/Source/content/docs/distribute/dmg.mdx similarity index 100% rename from src/content/docs/distribute/dmg.mdx rename to Source/content/docs/distribute/dmg.mdx diff --git a/src/content/docs/distribute/flatpak.mdx b/Source/content/docs/distribute/flatpak.mdx similarity index 100% rename from src/content/docs/distribute/flatpak.mdx rename to Source/content/docs/distribute/flatpak.mdx diff --git a/src/content/docs/distribute/google-play.mdx b/Source/content/docs/distribute/google-play.mdx similarity index 100% rename from src/content/docs/distribute/google-play.mdx rename to Source/content/docs/distribute/google-play.mdx diff --git a/src/content/docs/distribute/index.mdx b/Source/content/docs/distribute/index.mdx similarity index 100% rename from src/content/docs/distribute/index.mdx rename to Source/content/docs/distribute/index.mdx diff --git a/src/content/docs/distribute/macos-application-bundle.mdx b/Source/content/docs/distribute/macos-application-bundle.mdx similarity index 100% rename from src/content/docs/distribute/macos-application-bundle.mdx rename to Source/content/docs/distribute/macos-application-bundle.mdx diff --git a/src/content/docs/distribute/microsoft-store.mdx b/Source/content/docs/distribute/microsoft-store.mdx similarity index 100% rename from src/content/docs/distribute/microsoft-store.mdx rename to Source/content/docs/distribute/microsoft-store.mdx diff --git a/src/content/docs/distribute/rpm.mdx b/Source/content/docs/distribute/rpm.mdx similarity index 100% rename from src/content/docs/distribute/rpm.mdx rename to Source/content/docs/distribute/rpm.mdx diff --git a/src/content/docs/distribute/snapcraft.mdx b/Source/content/docs/distribute/snapcraft.mdx similarity index 100% rename from src/content/docs/distribute/snapcraft.mdx rename to Source/content/docs/distribute/snapcraft.mdx diff --git a/src/content/docs/distribute/windows-installer.mdx b/Source/content/docs/distribute/windows-installer.mdx similarity index 100% rename from src/content/docs/distribute/windows-installer.mdx rename to Source/content/docs/distribute/windows-installer.mdx diff --git a/src/content/docs/es/index.mdx b/Source/content/docs/es/index.mdx similarity index 100% rename from src/content/docs/es/index.mdx rename to Source/content/docs/es/index.mdx diff --git a/src/content/docs/es/plugin/dialog.mdx b/Source/content/docs/es/plugin/dialog.mdx similarity index 100% rename from src/content/docs/es/plugin/dialog.mdx rename to Source/content/docs/es/plugin/dialog.mdx diff --git a/src/content/docs/es/plugin/index.mdx b/Source/content/docs/es/plugin/index.mdx similarity index 100% rename from src/content/docs/es/plugin/index.mdx rename to Source/content/docs/es/plugin/index.mdx diff --git a/src/content/docs/es/start/frontend/index.mdx b/Source/content/docs/es/start/frontend/index.mdx similarity index 100% rename from src/content/docs/es/start/frontend/index.mdx rename to Source/content/docs/es/start/frontend/index.mdx diff --git a/src/content/docs/es/start/frontend/nextjs.mdx b/Source/content/docs/es/start/frontend/nextjs.mdx similarity index 100% rename from src/content/docs/es/start/frontend/nextjs.mdx rename to Source/content/docs/es/start/frontend/nextjs.mdx diff --git a/src/content/docs/es/start/frontend/nuxt.mdx b/Source/content/docs/es/start/frontend/nuxt.mdx similarity index 100% rename from src/content/docs/es/start/frontend/nuxt.mdx rename to Source/content/docs/es/start/frontend/nuxt.mdx diff --git a/src/content/docs/es/start/frontend/qwik.mdx b/Source/content/docs/es/start/frontend/qwik.mdx similarity index 100% rename from src/content/docs/es/start/frontend/qwik.mdx rename to Source/content/docs/es/start/frontend/qwik.mdx diff --git a/src/content/docs/es/start/frontend/sveltekit.mdx b/Source/content/docs/es/start/frontend/sveltekit.mdx similarity index 100% rename from src/content/docs/es/start/frontend/sveltekit.mdx rename to Source/content/docs/es/start/frontend/sveltekit.mdx diff --git a/src/content/docs/es/start/frontend/trunk.mdx b/Source/content/docs/es/start/frontend/trunk.mdx similarity index 100% rename from src/content/docs/es/start/frontend/trunk.mdx rename to Source/content/docs/es/start/frontend/trunk.mdx diff --git a/src/content/docs/es/start/index.mdx b/Source/content/docs/es/start/index.mdx similarity index 100% rename from src/content/docs/es/start/index.mdx rename to Source/content/docs/es/start/index.mdx diff --git a/src/content/docs/es/start/migrate/from-tauri-1.mdx b/Source/content/docs/es/start/migrate/from-tauri-1.mdx similarity index 100% rename from src/content/docs/es/start/migrate/from-tauri-1.mdx rename to Source/content/docs/es/start/migrate/from-tauri-1.mdx diff --git a/src/content/docs/es/start/prerequisites.mdx b/Source/content/docs/es/start/prerequisites.mdx similarity index 100% rename from src/content/docs/es/start/prerequisites.mdx rename to Source/content/docs/es/start/prerequisites.mdx diff --git a/src/content/docs/es/start/visual-studio-build-tools-installer.png b/Source/content/docs/es/start/visual-studio-build-tools-installer.png similarity index 100% rename from src/content/docs/es/start/visual-studio-build-tools-installer.png rename to Source/content/docs/es/start/visual-studio-build-tools-installer.png diff --git a/src/content/docs/fr/develop/Debug/application.mdx b/Source/content/docs/fr/develop/Debug/application.mdx similarity index 100% rename from src/content/docs/fr/develop/Debug/application.mdx rename to Source/content/docs/fr/develop/Debug/application.mdx diff --git a/src/content/docs/fr/develop/Debug/vscode.mdx b/Source/content/docs/fr/develop/Debug/vscode.mdx similarity index 100% rename from src/content/docs/fr/develop/Debug/vscode.mdx rename to Source/content/docs/fr/develop/Debug/vscode.mdx diff --git a/src/content/docs/fr/develop/development-cycle.mdx b/Source/content/docs/fr/develop/development-cycle.mdx similarity index 100% rename from src/content/docs/fr/develop/development-cycle.mdx rename to Source/content/docs/fr/develop/development-cycle.mdx diff --git a/src/content/docs/fr/develop/updating-dependencies.mdx b/Source/content/docs/fr/develop/updating-dependencies.mdx similarity index 100% rename from src/content/docs/fr/develop/updating-dependencies.mdx rename to Source/content/docs/fr/develop/updating-dependencies.mdx diff --git a/src/content/docs/fr/distribute/debian.mdx b/Source/content/docs/fr/distribute/debian.mdx similarity index 100% rename from src/content/docs/fr/distribute/debian.mdx rename to Source/content/docs/fr/distribute/debian.mdx diff --git a/src/content/docs/fr/index.mdx b/Source/content/docs/fr/index.mdx similarity index 100% rename from src/content/docs/fr/index.mdx rename to Source/content/docs/fr/index.mdx diff --git a/src/content/docs/fr/plugin/index.mdx b/Source/content/docs/fr/plugin/index.mdx similarity index 100% rename from src/content/docs/fr/plugin/index.mdx rename to Source/content/docs/fr/plugin/index.mdx diff --git a/src/content/docs/fr/plugin/notification.mdx b/Source/content/docs/fr/plugin/notification.mdx similarity index 100% rename from src/content/docs/fr/plugin/notification.mdx rename to Source/content/docs/fr/plugin/notification.mdx diff --git a/src/content/docs/fr/start/frontend/index.mdx b/Source/content/docs/fr/start/frontend/index.mdx similarity index 100% rename from src/content/docs/fr/start/frontend/index.mdx rename to Source/content/docs/fr/start/frontend/index.mdx diff --git a/src/content/docs/fr/start/frontend/nextjs.mdx b/Source/content/docs/fr/start/frontend/nextjs.mdx similarity index 100% rename from src/content/docs/fr/start/frontend/nextjs.mdx rename to Source/content/docs/fr/start/frontend/nextjs.mdx diff --git a/src/content/docs/fr/start/frontend/nuxt.mdx b/Source/content/docs/fr/start/frontend/nuxt.mdx similarity index 100% rename from src/content/docs/fr/start/frontend/nuxt.mdx rename to Source/content/docs/fr/start/frontend/nuxt.mdx diff --git a/src/content/docs/fr/start/frontend/trunk.mdx b/Source/content/docs/fr/start/frontend/trunk.mdx similarity index 100% rename from src/content/docs/fr/start/frontend/trunk.mdx rename to Source/content/docs/fr/start/frontend/trunk.mdx diff --git a/src/content/docs/fr/start/migrate/from-tauri-1.mdx b/Source/content/docs/fr/start/migrate/from-tauri-1.mdx similarity index 100% rename from src/content/docs/fr/start/migrate/from-tauri-1.mdx rename to Source/content/docs/fr/start/migrate/from-tauri-1.mdx diff --git a/src/content/docs/fr/start/prerequisites.mdx b/Source/content/docs/fr/start/prerequisites.mdx similarity index 100% rename from src/content/docs/fr/start/prerequisites.mdx rename to Source/content/docs/fr/start/prerequisites.mdx diff --git a/src/content/docs/fr/start/visual-studio-build-tools-installer.png b/Source/content/docs/fr/start/visual-studio-build-tools-installer.png similarity index 100% rename from src/content/docs/fr/start/visual-studio-build-tools-installer.png rename to Source/content/docs/fr/start/visual-studio-build-tools-installer.png diff --git a/src/content/docs/index.mdx b/Source/content/docs/index.mdx similarity index 100% rename from src/content/docs/index.mdx rename to Source/content/docs/index.mdx diff --git a/Source/content/docs/it/develop/Debug/vscode.mdx b/Source/content/docs/it/develop/Debug/vscode.mdx new file mode 100644 index 0000000000..767fe2f77c --- /dev/null +++ b/Source/content/docs/it/develop/Debug/vscode.mdx @@ -0,0 +1,84 @@ +--- +title: Debug in VS Code +description: Suggerimenti e trucchi per il flusso di lavoro di debug +--- + +## Prerequisiti + +Installa l'estensione [`vscode-lldb`][]. + +## Configura launch.json + +Crea un file `.vscode/launch.json` e incolla il contenuto JSON sottostante in esso: + +```json title=".vscode/launch.json" +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Tauri Development Debug", + "cargo": { + "args": [ + "build", + "--manifest-path=./src-tauri/Cargo.toml", + "--no-default-features" + ] + }, + // task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json` + "preLaunchTask": "ui:dev" + }, + { + "type": "lldb", + "request": "launch", + "name": "Tauri Production Debug", + "cargo": { + "args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"] + }, + // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json` + "preLaunchTask": "ui:build" + } + ] +} +``` + +Questo utilizza `cargo` direttamente per costruire l'applicazione Rust e caricarlo sia in modalità di sviluppo che di produzione. + +Nota che non utilizza il Tauri CLI, quindi le esclusive funzioni CLI non vengono eseguite. Gli script `beforeDevCommand` e `beforeBuildCommand` devono essere eseguiti in anticipo o configurati come task nel campo `preLaunchTask`. Di seguito trovate come esempio il file `.vscode/tasks.json` che ha due task, uno per un `beforeDevCommand` che genera un server di sviluppo e uno per `beforeBuildCommand`: + +```json title=".vscode/tasks.json" +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "ui:dev", + "type": "shell", + // `dev` keeps running in the background + // ideally you should also configure a `problemMatcher` + // see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson + "isBackground": true, + // change this to your `beforeDevCommand`: + "command": "yarn", + "args": ["dev"] + }, + { + "label": "ui:build", + "type": "shell", + // change this to your `beforeBuildCommand`: + "command": "yarn", + "args": ["build"] + } + ] +} +``` + +Ora puoi impostare breakpoint in `src-tauri/src/main.rs` o in qualsiasi altro file Rust e iniziare il processo di debug premendo `F5`. + +[`vscode-lldb`]: https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb +[Core Process of your Tauri app]: https://tauri.app/v1/reference/architecture/process-model#the-core-process diff --git a/src/content/docs/it/develop/index.mdx b/Source/content/docs/it/develop/index.mdx similarity index 100% rename from src/content/docs/it/develop/index.mdx rename to Source/content/docs/it/develop/index.mdx diff --git a/src/content/docs/learn/Security/capabilities-for-windows-and-platforms.mdx b/Source/content/docs/learn/Security/capabilities-for-windows-and-platforms.mdx similarity index 100% rename from src/content/docs/learn/Security/capabilities-for-windows-and-platforms.mdx rename to Source/content/docs/learn/Security/capabilities-for-windows-and-platforms.mdx diff --git a/src/content/docs/learn/Security/using-plugin-permissions.mdx b/Source/content/docs/learn/Security/using-plugin-permissions.mdx similarity index 100% rename from src/content/docs/learn/Security/using-plugin-permissions.mdx rename to Source/content/docs/learn/Security/using-plugin-permissions.mdx diff --git a/src/content/docs/learn/Security/writing-plugin-permissions.mdx b/Source/content/docs/learn/Security/writing-plugin-permissions.mdx similarity index 100% rename from src/content/docs/learn/Security/writing-plugin-permissions.mdx rename to Source/content/docs/learn/Security/writing-plugin-permissions.mdx diff --git a/src/content/docs/learn/index.mdx b/Source/content/docs/learn/index.mdx similarity index 100% rename from src/content/docs/learn/index.mdx rename to Source/content/docs/learn/index.mdx diff --git a/src/content/docs/learn/sidecar-nodejs.mdx b/Source/content/docs/learn/sidecar-nodejs.mdx similarity index 100% rename from src/content/docs/learn/sidecar-nodejs.mdx rename to Source/content/docs/learn/sidecar-nodejs.mdx diff --git a/src/content/docs/learn/splashscreen.mdx b/Source/content/docs/learn/splashscreen.mdx similarity index 100% rename from src/content/docs/learn/splashscreen.mdx rename to Source/content/docs/learn/splashscreen.mdx diff --git a/src/content/docs/learn/system-tray.mdx b/Source/content/docs/learn/system-tray.mdx similarity index 100% rename from src/content/docs/learn/system-tray.mdx rename to Source/content/docs/learn/system-tray.mdx diff --git a/src/content/docs/learn/window-customization.mdx b/Source/content/docs/learn/window-customization.mdx similarity index 100% rename from src/content/docs/learn/window-customization.mdx rename to Source/content/docs/learn/window-customization.mdx diff --git a/src/content/docs/plugin/autostart.mdx b/Source/content/docs/plugin/autostart.mdx similarity index 100% rename from src/content/docs/plugin/autostart.mdx rename to Source/content/docs/plugin/autostart.mdx diff --git a/src/content/docs/plugin/barcode-scanner.mdx b/Source/content/docs/plugin/barcode-scanner.mdx similarity index 100% rename from src/content/docs/plugin/barcode-scanner.mdx rename to Source/content/docs/plugin/barcode-scanner.mdx diff --git a/src/content/docs/plugin/biometric.mdx b/Source/content/docs/plugin/biometric.mdx similarity index 100% rename from src/content/docs/plugin/biometric.mdx rename to Source/content/docs/plugin/biometric.mdx diff --git a/src/content/docs/plugin/cli.mdx b/Source/content/docs/plugin/cli.mdx similarity index 100% rename from src/content/docs/plugin/cli.mdx rename to Source/content/docs/plugin/cli.mdx diff --git a/src/content/docs/plugin/clipboard.mdx b/Source/content/docs/plugin/clipboard.mdx similarity index 100% rename from src/content/docs/plugin/clipboard.mdx rename to Source/content/docs/plugin/clipboard.mdx diff --git a/src/content/docs/plugin/deep-linking.mdx b/Source/content/docs/plugin/deep-linking.mdx similarity index 100% rename from src/content/docs/plugin/deep-linking.mdx rename to Source/content/docs/plugin/deep-linking.mdx diff --git a/src/content/docs/plugin/dialog.mdx b/Source/content/docs/plugin/dialog.mdx similarity index 100% rename from src/content/docs/plugin/dialog.mdx rename to Source/content/docs/plugin/dialog.mdx diff --git a/src/content/docs/plugin/file-system.mdx b/Source/content/docs/plugin/file-system.mdx similarity index 100% rename from src/content/docs/plugin/file-system.mdx rename to Source/content/docs/plugin/file-system.mdx diff --git a/src/content/docs/plugin/global-shortcut.mdx b/Source/content/docs/plugin/global-shortcut.mdx similarity index 100% rename from src/content/docs/plugin/global-shortcut.mdx rename to Source/content/docs/plugin/global-shortcut.mdx diff --git a/src/content/docs/plugin/http-client.mdx b/Source/content/docs/plugin/http-client.mdx similarity index 100% rename from src/content/docs/plugin/http-client.mdx rename to Source/content/docs/plugin/http-client.mdx diff --git a/src/content/docs/plugin/index.mdx b/Source/content/docs/plugin/index.mdx similarity index 100% rename from src/content/docs/plugin/index.mdx rename to Source/content/docs/plugin/index.mdx diff --git a/src/content/docs/plugin/localhost.mdx b/Source/content/docs/plugin/localhost.mdx similarity index 100% rename from src/content/docs/plugin/localhost.mdx rename to Source/content/docs/plugin/localhost.mdx diff --git a/src/content/docs/plugin/logging.mdx b/Source/content/docs/plugin/logging.mdx similarity index 100% rename from src/content/docs/plugin/logging.mdx rename to Source/content/docs/plugin/logging.mdx diff --git a/src/content/docs/plugin/nfc.mdx b/Source/content/docs/plugin/nfc.mdx similarity index 100% rename from src/content/docs/plugin/nfc.mdx rename to Source/content/docs/plugin/nfc.mdx diff --git a/src/content/docs/plugin/notification.mdx b/Source/content/docs/plugin/notification.mdx similarity index 100% rename from src/content/docs/plugin/notification.mdx rename to Source/content/docs/plugin/notification.mdx diff --git a/src/content/docs/plugin/os-info.mdx b/Source/content/docs/plugin/os-info.mdx similarity index 100% rename from src/content/docs/plugin/os-info.mdx rename to Source/content/docs/plugin/os-info.mdx diff --git a/src/content/docs/plugin/persisted-scope.mdx b/Source/content/docs/plugin/persisted-scope.mdx similarity index 100% rename from src/content/docs/plugin/persisted-scope.mdx rename to Source/content/docs/plugin/persisted-scope.mdx diff --git a/src/content/docs/plugin/positioner.mdx b/Source/content/docs/plugin/positioner.mdx similarity index 100% rename from src/content/docs/plugin/positioner.mdx rename to Source/content/docs/plugin/positioner.mdx diff --git a/src/content/docs/plugin/process.mdx b/Source/content/docs/plugin/process.mdx similarity index 100% rename from src/content/docs/plugin/process.mdx rename to Source/content/docs/plugin/process.mdx diff --git a/src/content/docs/plugin/shell.mdx b/Source/content/docs/plugin/shell.mdx similarity index 100% rename from src/content/docs/plugin/shell.mdx rename to Source/content/docs/plugin/shell.mdx diff --git a/src/content/docs/plugin/single-instance.mdx b/Source/content/docs/plugin/single-instance.mdx similarity index 100% rename from src/content/docs/plugin/single-instance.mdx rename to Source/content/docs/plugin/single-instance.mdx diff --git a/src/content/docs/plugin/sql.mdx b/Source/content/docs/plugin/sql.mdx similarity index 100% rename from src/content/docs/plugin/sql.mdx rename to Source/content/docs/plugin/sql.mdx diff --git a/src/content/docs/plugin/store.mdx b/Source/content/docs/plugin/store.mdx similarity index 100% rename from src/content/docs/plugin/store.mdx rename to Source/content/docs/plugin/store.mdx diff --git a/src/content/docs/plugin/stronghold.mdx b/Source/content/docs/plugin/stronghold.mdx similarity index 100% rename from src/content/docs/plugin/stronghold.mdx rename to Source/content/docs/plugin/stronghold.mdx diff --git a/Source/content/docs/plugin/system-tray.mdx b/Source/content/docs/plugin/system-tray.mdx new file mode 100644 index 0000000000..9f77a1ff13 --- /dev/null +++ b/Source/content/docs/plugin/system-tray.mdx @@ -0,0 +1,316 @@ +--- +title: System Tray +sidebar: + order: 1 +tableOfContents: + maxHeadingLevel: 4 +--- + +import { Icon } from '@astrojs/starlight/components'; +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +Tauri allows you to create and customize a system tray for your application. +This can enhance the user experience by providing quick access to common actions. + +## Configuration + +First of all, update your `Cargo.toml` to include the necessary feature for the system tray. + +```toml title="src-tauri/Cargo.toml" +tauri = { version = "2.0.0", features = [ "tray-icon" ] } +``` + +## Usage + +The tray API is available in both JavaScript and Rust. + +### Create a Tray Icon + + + +Use the [`TrayIcon.new`] static function to create a new tray icon: + +```javascript +import { TrayIcon } from '@tauri-apps/api/tray'; + +const options = { + // here you can add a tray menu, title, tooltip, event handler, etc +}; + +const tray = await TrayIcon.new(options); +``` + +See [`TrayIconOptions`] for more information on the customization options. + + + + + +```rust +use tauri::tray::TrayIconBuilder; + +tauri::Builder::default() +.setup(|app| { +let tray = TrayIconBuilder::new().build(app)?; +Ok(()) +}) + +``` + +See [`TrayIconBuilder`] for more information on customization options. + + + + +### Change the Tray Icon + +When creating the tray you can use the application icon as the tray icon: + + + + +```javascript +import { TrayIcon } from '@tauri-apps/api/tray'; +import { defaultWindowIcon } from '@tauri-apps/api/app'; + +const options = { + icon: await defaultWindowIcon(), +}; + +const tray = await TrayIcon.new(options); +``` + + + + + +```rust +let tray = TrayIconBuilder::new() + .icon(app.default_window_icon().unwrap().clone()) + .build(app)?; +``` + + + + +### Add a Menu + +To attach a menu that is displayed when the tray is clicked, you can use the `menu` option. + +:::note +By default the menu is displayed on both left and right clicks. + +To prevent the menu from popping up on left click, call the [`menu_on_left_click(false)`][TrayIconBuilder::menu_on_left_click] Rust function +or set the [`menuOnLeftClick`] JavaScript option to `false`. +::: + +{/* TODO: link to the menu plugin documentation page */} + + + + +```javascript +import { TrayIcon } from '@tauri-apps/api/tray'; +import { Menu } from '@tauri-apps/api/menu'; + +const menu = await Menu.new({ + items: [ + { + id: 'quit', + text: 'Quit', + }, + ], +}); + +const options = { + menu, + menuOnLeftClick: true, +}; + +const tray = await TrayIcon.new(options); +``` + + + + + +```rust +use tauri::{ + menu::{Menu, MenuItem}, + tray::TrayIconBuilder, +}; + +let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?; +let menu = Menu::with_items(app, &[&quit_i])?; + +let tray = TrayIconBuilder::new() + .menu(&menu) + .menu_on_left_click(true) + .build(app)?; +``` + + + + +#### Listen to Menu Events + + + +On JavaScript you can attach a menu click event listener directly to the menu item: + +- Using a shared menu click handler + + ```javascript + import { Menu } from '@tauri-apps/api/menu'; + + function onTrayMenuClick(itemId) { + // itemId === 'quit' + } + + const menu = await Menu.new({ + items: [ + { + id: 'quit', + text: 'Quit', + action: onTrayMenuClick, + }, + ], + }); + ``` + +- Using a dedicated menu click handler + + ```javascript + import { Menu } from '@tauri-apps/api/menu'; + + const menu = await Menu.new({ + items: [ + { + id: 'quit', + text: 'Quit', + action: () => { + console.log('quit pressed'); + }, + }, + ], + }); + ``` + + + + +Use the [`TrayIconBuilder::on_menu_event`] method to attach a tray menu click event listener: + +```rust +use tauri::tray::TrayIconBuilder; + +TrayIconBuilder::new() + .on_menu_event(|app, event| match event.id.as_ref() { + "quit" => { + println!("quit menu item was clicked"); + app.exit(0); + } + _ => { + println!("menu item {:?} not handled", event.id); + } + }) +``` + + + + +### Listen to Tray Events + +The tray icon emits events for the following mouse events: + +- click: triggered when the cursor receives a single left, right or middle click, including information on whether the mouse press was released or not +- Double click: triggered when the cursor receives a double left, right or middle click +- Enter: triggered when the cursor enters the tray icon area +- Move: triggered when the cursor moves around the tray icon area +- Leave: triggered when the cursor leaves the tray icon area + + + + +```javascript +import { TrayIcon } from '@tauri-apps/api/tray'; + +const options = { + action: (event) => { + switch (event.type) { + case 'Click': + console.log( + `mouse ${event.button} button pressed, state: ${event.buttonState}` + ); + break; + case 'DoubleClick': + console.log(`mouse ${event.button} button pressed`); + break; + case 'Enter': + console.log( + `mouse hovered tray at ${event.rect.position.x}, ${event.rect.position.y}` + ); + break; + case 'Move': + console.log( + `mouse moved on tray at ${event.rect.position.x}, ${event.rect.position.y}` + ); + break; + case 'Leave': + console.log( + `mouse left tray at ${event.rect.position.x}, ${event.rect.position.y}` + ); + break; + } + }, +}; + +const tray = await TrayIcon.new(options); +``` + +See [`TrayIconEvent`][js TrayIconEvent] for more information on the event payload. + + + + + +```rust +use tauri::{ + Manager, + tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent} +}; + +TrayIconBuilder::new() + .on_tray_icon_event(|tray, event| match event { + TrayIconEvent::Click { + button: MouseButton::Left, + button_state: MouseButtonState::Up, + .. + } => { + println!("left click pressed and released"); + // in this example, let's show and focus the main window when the tray is clicked + let app = tray.app_handle(); + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.set_focus(); + } + } + _ => { + println!("unhandled event {event:?}"); + } + }) +``` + +See [`TrayIconEvent`][rust TrayIconEvent] for more information on the event type. + + + + +[`TrayIcon.new`]: /reference/javascript/api/namespacetray/#new +[`TrayIconOptions`]: /reference/javascript/api/namespacetray/#trayiconoptions +[`TrayIconBuilder`]: https://docs.rs/tauri/2.0.0/tauri/tray/struct.TrayIconBuilder.html +[TrayIconBuilder::menu_on_left_click]: https://docs.rs/tauri/2.0.0/tauri/tray/struct.TrayIconBuilder.html#method.menu_on_left_click +[`menuOnLeftClick`]: /reference/javascript/api/namespacetray/#properties-1 +[`TrayIconBuilder::on_menu_event`]: https://docs.rs/tauri/2.0.0/tauri/tray/struct.TrayIconBuilder.html#method.on_menu_event +[js TrayIconEvent]: /reference/javascript/api/namespacetray/#trayiconevent +[rust TrayIconEvent]: https://docs.rs/tauri/2.0.0/tauri/tray/enum.TrayIconEvent.html diff --git a/src/content/docs/plugin/updater.mdx b/Source/content/docs/plugin/updater.mdx similarity index 100% rename from src/content/docs/plugin/updater.mdx rename to Source/content/docs/plugin/updater.mdx diff --git a/src/content/docs/plugin/upload.mdx b/Source/content/docs/plugin/upload.mdx similarity index 100% rename from src/content/docs/plugin/upload.mdx rename to Source/content/docs/plugin/upload.mdx diff --git a/src/content/docs/plugin/websocket.mdx b/Source/content/docs/plugin/websocket.mdx similarity index 100% rename from src/content/docs/plugin/websocket.mdx rename to Source/content/docs/plugin/websocket.mdx diff --git a/Source/content/docs/plugin/window-customization.mdx b/Source/content/docs/plugin/window-customization.mdx new file mode 100644 index 0000000000..3111c07879 --- /dev/null +++ b/Source/content/docs/plugin/window-customization.mdx @@ -0,0 +1,265 @@ +--- +title: Window Customization +sidebar: + order: 1 +tableOfContents: + maxHeadingLevel: 4 +--- + +import { Icon } from '@astrojs/starlight/components'; + +Tauri provides lots of options for customizing the look and feel of your app's window. You can create custom titlebars, have transparent windows, enforce size constraints, and more. + +## Configuration + +There are three ways to change the window configuration: + +- [Through + tauri.conf.json](/reference/config/#windowconfig) +- [Through the JavaScript + API](/reference/javascript/api/namespacewindow/#window) +- [Through the Window in + Rust](https://docs.rs/tauri/2.0.0/tauri/window/struct.Window.html) + +## Usage + +- [Creating a Custom Titlebar](#creating-a-custom-titlebar) +- [(macOS) Transparent Titlebar with Custom Window Background Color](#macos-transparent-titlebar-with-custom-window-background-color) + +### Creating a Custom Titlebar + +A common use of these window features is creating a custom titlebar. This short tutorial will guide you through that process. + +:::note +For macOS, using a custom titlebar will also lose some features provided by the system, such as [moving or aligning the window](https://support.apple.com/guide/mac-help/work-with-app-windows-mchlp2469/mac). Another approach to customizing the titlebar but keeping native functions could be making the titlebar transparent and setting the window background color. See the usage [(macOS) Transparent Titlebar with Custom Window Background Color](#macos-transparent-titlebar-with-custom-window-background-color). +::: + +#### tauri.conf.json + +Set `decorations` to `false` in your `tauri.conf.json`: + +```json title="tauri.conf.json" {4} +"tauri": { + "windows": [ + { + "decorations": false + } + ] +} +``` + +#### Permissions + +Add window permissions in capability file. + +By default, all plugin commands are blocked and cannot be accessed. You must define a list of permissions in your `capabilities` configuration. + +See the [Capabilities Overview](/security/capabilities/) for more information and the [step by step guide](/learn/security/using-plugin-permissions/) to use plugin permissions. + +```json title="src-tauri/capabilities/default.json" ins={6} +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "main-capability", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": ["core:window:default", "core:window:allow-start-dragging"] +} +``` + +| Permission | Description | +| -------------------------------------------- | ------------------------------------------------------------------------------ | +| `core:window:default` | Default permissions for the plugin. Except `window:allow-start-dragging`. | +| `core:window:allow-close` | Enables the close command without any pre-configured scope. | +| `core:window:allow-minimize` | Enables the minimize command without any pre-configured scope. | +| `core:window:allow-start-dragging` | Enables the start_dragging command without any pre-configured scope. | +| `core:window:allow-toggle-maximize` | Enables the toggle_maximize command without any pre-configured scope. | +| `core:window:allow-internal-toggle-maximize` | Enables the internal_toggle_maximize command without any pre-configured scope. | + +#### CSS + +Add this CSS sample to keep it at the top of the screen and style the buttons: + +```css +.titlebar { + height: 30px; + background: #329ea3; + user-select: none; + display: flex; + justify-content: flex-end; + position: fixed; + top: 0; + left: 0; + right: 0; +} +.titlebar-button { + display: inline-flex; + justify-content: center; + align-items: center; + width: 30px; + height: 30px; + user-select: none; + -webkit-user-select: none; +} +.titlebar-button:hover { + background: #5bbec3; +} +``` + +#### HTML + +Put this at the top of your `` tag: + +```html +
+
+ minimize +
+
+ maximize +
+
+ close +
+
+``` + +Note that you may need to move the rest of your content down so that the titlebar doesn't cover it. + +#### JavaScript + +Use this code snippet to make the buttons work: + +```javascript +import { getCurrentWindow } from '@tauri-apps/api/window'; + +// when using `"withGlobalTauri": true`, you may use +// const { getCurrentWindow } = window.__TAURI__.window; + +const appWindow = getCurrentWindow(); + +document + .getElementById('titlebar-minimize') + ?.addEventListener('click', () => appWindow.minimize()); +document + .getElementById('titlebar-maximize') + ?.addEventListener('click', () => appWindow.toggleMaximize()); +document + .getElementById('titlebar-close') + ?.addEventListener('click', () => appWindow.close()); +``` + +Note that if you are using a Rust-based frontend, you can copy the code above into a `