Skip to content

Commit

Permalink
Add versioned balenaCLI docs
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 15, 2024
1 parent bed7cfc commit 8d9d15b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions .cspell/balena-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ balena-api
balena-base-ui
balena-build
balena-builder
balenacli
balenahup
balenalib
balenista
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ pages/reference/base-images/base-images-ref.md
# Ignore dynamic docs created for masterclasses
shared/masterclass

# Ignore dynamic balenaCLI version docs
config/dictionaries/balenacli.json
shared/balena-cli-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 @@ -149,7 +149,7 @@ Reference
[/reference/api/overview]
Resources[/reference/api/resources/$resource]

CLI[/reference/balena-cli]
CLI[/reference/balena-cli/$balenacli]
SDKs
Node.js SDK[/reference/sdk/node-sdk]
Python SDK[/reference/sdk/python-sdk]
Expand Down
8 changes: 8 additions & 0 deletions templates/balena-cli.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/generate-docs-contracts.js
# Generate base images docs
./tools/build-base-images.sh

# Generate balena-cli docs
node tools/versioning.js https://github.com/balena-io/balena-cli/blob/master/docs/balena-cli.md

# Convert .jpg, .jpeg, .png images to .webp format
./tools/convert-images-to-webp.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 @@ -14,7 +14,7 @@ mkdir -p shared/masterclass/debugging/
which jq && JQ="$(which jq)" || JQ="../../node_modules/node-jq/bin/jq"

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

# Engine
# get latest balena-engine debugging docs
Expand Down
4 changes: 2 additions & 2 deletions tools/versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ async function main() {

// Parse repository details
const { owner, name: repoName, filepath } = parseGithubUrl(repoUrl);
const versionsConfigFile = `./config/dictionaries/${(repoName).replaceAll(/-/g, "")}.json`
const versionsConfigFile = `./config/dictionaries/${repoName.replaceAll(/-/g, "")}.json`
const versionedDocsFolder = path.join(__dirname, `../shared/${repoName}-versions`)

try {
// Fetch and process repository versions
const versions = await fetchGitHubTags(owner, repoName, githubToken);
const versions = await fetchGitHubTags(owner, repoName);

// Write versions configuration
await fsPromises.writeFile(versionsConfigFile, JSON.stringify(versions, null, 2));
Expand Down

0 comments on commit 8d9d15b

Please sign in to comment.