Skip to content

Commit

Permalink
move docs to uv and subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMolitor committed Dec 23, 2024
1 parent 5f463e1 commit 05078a1
Show file tree
Hide file tree
Showing 157 changed files with 758 additions and 51 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/cd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.10"

- uses: actions/cache@v4
id: pip-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ hashFiles('docs/_kalico/mkdocs-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.pip-cache.outputs.cache-hit != 'true'
run: pip install -r docs/_kalico/mkdocs-requirements.txt
version: 'latest'
enable-cache: true
cache-dependency-glob: "docs/uv.lock"

- name: Setup Python
working-directory: docs/
run: uv python install

- name: Build MkDocs Pages
run: |
cd docs/
mkdocs build -f _kalico/mkdocs.yml
working-directory: docs/
run: uv run mkdocs build -f _kalico/mkdocs.yml

- name: Deploy
uses: JamesIves/[email protected]
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/ci-docs_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.10"

- uses: actions/cache@v4
id: pip-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ hashFiles('docs/_kalico/mkdocs-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.pip-cache.outputs.cache-hit != 'true'
run: pip install -r docs/_kalico/mkdocs-requirements.txt
version: 'latest'
enable-cache: true
cache-dependency-glob: "docs/uv.lock"

- name: Setup Python
working-directory: docs/
run: uv python install

- name: Build MkDocs Pages
run: |
cd docs/
mkdocs build -f _kalico/mkdocs.yml --strict
run: uv run mkdocs build -f _kalico/mkdocs.yml --strict
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><a href="https://docs.kalico.gg"><img align="center" src="docs/logo/kalico-big.png" alt="Kalico Logo"></a></p>
<p align="center"><a href="https://docs.kalico.gg"><img align="center" src="docs/src/logo/kalico-big.png" alt="Kalico Logo"></a></p>

[![Action Status](https://github.com/KalicoCrew/kalico/actions/workflows/ci-build_test.yaml/badge.svg?branch=main)](https://github.com/KalicoCrew/kalico/actions/workflows/ci-build_test.yaml)

Expand Down
1 change: 1 addition & 0 deletions docs/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
10 changes: 0 additions & 10 deletions docs/_kalico/mkdocs-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions docs/_kalico/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ site_name: Kalico Documentation
site_url: https://docs.kalico.gg
repo_url: https://github.com/KalicoCrew/kalico/
repo_name: KalicoCrew/kalico
edit_uri: edit/main/docs/
edit_uri: edit/main/docs/src/
use_directory_urls: False
docs_dir: '../'
docs_dir: '../src'
site_dir: '../../site/'

validation:
Expand Down
4 changes: 2 additions & 2 deletions docs/_kalico/mkdocs_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def transform(markdown: str, page, config, files):
for i in range(len(lines)):
line_out = lines[i]
in_code_block = (
in_code_block + len(re.findall("\s*[`]{3,}", line_out))
in_code_block + len(re.findall(r"\s*[`]{3,}", line_out))
) % 2
if not in_code_block:
line_out = line_out.replace(
"](../", f"]({config['repo_url']}/blob/main/"
)
line_out = re.sub("\\\s*$", "<br>", line_out)
line_out = re.sub(r"\\\s*$", "<br>", line_out)
# check that lists at level 0 are not indented
# (no space before *|-|1.)
if re.match(r"^[^-*0-9 ]", line_out):
Expand Down
18 changes: 18 additions & 0 deletions docs/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[project]
name = "kalico-docs"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
# mkdocs + theme
"mkdocs>=1.6.1",
"mkdocs-material>=9.5.49",
# mkdocs plugins
"mdx-breakless-lists>=1.0.1",
"mdx-truly-sane-lists>=1.3",
"mkdocs-exclude>=1.0.2",
"mkdocs-simple-hooks>=0.1.5",
"py-gfm>=2.0.0",
]

[dependency-groups]
dev = []
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Diff not rendered.
Diff not rendered.
File renamed without changes.
Diff not rendered.
File renamed without changes.
Diff not rendered.
File renamed without changes.
Loading

0 comments on commit 05078a1

Please sign in to comment.