Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add initial docs #54

Merged
merged 28 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1354b6c
docs: add VitePress docs project
Xzelsius Jul 16, 2024
a9072fb
docs: add home page
Xzelsius Jul 16, 2024
a72f3d1
docs: add compatability page
Xzelsius Jul 16, 2024
66bd2a5
docs: add packages page
Xzelsius Jul 16, 2024
791fc02
docs: add empty getting started page
Xzelsius Jul 16, 2024
aefed44
feat: add component to indicate a build has docs
Xzelsius Jul 19, 2024
c25f22a
feat: add component to indicate a build has docs artifacts
Xzelsius Jul 19, 2024
dc9ba57
feat: add targets to setup and build a VitePress site
Xzelsius Jul 19, 2024
e6a6ab7
chore: add docs target
Xzelsius Jul 19, 2024
6189665
chore: add build and publish jobs for docs
Xzelsius Jul 19, 2024
d2ab4a8
fix: invalid link in docs
Xzelsius Jul 19, 2024
9f56abd
fix: use node 20 lts
Xzelsius Jul 19, 2024
67f7604
chore: configure indentation for JS/TS and CSS
Xzelsius Jul 19, 2024
d747924
chore: add eslint and format workspace
Xzelsius Jul 19, 2024
ea7dd29
fix: link to repository
Xzelsius Sep 1, 2024
4bc4b2e
refactor: reword "we" with "I"
Xzelsius Sep 1, 2024
3c02243
docs: add page for pull requests
Xzelsius Sep 1, 2024
6db2f6b
docs: add page for bug reports
Xzelsius Sep 1, 2024
10d9b66
docs: add page for feature requests
Xzelsius Sep 1, 2024
3632a80
docs: add page for renovate
Xzelsius Sep 1, 2024
73d0f58
docs: add page for repository structure
Xzelsius Sep 1, 2024
d5af8c3
docs: update navigation
Xzelsius Sep 1, 2024
5965002
docs: improve renovate docs
Xzelsius Sep 24, 2024
089a69c
docs: improve packages docs
Xzelsius Sep 24, 2024
1ff604d
style: fix code style in vitepress EN config
Xzelsius Sep 24, 2024
48b12ac
docs: add page about coding guidelines
Xzelsius Sep 24, 2024
e141409
docs: move code guidelines to contributing section
Xzelsius Sep 24, 2024
538bcf9
style: add missing file headers
Xzelsius Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ indent_size = 2
indent_size = 2
end_of_line = lf

# JS and TS files
[*.{js,ts}]
indent_size = 2

# CSS files
[*.css]
indent_size = 2

# C# Source files
[*.cs]
indent_size = 4
Expand Down
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>xzelsius/renovate-config:github-actions",
"github>xzelsius/renovate-config:dotnet"
"github>xzelsius/renovate-config:dotnet",
"github>xzelsius/renovate-config:npm"
]
}
72 changes: 70 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages'

jobs:
build:
build-packages:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -59,9 +59,57 @@ jobs:
path: ${{ github.workspace }}/artifacts/packages
if-no-files-found: error

build-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: NPM Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/iron'

- name: NuGet Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: |
${{ env.NUGET_PACKAGES }}
.nuke/temp
key: ${{ runner.os }}-nuget-${{ hashFiles('**/global.json', '**/*.csproj', '**/*.props') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4

- name: Restore .NET Tools
run: |
dotnet tool restore

- name: Build Docs
run: |
dotnet nuke Docs

- name: Upload Docs
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.workspace }}/artifacts/docs

publish-packages:
runs-on: ubuntu-latest
needs: [build]
needs: [build-packages]

# Only publish if build was triggered for a tag
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -91,3 +139,23 @@ jobs:
--nuget-api-key $NUGET_API_KEY
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

publish-docs:
runs-on: ubuntu-latest
needs: [build-docs]

# Only publish if build was triggered for a tag
if: startsWith(github.ref, 'refs/tags/v')

permissions:
pages: write # to deploy to pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deployment
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ Icon
.nuke/temp/
artifacts/

#================================
# Docs
#================================

docs/.vitepress/cache

#================================
# Others
#================================
10 changes: 8 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"CreateAfterReleasePullRequest",
"CreateRelease",
"Default",
"Docs",
"DotNetBuild",
"DotNetPack",
"DotNetPush",
Expand All @@ -119,7 +120,9 @@
"Pack",
"Publish",
"ShipPublicApis",
"Test"
"Test",
"VitePressBuild",
"VitePressInstall"
]
}
},
Expand All @@ -141,6 +144,7 @@
"CreateAfterReleasePullRequest",
"CreateRelease",
"Default",
"Docs",
"DotNetBuild",
"DotNetPack",
"DotNetPush",
Expand All @@ -151,7 +155,9 @@
"Pack",
"Publish",
"ShipPublicApis",
"Test"
"Test",
"VitePressBuild",
"VitePressInstall"
]
}
},
Expand Down
10 changes: 10 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vitepress';
import { shared } from './shared';
import { en } from './en';

export default defineConfig({
...shared,
locales: {
root: { label: 'English', ...en },
},
});
83 changes: 83 additions & 0 deletions docs/.vitepress/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { type DefaultTheme, defineConfig } from 'vitepress';

export const en = defineConfig({
lang: 'en-US',
description: 'A lightweight development kit built to help developing applications using .NET',

themeConfig: {
nav: nav(),

sidebar: {
'/guide/': {
base: '/guide/',
items: guideSidebar(),
},
'/contributing/': {
base: '/contributing/',
items: contributingSidebar(),
},
},

editLink: {
pattern: 'https://github.com/Xzelsius/Ayaka/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © Raphael Strotz. All rights reserved.',
},
},
});

function nav(): DefaultTheme.NavItem[] {
return [
{
text: 'Guide',
link: '/guide/getting-started',
activeMatch: '/guide/',
},
{
text: 'Contributing',
link: '/contributing/sources',
activeMatch: '/contributing/',
},
];
}

function guideSidebar(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Guide',
collapsed: false,
items: [
{ text: 'Getting started', link: 'getting-started' },
{ text: 'Packages', link: 'packages' },
{ text: 'Compatibility', link: 'compatibility' },
],
},
];
}

function contributingSidebar(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Overview',
collapsed: false,
items: [
{ text: 'Sources', link: 'sources' },
{ text: 'Renovate', link: 'renovate' },
],
},
{
text: 'Contributing',
collapsed: false,
items: [
{ text: 'Code Guidelines', link: 'code-guidelines' },
{ text: 'Bug Reports', link: 'bug-reports' },
{ text: 'Feature Requests', link: 'feature-requests' },
{ text: 'Pull Requests', link: 'pull-requests' },
],
},
];
}
28 changes: 28 additions & 0 deletions docs/.vitepress/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'vitepress';

export const shared = defineConfig({
title: 'Ayaka',

base: '/ayaka/',

rewrites: {
'en/:rest*': ':rest*',
},

lastUpdated: true,
cleanUrls: true,
metaChunk: true,

themeConfig: {
logo: {
dark: '/logo-white.svg',
light: '/logo-black.svg',
width: 24,
height: 24,
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/Xzelsius/Ayaka' },
],
},
});
6 changes: 6 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
--vp-c-brand-1: var(--vp-c-green-1);
--vp-c-brand-2: var(--vp-c-green-2);
--vp-c-brand-3: var(--vp-c-green-3);
--vp-c-brand-soft: var(--vp-c-green-soft);
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme';
import './custom.css';

export default DefaultTheme;
17 changes: 17 additions & 0 deletions docs/en/contributing/bug-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Bug Reports

A bug is a demonstrable problem that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!

## Guidelines

When creating a bug report, please follow these guidelines:

1. Check if the issue has already been reported — [Issues]
2. Check if the issue has been fixed — Try to reproduce it using the latest `main` branch
3. Isolate the problem
4. Submit using the `Bug report` template — [Submit a Bug report]

A good bug report shouldn't leave other needing to chase you up for more information. Please try to be as detailed as possible in your report.

[Issues]: https://github.com/Xzelsius/Ayaka/issues
[Submit a bug report]: https://github.com/Xzelsius/Ayaka/issues/new?template=bug_report.yml
Loading