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

feat(docs): port docs to starlight #2315

Merged
merged 94 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a6d3a26
wip port to starlight
Noxsios Feb 20, 2024
67a7e77
fix netlify
Noxsios Feb 20, 2024
a66d197
fmt
Noxsios Feb 20, 2024
9446382
raw file imports via vite
Noxsios Feb 20, 2024
9ca29fa
more fixes
Noxsios Feb 20, 2024
f6907a6
Merge branch 'main' into docs-next
Racer159 Feb 20, 2024
04faab8
content
Noxsios Feb 21, 2024
556b5f4
slightly prettier properties table
Noxsios Feb 21, 2024
4e741db
wip
Noxsios Mar 6, 2024
b82d69e
Merge branch 'main' into docs-next
Noxsios Mar 6, 2024
ea0e295
file moves
Noxsios Mar 6, 2024
97a17fc
remove old docs site
Noxsios Mar 6, 2024
96c2f85
update readme
Noxsios Mar 6, 2024
52a9a15
move from docs-next to site
Noxsios Mar 6, 2024
32f7be7
fix netlify
Noxsios Mar 6, 2024
7172e30
more porting
Noxsios Mar 6, 2024
44d97aa
rename all docs to mdx for consistency
Noxsios Mar 17, 2024
aa643d2
wip
Noxsios Mar 20, 2024
b902ee2
progress
Noxsios Mar 22, 2024
25467cc
progress
Noxsios Mar 22, 2024
b07cb4a
progress
Noxsios Mar 22, 2024
db0ecf5
progress
Noxsios Mar 22, 2024
31343b9
fixing images
Noxsios Mar 22, 2024
dd0a9e3
try stronger autogen for examples
Noxsios Mar 23, 2024
e6b4b46
theme colors
Noxsios Mar 24, 2024
fac700e
collapse
Noxsios Mar 24, 2024
e14028a
update tools
Noxsios Mar 24, 2024
3e142b4
mermaid
Noxsios Mar 24, 2024
bf4c2fd
fix linking on cli gen md
Noxsios Mar 24, 2024
92ca59b
details and header linking
Noxsios Mar 24, 2024
1649477
cleanup
Noxsios Mar 24, 2024
66063d4
tweak
Noxsios Mar 24, 2024
75da91f
whoops
Noxsios Mar 24, 2024
aaaccb1
update install docs
Noxsios Mar 24, 2024
dbe4101
update install docs
Noxsios Mar 24, 2024
4dc2cff
update install docs
Noxsios Mar 25, 2024
afaafe5
links
Noxsios Mar 25, 2024
4d04d52
links
Noxsios Mar 25, 2024
9df71a9
links
Noxsios Mar 26, 2024
054e593
links
Noxsios Mar 26, 2024
f6a144f
links
Noxsios Mar 27, 2024
2bec745
links
Noxsios Mar 28, 2024
a697280
update deps
Noxsios Mar 28, 2024
bdd47c6
dont validate just yet
Noxsios Mar 28, 2024
d3a7df6
variables
Noxsios Mar 28, 2024
f370740
fix variables page
Noxsios Mar 28, 2024
93168a7
move git docs to a better location
Noxsios Mar 29, 2024
7ce2cd4
migrate more examples
Noxsios Mar 29, 2024
071bd06
links
Noxsios Mar 29, 2024
3786d36
links
Noxsios Mar 29, 2024
41091ee
links
Noxsios Mar 29, 2024
561dbb6
Merge branch 'main' into docs-next
Noxsios Mar 29, 2024
2c139e3
docs and schema
Noxsios Mar 29, 2024
b7b2fb9
sidebar odering
Noxsios Mar 29, 2024
390dc69
remove link checker
Noxsios Mar 29, 2024
223bc5d
fix examples overview
Noxsios Mar 29, 2024
04bd07d
add yq to docs
Noxsios Mar 29, 2024
5a1bdbc
add yq to docs
Noxsios Mar 29, 2024
227040b
update docs
Noxsios Mar 29, 2024
401bc12
update docs
Noxsios Mar 29, 2024
dfe54cb
update docs
Noxsios Mar 29, 2024
ecc51f8
lint
Noxsios Mar 29, 2024
7cf8491
cleanup
Noxsios Mar 29, 2024
e532bb3
cleanup
Noxsios Mar 30, 2024
d3223d9
add adr
Noxsios Mar 30, 2024
b952faa
reduce
Noxsios Mar 30, 2024
d032b00
cleanup
Noxsios Mar 30, 2024
753d722
add overview link
Noxsios Apr 1, 2024
9bdba07
Merge branch 'main' into docs-next
Noxsios Apr 4, 2024
8e0a639
restore workflows
Noxsios Apr 4, 2024
6c0d61d
Merge branch 'main' into docs-next
Noxsios Apr 5, 2024
d0b4e4b
cleanup
Noxsios Apr 5, 2024
e6f5a74
Merge branch 'main' into docs-next
Noxsios Apr 6, 2024
17bec39
fix links
Noxsios Apr 8, 2024
3c0d1bf
add emoji support
Noxsios Apr 8, 2024
0cd166f
fix remediation callouts
Noxsios Apr 8, 2024
9531da7
prevent quote escaping in example yaml
Noxsios Apr 8, 2024
a34d78d
update longhorn example
Noxsios Apr 8, 2024
f0efeaf
cleanup
Noxsios Apr 9, 2024
29d5d81
Update examples/big-bang/zarf.yaml
Noxsios Apr 9, 2024
e63a38f
Update examples/kiwix/zarf.yaml
Noxsios Apr 9, 2024
3f9cbb6
Update examples/argocd/zarf.yaml
Noxsios Apr 9, 2024
79cbefc
Update examples/podinfo-flux/zarf.yaml
Noxsios Apr 9, 2024
8b939e1
pin node engine version
Noxsios Apr 9, 2024
9148567
fix persisten flags in docs
Noxsios Apr 9, 2024
4ef24a6
Update examples/longhorn/zarf.yaml
Noxsios Apr 9, 2024
5e850bd
Update examples/git-data/zarf.yaml
Noxsios Apr 9, 2024
ab05a01
update roadmap
Noxsios Apr 9, 2024
0c9176a
update slack ref
Noxsios Apr 9, 2024
b822023
Merge branch 'main' into docs-next
Noxsios Apr 9, 2024
446c556
Merge branch 'main' into docs-next
Noxsios Apr 9, 2024
3bc7ac3
this works
Noxsios Apr 9, 2024
0d57d1a
Merge branch 'main' into docs-next
Noxsios Apr 9, 2024
2f9301b
Merge branch 'main' into docs-next
Noxsios Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
!.env.example
.DS_Store
.env
.env.*
.idea/
.image-cache/
.scratch/
.svelte-kit
.terraform.lock.hcl
.tool-versions
.vagrant
.vscode/
Expand All @@ -22,18 +16,11 @@
*.vbox
*.zst
*.zim
assets/
build
data/
dist/
node_modules
playwright-report/
playwright/.cache/
test-results/
zarf
zarf-pki
zarf-sbom/
*.part*
test-*.txt
__debug_bin
docs-website/static/zarf.schema.json
22 changes: 22 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Disable some built-in rules
"config": {
"first-line-heading": false,
"line-length": false,
"single-h1": true,
"hr-style": false,
"no-trailing-punctuation": false,
"code-block-style": false,
"no-inline-html": false
},
// Define glob expressions to use (only valid at root)
"globs": [
"**/*.mdx",
"../**/*.md"
],
"ignores": [
"**/node_modules/**",
"src/content/docs/commands/*.md",
"site/src/content/docs/commands/*.md"
]
}
5 changes: 0 additions & 5 deletions .markdownlint.json

This file was deleted.

1 change: 0 additions & 1 deletion .markdownlintignore

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Our E2E tests can be found in the `/test` folder and follow the journey of someo
Our Unit tests can be found as `*_test.go` files inside the package that they are designed to test. These are also run in CI and are designed to test small functions with clear interfaces that would be difficult to test otherwise. As a general rule, we are limiting unit tests to the `src/pkg/*` folder.

All of our tests should be able to be run locally or in CI.
You can learn more about the testing of Zarf [here](docs/12-contribute-to-zarf/2-testing.md).
You can learn more about the testing of Zarf [here](https://docs.zarf.dev/contribute/testing).

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ build-cli-linux: build-cli-linux-amd build-cli-linux-arm ## Build the Zarf CLI f
build-cli: build-cli-linux-amd build-cli-linux-arm build-cli-mac-intel build-cli-mac-apple build-cli-windows-amd build-cli-windows-arm ## Build the CLI

docs-and-schema: ## Generate the Zarf Documentation and Schema
hack/gen-cli-docs.sh
ZARF_CONFIG=hack/empty-config.toml go run main.go internal gen-cli-docs
ZARF_CONFIG=hack/empty-config.toml hack/create-zarf-schema.sh

lint-packages-and-examples: build ## Recursively lint all zarf.yaml files in the repo except for those dedicated to tests
hack/lint_all_zarf_packages.sh $(ZARF_BIN)
hack/lint-all-zarf-packages.sh $(ZARF_BIN)

# INTERNAL: a shim used to build the agent image only if needed on Windows using the `test` command
init-package-local-agent:
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Zarf Documentation Status](https://api.netlify.com/api/v1/badges/fe846ae4-25fb-4274-9968-90782640ee9f/deploy-status)](https://app.netlify.com/sites/zarf-docs/deploys)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf/badge)](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf)

<img align="right" alt="zarf logo" src=".images/zarf-logo.png" height="256" />
<img align="right" alt="zarf logo" src="site/src/assets/zarf-logo.png" height="256" />

[![Zarf Website](https://img.shields.io/badge/web-zarf.dev-6d87c3)](https://zarf.dev/)
[![Zarf Documentation](https://img.shields.io/badge/docs-docs.zarf.dev-775ba1)](https://docs.zarf.dev/)
Expand All @@ -30,69 +30,69 @@ Zarf eliminates the [complexity of air gap software delivery](https://www.itopst
## 📦 Out of the Box Features

- Automate Kubernetes deployments in disconnected environments
- Automate [Software Bill of Materials (SBOM)](https://docs.zarf.dev/docs/create-a-zarf-package/package-sboms) generation
- Build and [publish packages as OCI image artifacts](https://docs.zarf.dev/docs/zarf-tutorials/publish-and-deploy)
- Provide a [web dashboard](https://docs.zarf.dev/docs/deploy-a-zarf-package/view-sboms) for viewing SBOM output
- Automate [Software Bill of Materials (SBOM)](https://docs.zarf.dev/ref/sboms/) generation
- Build and [publish packages as OCI image artifacts](https://docs.zarf.dev/tutorials/publish-and-deploy)
- Provide a [web dashboard](https://docs.zarf.dev/ref/sboms/#the-sbom-viewer) for viewing SBOM output
- Create and verify package signatures with [cosign](https://github.com/sigstore/cosign)
- [Publish](https://docs.zarf.dev/docs/the-zarf-cli/cli-commands/zarf_package_publish), [pull](https://docs.zarf.dev/docs/the-zarf-cli/cli-commands/zarf_package_pull), and [deploy](https://docs.zarf.dev/docs/the-zarf-cli/cli-commands/zarf_package_deploy) packages from an [OCI registry](https://opencontainers.org/)
- Powerful component lifecycle [actions](https://docs.zarf.dev/docs/create-a-zarf-package/component-actions)
- [Publish](https://docs.zarf.dev/commands/zarf_package_publish), [pull](https://docs.zarf.dev/commands/zarf_package_pull), and [deploy](https://docs.zarf.dev/commands/zarf_package_deploy) packages from an [OCI registry](https://opencontainers.org/)
- Powerful component lifecycle [actions](https://docs.zarf.dev/ref/actions)
- Deploy a new cluster while fully disconnected with [K3s](https://k3s.io/) or into any existing cluster using a [kube config](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
- Builtin logging stack with [Loki](https://grafana.com/oss/loki/)
- Built-in Git server with [Gitea](https://gitea.io/en-us/)
- Built-in Docker registry
- Builtin [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal
- [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references
- Builtin [command to find images](https://docs.zarf.dev/docs/the-zarf-cli/cli-commands/zarf_dev_find-images) and resources from a Helm chart
- Tunneling capability to [connect to Kubernetes resources](https://docs.zarf.dev/docs/the-zarf-cli/cli-commands/zarf_connect) without network routing, DNS, TLS or Ingress configuration required
- Builtin [command to find images](https://docs.zarf.dev/commands/zarf_dev_find-images) and resources from a Helm chart
- Tunneling capability to [connect to Kubernetes resources](https://docs.zarf.dev/commands/zarf_connect) without network routing, DNS, TLS or Ingress configuration required

## 🛠️ Configurable Features

- Customizable [variables and package templates](https://docs.zarf.dev/examples/variables/) with defaults and user prompting
- [Composable packages](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-components#composing-package-components) to include multiple sub-packages/components
- Customizable [variables and package templates](https://docs.zarf.dev/ref/variables/) with defaults and user prompting
- [Composable packages](https://docs.zarf.dev/ref/components/#component-imports) to include multiple sub-packages/components
- Component-level OS/architecture filtering

## Demo

[![preview](.images/zarf-v0.21-preview.gif)](https://www.youtube.com/watch?v=WnOYlFVVKDE)
[![preview](./site/src/assets/zarf-v0.21-preview.gif)](https://www.youtube.com/watch?v=WnOYlFVVKDE)

_<https://www.youtube.com/watch?v=WnOYlFVVKDE>_

## ✅ Getting Started

To try Zarf out for yourself, visit the ["Try It Now"](https://zarf.dev/install) section on our website.
Follow the instructions at <https://docs.zarf.dev/getting-started/>.

To learn more about Zarf and its use cases, visit [docs.zarf.dev](https://docs.zarf.dev/docs/zarf-overview). From the docs, you can learn more about:
To discover more about Zarf and explore its features, please visit [docs.zarf.dev](https://docs.zarf.dev/). The documentation offers in-depth insights on:

- [installation](https://docs.zarf.dev/docs/getting-started/#installing-zarf)
- [using the CLI](https://docs.zarf.dev/docs/the-zarf-cli/),
- [making packages](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-packages/),
- [Zarf package schema](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-schema).
- [installation](https://docs.zarf.dev/getting-started/install)
- [packages](https://docs.zarf.dev/ref/packages)
- [components](https://docs.zarf.dev/ref/components)
- [actions](https://docs.zarf.dev/ref/actions)
- [variables](https://docs.zarf.dev/ref/variables)
- [SBOMs](https://docs.zarf.dev/ref/sboms)
- and more!

Using Zarf in GitHub workflows? Check out the [setup-zarf](https://github.com/defenseunicorns/setup-zarf) action. Install any version of Zarf and its `init` package with zero added dependencies.

## 🫶 Our Community

Join our community and developers on the [#Zarf slack](https://zarf.dev/slack) hosted on K8s slack. Our active community of developers, users, and contributors are available to answer questions, share examples, and find new ways use Zarf together!
Join us on the [Kubernetes Slack](https://kubernetes.slack.com/) in the [_#zarf_](https://kubernetes.slack.com/archives/C03B6BJAUJ3) channel or the [_#zarf-dev_](https://kubernetes.slack.com/archives/C03BP9Z3CMA) channel! Our active community of developers, users, and contributors are available to answer questions, share examples, and find new ways use Zarf together!

We are so grateful to our Zarf community for contributing bug fixes and collaborating on new features:

<a href="https://github.com/defenseunicorns/zarf/graphs/contributors">
<img src="https://contrib.rocks/image?repo=defenseunicorns/zarf" />
<img src="https://contrib.rocks/image?repo=defenseunicorns/zarf" alt="Zarf contributors" />
</a>

Made with [contrib.rocks](https://contrib.rocks).

## 💻 Contributing

Want to contribute to Zarf?
Check out our [Contributor Guide](https://docs.zarf.dev/docs/contribute-to-zarf/contributor-guide) to learn more about how to set up your development environment and begin contributing.
Check out our [Contributor Guide](https://docs.zarf.dev/contribute-to-zarf/contributor-guide) to learn more about how to set up your development environment and begin contributing.
We also recommend checking out our architectural diagram.

To dive deeper into the tech, you can read the [Nerd Notes](https://docs.zarf.dev/docs/contribute-to-zarf/nerd-notes) in our Docs.
To dive deeper into the tech, you can read the [Nerd Notes](https://docs.zarf.dev/contribute-to-zarf/nerd-notes) in our Docs.

![Architecture Diagram](./docs/.images/architecture.drawio.svg)

[Source DrawIO](docs/.images/architecture.drawio.svg)
![Architecture Diagram](./site/public/architecture.drawio.svg)

## ⭐️ Special Thanks

Expand Down
76 changes: 76 additions & 0 deletions adr/0024-starlight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 24. Migrate documentation to Starlight

Date: 2024-03-30

## Status

Accepted

## Context

The current documentation site is built with Docusaurus 2. While Docusaurus has served us well, it has some limitations, primarily around performance and dependency management.

### Proposed Solutions

1. [**Starlight**](https://starlight.astro.build/) is a new documentation site generator that is built with performance in mind. It is a lightweight, fast, and flexible static site generator powered by [Astro](https://astro.build) that is designed to be easy to use and extend.

- **Pros**:
- Fast performance.
- Easy to extend with custom components in any framework.
- Built-in support for MDX.
- Simplified build process.
- Better control over dependencies.
- Client-side static site search built-in.
- Excellent default theme.
- **Cons**:
- Newer project with a smaller ecosystem compared to others.
bdfinst marked this conversation as resolved.
Show resolved Hide resolved
- Much fewer plugins and themes available compared to other static site generators.
- Only absolute URLs are supported for cross-site links (relative image URLs are supported).

2. [**Hugo**](https://gohugo.io/): is another popular static site generator that is known for its speed and flexibility. It is written in Go and has a large ecosystem of themes and plugins.
bdfinst marked this conversation as resolved.
Show resolved Hide resolved

- **Pros**:
- Fast performance.
- Large ecosystem of themes and plugins.
- By default no JavaScript is required.
- **Cons**:
bdfinst marked this conversation as resolved.
Show resolved Hide resolved
- Fewer built-in features compared to others, much more of a DIY approach.
- Steeper learning curve compared to others.
- More complex build process.
- Not as easy to extend with custom components.
- Theme management is abysmal w/ a combination of Go modules, Git submodules, and NPM packages.
- Zero documentation themes the team liked, leading to the quandry of whether to build, and having to maintain, a custom theme.
bdfinst marked this conversation as resolved.
Show resolved Hide resolved

3. [**Material for MkDocs**](https://squidfunk.github.io/mkdocs-material/): is a popular static site generator geared towards project documentation. The Material for MkDocs theme provides a clean and responsive design.

- **Pros**:
- _Amazing_ default theme and developer experience for writing docs.
- Easy to use and extend.
- Large ecosystem of plugins.
- **Cons**:
- Not as flexible as Hugo or Starlight.
- Making custom components can be more challenging.
- Brings in Python dependencies (not a really huge detractor, but the team would like to reduce dependencies on different languages where possible).

## Decision

To simplify the development process and improve the performance of the documentation site, we have decided to migrate to Starlight. This is based upon a number of factors:
bdfinst marked this conversation as resolved.
Show resolved Hide resolved

- Small dependency footprint.
- Fast performance.
- Easy to extend with custom components.
- Built-in support for MDX.
- The majority of the features we need are built-in and require minimal configuration.
- Client-side static site search
- Sane spacing and typography
- Dark mode + light mode
- Syntax highlighting
- Responsive design + mobile-friendly
- Tabs + Admonitions

## Consequences
bdfinst marked this conversation as resolved.
Show resolved Hide resolved

- During the transition, we will need to update the existing documentation content to work with the new site generator. Additionally, the site archictecture will be re-evaluated and optimized. This _will_ result in many links to current content breaking.
bdfinst marked this conversation as resolved.
Show resolved Hide resolved
- Every documentation generator has its quirks and limitations, so we will need to adapt to the new workflow and learn how to best utilize the features of Starlight.
- The migration will take time and effort, but the benefits of improved performance and flexibility will be worth it in the long run.
- The team will need to learn how to use Astro and Starlight, which may require some training and experimentation.
23 changes: 0 additions & 23 deletions docs-website/.gitignore

This file was deleted.

53 changes: 0 additions & 53 deletions docs-website/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs-website/babel.config.js

This file was deleted.

Loading
Loading