Skip to content

Commit

Permalink
Revamp the documentation
Browse files Browse the repository at this point in the history
The documentation is now generated by Inko, using the "wobsite" library
(https://github.com/yorickpeterse/inko-wobsite). The content has also
been reorganized, rewritten, and extended (e.g. cross compilation is now
covered).

Changelog: other
  • Loading branch information
yorickpeterse committed Jan 28, 2024
1 parent 0b0fd9e commit a605bf0
Show file tree
Hide file tree
Showing 80 changed files with 5,479 additions and 3,253 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/docs.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/push.yml
Expand Up @@ -55,3 +55,35 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/inko:main
env:
AWS_REGION: eu-west-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
needs:
- nightly-container
if: |
github.repository == 'inko-lang/inko' && github.ref_name == 'main'
steps:
- name: Install dependencies
run: sudo microdnf install --quiet --assumeyes rclone awscli2 git tar make
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
docs/build
~/.local/share/inko/packages
key: docs-main
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
docs:
- 'docs/**'
- name: Deploy the documentation
if: steps.changes.outputs.docs == 'true'
run: make docs/publish
23 changes: 14 additions & 9 deletions .github/workflows/release.yml
Expand Up @@ -88,30 +88,35 @@ jobs:

docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/inko:latest
needs:
- lints
- linux
- mac
- freebsd
- container
env:
AWS_REGION: eu-west-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Install dependencies
run: sudo microdnf install --quiet --assumeyes rclone awscli2 git tar make
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: |
docs/.venv
key: ${{ runner.os }}-docs-release
- run: pip install poetry
- run: poetry config virtualenvs.in-project true
- run: cd docs && poetry install
- run: make docs/publish DOCS_FOLDER=${{ github.ref_name }}
- run: >
docs/build
~/.local/share/inko/packages
key: docs-release
- name: Deploy the documentation
run: make docs/publish DOCS_FOLDER=${{ github.ref_name }}
- name: Update the latest tag
run: >
if [[ ${{ github.ref_name }} = $(git tag -l --sort=-v:refname | head -n1) ]]
then make docs/publish DOCS_FOLDER=latest
then
make docs/publish DOCS_FOLDER=latest
fi
- run: make docs/versions
14 changes: 6 additions & 8 deletions .gitignore
@@ -1,11 +1,9 @@
.*.rustfmt
*.ibi
/libstd/build
/tmp
/target
/docs/build
*.egg-info/
__pycache__
/docs/plugins/pygments-inko-lexer/poetry.lock
/build
/docs/build
/docs/dep
/docs/public
/std/build
/target
/tmp
__pycache__
28 changes: 13 additions & 15 deletions Makefile
Expand Up @@ -140,35 +140,33 @@ clean:
rm -rf "${TMP_DIR}"
rm -rf build
rm -rf std/build
rm -rf docs/public
cargo clean

docs/install:
cd docs && poetry install --no-root
cd docs && inko pkg sync

docs/build:
cd docs && poetry run mkdocs build
rm -rf docs/public
cd docs && inko run

docs/server:
cd docs && poetry run mkdocs serve
docs/watch:
cd docs && bash scripts/watch.sh

docs/publish: docs/install docs/build
aws s3 sync docs/build s3://${DOCS_S3_BUCKET}/manual/${DOCS_FOLDER} \
--acl=public-read --delete --cache-control max-age=86400 --no-progress
cd docs && rclone sync \
--config rclone.conf \
--checksum \
--header-upload 'Cache-Control:max-age=604800' \
--s3-acl 'public-read' \
public "production:${DOCS_S3_BUCKET}/manual/${DOCS_FOLDER}"
aws cloudfront create-invalidation \
--distribution-id ${DOCS_CLOUDFRONT_ID} --paths "/*"

docs/versions:
git tag | python ./scripts/docs_versions.py > versions.json
aws s3 cp versions.json s3://${DOCS_S3_BUCKET}/manual/versions.json \
--acl=public-read --cache-control max-age=86400
aws cloudfront create-invalidation \
--distribution-id ${DOCS_CLOUDFRONT_ID} --paths "/manual/versions.json"
rm versions.json

runtimes:
bash scripts/runtimes.sh ${VERSION}

.PHONY: release/source release/manifest release/changelog release/versions
.PHONY: release/commit release/publish release/tag
.PHONY: build install clean runtimes
.PHONY: docs/install docs/build docs/server docs/publish docs/versions
.PHONY: docs/install docs/build docs/watch docs/publish
3 changes: 3 additions & 0 deletions docs/inko.pkg
@@ -0,0 +1,3 @@
require https://github.com/yorickpeterse/inko-wobsite 0.10.0 d67b267deec594515188b5f38cecd34f2d989c8f
require https://github.com/yorickpeterse/inko-builder 0.11.0 ae7b8cf3476dfc401408c493bd6d795bd0ac3ab2
require https://github.com/yorickpeterse/inko-markdown 0.13.0 cc6b10c03fbe18f44e7ad0eb9adc23d0b0f043e0
54 changes: 54 additions & 0 deletions docs/menu.json
@@ -0,0 +1,54 @@
{
"Home": [
"index.md"
],
"Setting up": [
"setup/installation.md",
"setup/ivm.md",
"setup/editors.md",
"setup/whats-next.md"
],
"Getting started": [
"getting-started/hello-world.md",
"getting-started/hello-error-handling.md",
"getting-started/files.md",
"getting-started/sockets.md",
"getting-started/hello-concurrency.md",
"getting-started/memory-management.md",
"getting-started/control-flow.md",
"getting-started/variables.md",
"getting-started/methods.md",
"getting-started/classes.md",
"getting-started/traits.md",
"getting-started/visibility.md",
"getting-started/modules.md",
"getting-started/generics.md",
"getting-started/pattern-matching.md",
"getting-started/destructors.md",
"getting-started/concurrency.md",
"getting-started/ffi.md",
"getting-started/whats-next.md"
],
"Guides": [
"guides/tests.md",
"guides/conditional-compilation.md",
"guides/cross-compilation.md",
"guides/operators.md",
"guides/contributing.md"
],
"References": [
"references/syntax.md",
"references/style.md",
"references/structure.md",
"references/core-types.md",
"references/prelude.md",
"references/cli.md",
"references/packages.md",
"references/tuning.md"
],
"Design": [
"design/compiler.md",
"design/runtime.md",
"design/goals.md"
]
}
80 changes: 0 additions & 80 deletions docs/mkdocs.yml

This file was deleted.

21 changes: 0 additions & 21 deletions docs/plugins/pygments-inko-lexer/poetry.lock

This file was deleted.

0 comments on commit a605bf0

Please sign in to comment.