Skip to content

Commit

Permalink
patch: Create versioned docs for Python SDK
Browse files Browse the repository at this point in the history
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
  • Loading branch information
vipulgupta2048 committed Nov 18, 2024
1 parent 775eaab commit 0978bc0
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions .cspell/balena-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ balenacli
balenahup
balenalib
balenasdk
balenasdkpython
balenista
balenistas
Barys
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tmp

# Ignore external docs that are pulled via tools/fetch-external.sh
# pages/reference/sdk/node-sdk.md
pages/reference/sdk/python-sdk.md
# pages/reference/sdk/python-sdk.md

pages/reference/supervisor/supervisor-api.md
pages/reference/supervisor/upgrade-policy.md
Expand Down Expand Up @@ -50,6 +50,10 @@ shared/balena-cli-versions/
config/dictionaries/balenasdk.json
shared/balena-sdk-versions/

# Ignore dynamic Python SDK version docs
config/dictionaries/balenasdkpython.json
shared/balena-sdk-python-versions/

# Ignore dynamic assets generated for Getting Started
static/img/device/**
config/dictionaries/device.json
Expand Down
2 changes: 1 addition & 1 deletion config/navigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Reference
CLI[/reference/balena-cli/$balenacli]
SDKs
Node.js SDK[/reference/sdk/node-sdk/$balenasdk]
Python SDK[/reference/sdk/python-sdk]
Python SDK[/reference/sdk/python-sdk/$balenasdkpython]
Deprecation Policy[/reference/sdk/deprecation-policy]

Diagnostics
Expand Down
4 changes: 4 additions & 0 deletions config/redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
/reference/sdk/node-sdk/ /reference/sdk/node-sdk/latest/
/reference/sdk/node-sdk /reference/sdk/node-sdk/latest/

# Versioned Python.js SDK docs
/reference/sdk/python-sdk/ /reference/sdk/python-sdk/latest/
/reference/sdk/python-sdk /reference/sdk/python-sdk/latest/

# Important: keep dynamic redirect below the static redirects
# https://developers.cloudflare.com/pages/platform/redirects/

Expand Down
14 changes: 14 additions & 0 deletions pages/reference/sdk/python-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: balena Python SDK Documentation

layout: balena-sdk-python.html

dynamic:
variables: [ $balenasdkpython ]
ref: $original_ref/$balenasdkpython
$switch_text: balena SDK version $balenasdkpython
---

# Balena Python SDK {{ $balenasdkpython.version }} Documentation

{{import "balena-sdk-python-versions"}}
8 changes: 8 additions & 0 deletions templates/balena-sdk-python.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "default.html" %}

{% block dynamicSwitchCustom %}
<p class="dynamic-switch__append">
</p>
{% endblock %}

<div id="output"></div>
3 changes: 3 additions & 0 deletions tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ node ./tools/versioning.js https://github.com/balena-io/balena-cli/blob/master/d
# Generate versioned balena-sdk docs
node ./tools/versioning.js https://github.com/balena-io/balena-sdk/blob/master/DOCUMENTATION.md

# Generate versioned balena-sdk docs
node ./tools/versioning.js https://github.com/balena-io/balena-sdk-python/blob/master/DOCUMENTATION.md

# Generate Masterclasses Dynamically
./tools/build-masterclass.sh

Expand Down
2 changes: 1 addition & 1 deletion tools/fetch-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ cd shared/sdk/ && {
} &

# get latest python SDK docs
curl --fail --show-error -o pages/reference/sdk/python-sdk.md -L https://github.com/balena-io/balena-sdk-python/raw/master/DOCUMENTATION.md &
# curl --fail --show-error -o pages/reference/sdk/python-sdk.md -L https://github.com/balena-io/balena-sdk-python/raw/master/DOCUMENTATION.md &

# get latest base images ref docs
cd pages/reference/base-images/ && {
Expand Down

0 comments on commit 0978bc0

Please sign in to comment.