Skip to content

Commit

Permalink
docs: getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed May 25, 2024
1 parent 733a690 commit 7f670a1
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/.vitepress/config/zh.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const zh = defineConfig({
items: [
{ text: '介绍', link: '/zh/documentation/getting-started/introduction' },
{ text: '安装', link: '/zh/documentation/getting-started/installation' },
{ text: '启动', link: '/zh/documentation/getting-started/launch' },
{ text: '启动应用', link: '/zh/documentation/getting-started/launch' },
]
},
{
Expand Down
55 changes: 55 additions & 0 deletions docs/docs/documentation/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Installation

::: info
When this page was written, the latest Avalonia version was `11.1.0-beta2` with SukiUI version `6.0.0-beta6`
:::

SukiUI can be installed in two ways:
- [Nuget](https://www.nuget.org/packages/SukiUI) **Recommended**
- CI Artifacts from [Github Action](https://github.com/kikipoulet/SukiUI/actions/workflows/build.yml)

## Prepare your application

The following picture shows packages already installed with the default `Avalonia Template`:

![](/getting-started/introduction-default-package-list.webp "default package list")

In these packages, `Avalonia.Themes.Fluent` will no longer be necessary and can be removed.

::: tip
About `Avalonia Template`: [Set up an editor](https://docs.avaloniaui.net/docs/get-started/set-up-an-editor)
:::

## Install latest SukiUI package

The Nuget installation is suitable for most users, but if you want to use the latest build, you can download the dll from Github Action after the automatic build.

### Via Nuget

```
dotnet add package SukiUI --version 6.0.0
```

::: tip
Visit [SukiUI on Nuget](https://www.nuget.org/packages/SukiUI) for more information
:::

### Via Github Action

1. Visit [SukiUI CI](https://github.com/kikipoulet/SukiUI/actions/workflows/build.yml)
2. Select the latest workflow
![](/getting-started/introduction-workflow.webp "workflow")

3. Download the artifact
![](/getting-started/introduction-artifact.webp "artifact")

4. Add reference
![](/getting-started/introduction-reference.webp "reference")

5. Select `SukiUI.dll` you downloaded

::: tip
The package list should be:

![](/getting-started/introduction-final-package-list.webp "package list")
:::
82 changes: 82 additions & 0 deletions docs/docs/documentation/getting-started/launch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Launch

## Modify your App.axaml

Include SukiUI styles in your `App.axaml`

```xml
<Application
...
xmlns:sukiUi="clr-namespace:SukiUI;assembly=SukiUI" // [!code highlight]
>
<Application.Styles>
<sukiUi:SukiTheme ThemeColor="Blue" /> // [!code highlight]
</Application.Styles>
</Application>
```

## Use SukiWindow as MainWindow

Change MainWindow from Window class to SukiWindow class.

Original `MainWindow.axaml`:

```xml
<Window
x:Class="SukiTest.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Window>
```

Modified `MainWindow.axaml`:

```xml
<sukiUi:SukiWindow // [!code highlight]
x:Class="SukiTest.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:sukiUi="clr-namespace:SukiUI.Controls;assembly=SukiUI" // [!code highlight]
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</sukiUi:SukiWindow> // [!code highlight]
```

Original `MainWindow.axaml.cs`:

```csharp
using Avalonia.Controls;

namespace SukiTest;

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
```

Modified `MainWindow.axaml.cs`:


```csharp
using SukiUI.Controls; // [!code highlight]
namespace SukiTest;

public partial class MainWindow : SukiWindow // [!code highlight]
{
public MainWindow()
{
InitializeComponent();
}
}
```

## Done

You're now ready to use SukiUI !
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
55 changes: 55 additions & 0 deletions docs/docs/zh/documentation/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 安装

::: info
写完本篇时,Avalonia 的版本是 `11.1.0-beta2` ,SukiUI 的版本是 `6.0.0-beta6`
:::

SukiUI 可以通过以下两种方式安装:
- [Nuget](https://www.nuget.org/packages/SukiUI) **推荐**
-[Github Action](https://github.com/kikipoulet/SukiUI/actions/workflows/build.yml) 获取 CI 构建后的 `.dll`

## 准备工作

以下是 `Avalonia Template` 项目创建后,默认的包列表:

![](/getting-started/introduction-default-package-list.webp "default package list")

在这些包中,`Avalonia.Themes.Fluent` 可以被删除

::: tip
有关 `Avalonia Template`: [设置编辑器](https://docs.avaloniaui.net/zh-Hans/docs/get-started/set-up-an-editor)
:::

## 安装最新的 SukiUI

对于大多数用户来说,通过 Nuget 安装是不错的选择;但如果你想体验最新构建的功能,请从 Github Action 中下载构建

### 通过 Nuget 安装

```
dotnet add package SukiUI --version 6.0.0
```

::: tip
访问 [SukiUI on Nuget](https://www.nuget.org/packages/SukiUI) 获取更多信息
:::

### 通过 Github Action 安装

1. 访问 [SukiUI CI](https://github.com/kikipoulet/SukiUI/actions/workflows/build.yml)
2. 选择最后一个`workflow`
![](/getting-started/introduction-workflow.webp "workflow")

3. 下载
![](/getting-started/introduction-artifact.webp "artifact")

4. 在项目中添加引用
![](/getting-started/introduction-reference.webp "reference")

5. 选择刚刚下载的 `SukiUI.dll` 并添加

::: tip
最终,你的包列表应为:

![](/getting-started/introduction-final-package-list.webp "package list")
:::
80 changes: 80 additions & 0 deletions docs/docs/zh/documentation/getting-started/launch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# 启动应用

## 修改 App.axaml

`App.axaml``Styles` 中添加 `SukiTheme`

```xml
<Application
...
xmlns:sukiUi="clr-namespace:SukiUI;assembly=SukiUI" // [!code highlight]
>
<Application.Styles>
<sukiUi:SukiTheme ThemeColor="Blue" /> // [!code highlight]
</Application.Styles>
</Application>
```

## 将 MainWindow 更改为 SukiWindow

原来的 `MainWindow.axaml`:

```xml
<Window
x:Class="SukiTest.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Window>
```

修改后的 `MainWindow.axaml`:

```xml
<sukiUi:SukiWindow // [!code highlight]
x:Class="SukiTest.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:sukiUi="clr-namespace:SukiUI.Controls;assembly=SukiUI" // [!code highlight]
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</sukiUi:SukiWindow> // [!code highlight]
```

原来的 `MainWindow.axaml.cs`:

```csharp
using Avalonia.Controls;

namespace SukiTest;

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
```

修改后的 `MainWindow.axaml.cs`:


```csharp
using SukiUI.Controls; // [!code highlight]
namespace SukiTest;

public partial class MainWindow : SukiWindow // [!code highlight]
{
public MainWindow()
{
InitializeComponent();
}
}
```

## 完成

至此,SukiUI 安装完成

0 comments on commit 7f670a1

Please sign in to comment.