Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mattias-kindborg-at-work committed Jan 16, 2025
1 parent 9fc9ec2 commit d7797de
Show file tree
Hide file tree
Showing 101 changed files with 170 additions and 0 deletions.
70 changes: 70 additions & 0 deletions build_redirects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import os
import glob

def find_files(directory):
pattern = os.path.join(directory, "**", "*.md")
return glob.glob(pattern, recursive=True)

def add_frontmatter_config(file_path, config_key, config_value):
with open(file_path, "r") as file:
content = file.read()

parts = content.split("---")
if len(parts) < 3:
raise ValueError("The file does not contain valid FrontMatter")

frontmatter = parts[1].strip()
rest_of_content = "---".join(parts[2:])

frontmatter_lines = frontmatter.split("\n")

key_exists = False
for i, line in enumerate(frontmatter_lines):
if line.startswith(f"{config_key}:"):
frontmatter_lines[i] = f"{config_key}: {config_value}"
key_exists = True
break

if not key_exists:
frontmatter_lines.append(f"{config_key}: {config_value}")

frontmatter = "\n".join(frontmatter_lines)

updated_content = f"---\n{frontmatter}\n---{rest_of_content}"

with open(file_path, "w") as file:
file.write(updated_content)

files = find_files("./docs")
files.append("./index.md")

for file in files:
relativePath = file.replace("./docs/", "").replace("./", "").replace("index.md", "").replace(".md", "")

if (relativePath == "introduction/"):
relativePath = "introduction/what-is-acap"

if (relativePath == "get-started/" or relativePath == "get-started/set-up-developer-environment/"):
relativePath = "get-started/set-up-developer-environment/pre-requisites"

if (relativePath == "api/"):
relativePath = "api/native-sdk-api"

if (relativePath == "service/"):
relativePath = "service/acap-service-portal"

if (relativePath == "acap-sdk-version-3/"):
relativePath = "acap-sdk-version-3/introduction"

if (relativePath == "acap-sdk-version-3/develop-applications/"):
relativePath = "acap-sdk-version-3/develop-applications/application-project-structure"

if (relativePath == "acap-sdk-version-3/services-for-partners/"):
relativePath = "acap-sdk-version-3/services-for-partners/package-signing"

if (relativePath == "licenses/"):
relativePath = ""

url = f"http://localhost:3000/acap/{relativePath}"

add_frontmatter_config(file, "redirect_to", url)
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_sdk_version_3
parent: ACAP SDK version 3
title: API
nav_order: 6
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/api/
---
# API

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: Application project structure
nav_order: 1
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/application-project-structure
---
# Application project structure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: Build, install and run the application
nav_order: 2
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/build-install-and-run-the-application
---
# Build, install and run the application

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: Develop using Visual Studio Code
nav_order: 5
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/develop-using-visual-studio-code
---
# Develop using Visual Studio Code

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/develop-applications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ parent: ACAP SDK version 3
title: Develop applications
nav_order: 3
has_children: true
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/application-project-structure
---
# Develop applications
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: Reproducible builds
nav_order: 3
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/reproducible-builds
---
# Reproducible builds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: Supported languages
nav_order: 6
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/supported-languages
---
# Supported languages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Develop applications
grand_parent: ACAP SDK version 3
title: VAPIX access for ACAP applications
nav_order: 4
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/develop-applications/vapix-access-for-acap-applications
---

# VAPIX access for ACAP applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Get started
grand_parent: ACAP SDK version 3
title: ACAP development requirements
nav_order: 1
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/acap-development-requirements
---
# ACAP development requirements

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/get-started/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Get started
grand_parent: ACAP SDK version 3
title: Compatibility
nav_order: 2
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/compatibility
---
# Compatibility

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Get started
grand_parent: ACAP SDK version 3
title: Find out which SDK to use
nav_order: 3
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/find-out-which-sdk-to-use
---
# Find out which SDK to use

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: ACAP SDK version 3
title: Get started
nav_order: 2
has_children: true
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/
---
# Get started

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Get started
grand_parent: ACAP SDK version 3
title: Set up and verify the SDK
nav_order: 5
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/set-up-and-verify-the-sdk
---
# Set up and verify the SDK

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/get-started/set-up-the-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Get started
grand_parent: ACAP SDK version 3
title: Set up the device
nav_order: 4
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/get-started/set-up-the-device
---
# Set up the device

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ layout: acap_sdk_version_3
title: ACAP SDK version 3
nav_order: 15
has_children: true
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/introduction
---
# ACAP version 3.1.0 - 3.5 SDK Documentation
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_sdk_version_3
parent: ACAP SDK version 3
title: Introduction
nav_order: 1
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/introduction/
---
# Introduction

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/more-resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_sdk_version_3
parent: ACAP SDK version 3
title: More resources
nav_order: 4
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/more-resources/
---
# More resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Services for partners
grand_parent: ACAP SDK version 3
title: ACAP Service Portal for administrators
nav_order: 2
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/services-for-partners/acap-service-portal-for-administrators
---
# ACAP Service Portal for administrators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Services for partners
grand_parent: ACAP SDK version 3
title: Accept or deny unsigned ACAP applications
nav_order: 3
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/services-for-partners/accept-or-deny-unsigned-acap-applications
---
# Accept or deny unsigned ACAP applications

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/services-for-partners/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ parent: ACAP SDK version 3
title: Services for partners
nav_order: 5
has_children: true
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/services-for-partners/package-signing
---
# Services for partners
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: Services for partners
grand_parent: ACAP SDK version 3
title: Package signing
nav_order: 1
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/services-for-partners/package-signing
---
# Package signing

Expand Down
1 change: 1 addition & 0 deletions docs/acap-sdk-version-3/what-is-new-in-acap-sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_sdk_version_3
parent: ACAP SDK version 3
title: What's new in ACAP SDK
nav_order: 7
redirect_to: http://localhost:3000/acap/acap-sdk-version-3/what-is-new-in-acap-sdk/
---
# What's new in ACAP SDK

Expand Down
1 change: 1 addition & 0 deletions docs/api/beta-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: default
title: Beta API
parent: API
nav_order: 3
redirect_to: http://localhost:3000/acap/api/beta-api
---

# Beta API
Expand Down
1 change: 1 addition & 0 deletions docs/api/computer-vision-sdk-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: default
title: Computer Vision APIs
parent: API
nav_order: 2
redirect_to: http://localhost:3000/acap/api/computer-vision-sdk-apis
---

# Computer Vision APIs
Expand Down
1 change: 1 addition & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ title: API
nav_order: 7
has_children: true
permalink: docs/api
redirect_to: http://localhost:3000/acap/api/native-sdk-api
---
1 change: 1 addition & 0 deletions docs/api/native-sdk-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
title: Native SDK API
parent: API
nav_order: 1
redirect_to: http://localhost:3000/acap/api/native-sdk-api
---

# Native SDK API
Expand Down
1 change: 1 addition & 0 deletions docs/axis-devices-and-compatibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
title: Axis devices & compatibility
nav_order: 8
redirect_to: http://localhost:3000/acap/axis-devices-and-compatibility/
---

# Axis devices & compatibility
Expand Down
1 change: 1 addition & 0 deletions docs/cloud-integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
title: Cloud integrations
nav_order: 9
redirect_to: http://localhost:3000/acap/cloud-integrations/
---

# Cloud integrations
Expand Down
1 change: 1 addition & 0 deletions docs/computer-vision-on-device/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: default
title: Computer vision on device
nav_order: 6
permalink: docs/computer-vision-on-device
redirect_to: http://localhost:3000/acap/computer-vision-on-device/
---
# Computer vision on device

Expand Down
1 change: 1 addition & 0 deletions docs/develop-container-applications/build-install-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
parent: Develop container applications
title: Build, install, run
nav_order: 1
redirect_to: http://localhost:3000/acap/develop-container-applications/build-install-run
---

# Build, install, run
Expand Down
1 change: 1 addition & 0 deletions docs/develop-container-applications/camera-calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
parent: Develop container applications
title: Camera calibration
nav_order: 4
redirect_to: http://localhost:3000/acap/develop-container-applications/camera-calibration
---

# Camera calibration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
parent: Develop container applications
title: Include third party libraries
nav_order: 2
redirect_to: http://localhost:3000/acap/develop-container-applications/include-third-party-libraries
---

# Include third party libraries
Expand Down
1 change: 1 addition & 0 deletions docs/develop-container-applications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
title: Develop container applications
has_children: true
nav_order: 5
redirect_to: http://localhost:3000/acap/develop-container-applications/
---

# Develop container applications
Expand Down
1 change: 1 addition & 0 deletions docs/develop-container-applications/supported-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
parent: Develop container applications
title: Supported languages
nav_order: 3
redirect_to: http://localhost:3000/acap/develop-container-applications/supported-languages
---

# Supported languages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: acap_container_applications_deprecation_page
parent: Develop container applications
title: Web server via Reverse Proxy
nav_order: 5
redirect_to: http://localhost:3000/acap/develop-container-applications/web-server-via-reverse-proxy
---

# Web server via Reverse Proxy
Expand Down
1 change: 1 addition & 0 deletions docs/develop/VAPIX-access-for-ACAP-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
parent: Develop ACAP applications
title: VAPIX access for ACAP applications
nav_order: 7
redirect_to: http://localhost:3000/acap/develop/VAPIX-access-for-ACAP-applications
---

# VAPIX access for ACAP applications
Expand Down
1 change: 1 addition & 0 deletions docs/develop/application-project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
parent: Develop ACAP applications
title: Application project structure
nav_order: 1
redirect_to: http://localhost:3000/acap/develop/application-project-structure
---

<!-- omit in toc -->
Expand Down
1 change: 1 addition & 0 deletions docs/develop/build-install-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
parent: Develop ACAP applications
title: Build, install, run
nav_order: 3
redirect_to: http://localhost:3000/acap/develop/build-install-run
---

# Build, install, run
Expand Down
1 change: 1 addition & 0 deletions docs/develop/camera-calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
parent: Develop ACAP applications
title: Camera calibration
nav_order: 6
redirect_to: http://localhost:3000/acap/develop/camera-calibration
---

# Camera calibration
Expand Down
1 change: 1 addition & 0 deletions docs/develop/include-third-party-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: page
parent: Develop ACAP applications
title: Include third party libraries
nav_order: 4
redirect_to: http://localhost:3000/acap/develop/include-third-party-libraries
---

# Include third party libraries
Expand Down
1 change: 1 addition & 0 deletions docs/develop/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: default
title: Develop ACAP applications
has_children: true
nav_order: 4
redirect_to: http://localhost:3000/acap/develop/
---

# Develop ACAP applications
Expand Down
Loading

0 comments on commit d7797de

Please sign in to comment.