Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
63 changes: 63 additions & 0 deletions .github/workflows/update-external-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Update External Docs

on:
schedule:
- cron: '0 0 * * *' # Run every day at midnight
workflow_dispatch: # Allow manual triggering

jobs:
update-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Update External Documentation
run: |
# Create temp directories for cloning
mkdir -p temp_clones

echo "Cloning PX4..."
git clone --depth 1 https://github.com/PX4/PX4-Autopilot.git temp_clones/px4

echo "Cloning ArduPilot..."
git clone --depth 1 https://github.com/ArduPilot/ardupilot_wiki.git temp_clones/ardupilot

echo "Cloning Betaflight..."
git clone --depth 1 https://github.com/betaflight/betaflight.com.git temp_clones/betaflight

# Clean existing external docs directories
echo "Cleaning old docs..."
rm -rf external-docs/px4 external-docs/ardupilot external-docs/betaflight
mkdir -p external-docs/px4 external-docs/ardupilot external-docs/betaflight

# Copy PX4 docs (content of docs/ folder)
echo "Copying PX4 docs..."
cp -r temp_clones/px4/docs/. external-docs/px4/

# Copy ArduPilot docs (entire repo content)
echo "Copying ArduPilot docs..."
cp -r temp_clones/ardupilot/. external-docs/ardupilot/
# Remove .git directory from copied content
rm -rf external-docs/ardupilot/.git

# Copy Betaflight docs (content of docs/ folder)
echo "Copying Betaflight docs..."
cp -r temp_clones/betaflight/docs/. external-docs/betaflight/

# Cleanup temp directory
rm -rf temp_clones

- name: Commit and Push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add external-docs
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update external documentation [skip ci]"
git push
fi
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

4 changes: 2 additions & 2 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@

## External Documentation

* [PX4 User Guide](external-documentation/px4-user-guide.md)
* [Betaflight Wiki](external-documentation/betaflight-wiki.md)
* [PX4 User Guide](external-docs/px4/en/index.md)
* [Betaflight Wiki](external-docs/betaflight/wiki/wiki.md)
1 change: 0 additions & 1 deletion external-docs/ardupilot
Submodule ardupilot deleted from 29eedd
36 changes: 36 additions & 0 deletions external-docs/ardupilot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM python:3.11-slim-bookworm



ARG DEBIAN_FRONTEND=noninteractive
ARG USER_NAME=ardupilot_wiki
ARG USER_UID=1000
ARG USER_GID=1000
ARG WORKDIRECTORY=/${USER_NAME}

WORKDIR ${WORKDIRECTORY}
RUN groupadd ${USER_NAME} --gid ${USER_GID}\
&& useradd -l -m ${USER_NAME} -u ${USER_UID} -g ${USER_GID} -s /bin/bash


RUN apt-get update && apt-get install --no-install-recommends -y \
software-properties-common \
lsb-release \
sudo

ENV USER=${USER_NAME}

RUN echo "${USER_NAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USER_NAME} \
&& chmod 0440 /etc/sudoers.d/${USER_NAME} \
&& chown -R ${USER_NAME}:${USER_NAME} ${WORKDIRECTORY}

USER ${USER_NAME}

RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=bind,source=Sphinxsetup.sh,target=${WORKDIRECTORY}/Sphinxsetup.sh \
--mount=type=bind,source=requirements.txt,target=${WORKDIRECTORY}/requirements.txt \
bash -c "./Sphinxsetup.sh"

RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV PATH="/home/${USER_NAME}/.local/bin:${PATH}"
110 changes: 110 additions & 0 deletions external-docs/ardupilot/LICENSE

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions external-docs/ardupilot/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# makefile for building docs incrementally

ALL_WIKIS=copter plane rover sub antennatracker dev planner planner2 ardupilot mavproxy blimp

ALL_CLEAN=$(addsuffix _clean,$(ALL_WIKIS))
ALL_HTML=$(addsuffix _html,$(ALL_WIKIS))

all: $(ALL_HTML)

clean: $(ALL_CLEAN)

%_common: %
echo "Copying common files to $</source/docs"
rsync -av common/source/docs/common-*rst $</source/docs/

%_clean: %
$(MAKE) -C $< clean

%_html: % %_common
$(MAKE) -C $< html

8 changes: 8 additions & 0 deletions external-docs/ardupilot/Sphinxsetup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rem remove any existing packages that may cause conflicts
python3 -m pip uninstall -y sphinx lxml sphinx-rtd-theme sphinxcontrib-youtube beautifulsoup4

rem Install required python packages
python3 -m pip install --user --upgrade -r requirements.txt

echo "Setup completed successfully!"
pause
77 changes: 77 additions & 0 deletions external-docs/ardupilot/Sphinxsetup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
set -e
set -x

if [ "$UID" -eq 0 ]; then
echo "Sorry, this script must NOT be run as ROOT!"
exit 1
fi

# Check for lsb_release and set distribution variables safely
if command -v lsb_release &> /dev/null; then
DISTRIBUTION_ID=$(lsb_release -i -s)
DISTRIBUTION_CODENAME=$(lsb_release -c -s)
else
DISTRIBUTION_ID=""
DISTRIBUTION_CODENAME=""
fi

if [ ${DISTRIBUTION_ID} = 'Ubuntu' ]; then
if [ ${DISTRIBUTION_CODENAME} = 'focal' ] || [ ${DISTRIBUTION_CODENAME} = 'bionic' ] || [ ${DISTRIBUTION_CODENAME} = 'noble' ]; then
sudo add-apt-repository universe
fi
fi

# Check for macOS
if [[ "$(uname)" == "Darwin" ]]; then
echo "Detected macOS. Installing dependencies using Homebrew."
# Check for Homebrew and install if missing
if ! command -v brew &> /dev/null; then
echo "Homebrew not found. Installing Homebrew."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"
fi
brew update
brew install git imagemagick curl wget make python3 unzip
# Ensure pip is available
if ! command -v pip3 &> /dev/null; then
python3 -m ensurepip --upgrade || true
fi
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
python3 -m pip install --user --upgrade -r "$SCRIPT_DIR"/requirements.txt
echo "Setup completed successfully for macOS!"
exit 0
fi

sudo apt-get -y update
sudo apt-get install -y unzip git imagemagick curl wget make python3

# Install packages release specific
if [ ${DISTRIBUTION_CODENAME} = 'bionic' ]; then
sudo apt-get install -y python3-distutils
fi

# For WSL (esp. version 2) make DISPLAY empty to allow pip to run
STORED_DISPLAY_VALUE=$DISPLAY
if grep -qi -E '(Microsoft|WSL)' /proc/version; then
echo "Temporarily clearing the DISPLAY variable because this is WSL"
export DISPLAY=
fi

sudo apt-get install -y python3-pip

# Install required python packages
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
if [ "${DISTRIBUTION_CODENAME}" = "noble" ]; then
python3 -m pip install --upgrade -r "$SCRIPT_DIR"/requirements.txt
else
python3 -m pip install --user --upgrade -r "$SCRIPT_DIR"/requirements.txt
fi

# Reset the value of DISPLAY
if grep -qi -E '(Microsoft|WSL)' /proc/version; then
echo "Returning DISPLAY to the previous value in WSL"
export DISPLAY=$STORED_DISPLAY_VALUE
fi

echo "Setup completed successfully!"
36 changes: 36 additions & 0 deletions external-docs/ardupilot/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :


# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# default to focal for building the Wiki:
config.vm.box = "ubuntu/focal"

# 18.04 LTS EOL April 2023
config.vm.define "bionic", autostart: false do |bionic|
bionic.vm.box = "ubuntu/bionic64"
bionic.vm.provider "virtualbox" do |vb|
vb.name = "ArduPilot_wiki (bionic)"
end
bionic.vm.provision "shell", path: "./scripts/initvagrant.sh"
bionic.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end

# 20.04 LTS EOL April 2025
config.vm.define "focal", autostart: true do |focal|
focal.vm.box = "ubuntu/focal64"
focal.vm.provider "virtualbox" do |vb|
vb.name = "ArduPilot_wiki (focal)"
end
focal.vm.provision "shell", path: "./scripts/initvagrant.sh"
focal.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "16384"]
end
end
end
Loading