Skip to content

Commit

Permalink
Merge branch 'c6_support' into 'master'
Browse files Browse the repository at this point in the history
Add support for building C6 docs.

See merge request espressif/esp-docs!37
  • Loading branch information
ESP-Marius committed Sep 7, 2022
2 parents 9ea4593 + 13463bc commit 9675d3c
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 37 deletions.
43 changes: 20 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,31 @@ stages:
variables:
# Versioned esp-idf-doc env image to use for all document building jobs
ESP_DOCS_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:2-2"
PYTHON_VER: 3.7.10
ESP_DOCS_PATH: "$CI_PROJECT_DIR"
IDF_PATH: $CI_PROJECT_DIR/esp-idf
IDF_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-idf.git

.before_script_minimal:
before_script:
- source ci/setup_python.sh
- source ci/utils.sh

.before_script_prepare_build:
before_script:
# Use CI Tools
- curl -sSL ${CIT_LOADER_URL} | sh
- source citools/import_functions
- source ci/setup_python.sh
- source ci/utils.sh
# Purge any old esp-docs versions
- pip3 uninstall -y esp-docs
- pip3 install .
- pip uninstall -y esp-docs
- pip install .

check_setup:
stage: check
image: $ESP_DOCS_ENV_IMAGE
extends:
- .before_script_minimal
script:
- pip3 install .
- pip install .

check_python_style:
stage: check
Expand Down Expand Up @@ -71,12 +68,6 @@ test_builds:
image: $ESP_DOCS_ENV_IMAGE
extends:
- .before_script_prepare_build
artifacts:
when: always
paths:
- $DOCS_DIR/_build/*/*/html/*
- $DOCS_DIR/_build/*/*/*.txt
expire_in: 4 days

build_example_basic:
extends:
Expand All @@ -102,14 +93,17 @@ build_idf_docs_html:
variables:
DOCS_DIR: $CI_PROJECT_DIR/esp-idf/docs
IDF_COMMIT_ID: 7d680980894fbcc1532f6934c1e3a2f0f8181d64
artifacts:
when: always
paths:
- $DOCS_DIR/_build/*/*/html/*
- $DOCS_DIR/_build/*/*/*.txt
expire_in: 4 days
script:
# add gitlab ssh key
- cit_add_ssh_key "${GITLAB_KEY_PEM}"
- git clone "${IDF_REPO}"
- $ESP_DOCS_PATH/ci/set_repo.sh $IDF_COMMIT_ID $IDF_PATH
- cd $IDF_PATH && tools/idf_tools.py --non-interactive install
- $IDF_PATH/tools/idf_tools.py install-python-env
- eval "$($IDF_PATH/tools/idf_tools.py export)"
- $ESP_DOCS_PATH/ci/setup_idf.sh ${IDF_REPO} $IDF_COMMIT_ID $IDF_PATH $DOCTGT
- eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)"
- pip install $ESP_DOCS_PATH
- cd $DOCS_DIR
- build-docs --skip-reqs-check -l $DOCLANG -t $DOCTGT
Expand All @@ -124,14 +118,17 @@ build_idf_docs_pdf:
variables:
DOCS_DIR: $CI_PROJECT_DIR/esp-idf/docs
IDF_COMMIT_ID: 7d680980894fbcc1532f6934c1e3a2f0f8181d64
artifacts:
when: always
paths:
- $DOCS_DIR/_build/*/*/html/*
- $DOCS_DIR/_build/*/*/*.txt
expire_in: 4 days
script:
# add gitlab ssh key
- cit_add_ssh_key "${GITLAB_KEY_PEM}"
- git clone "${IDF_REPO}"
- $ESP_DOCS_PATH/ci/set_repo.sh $IDF_COMMIT_ID $IDF_PATH
- cd $IDF_PATH && tools/idf_tools.py --non-interactive install
- $IDF_PATH/tools/idf_tools.py install-python-env
- eval "$($IDF_PATH/tools/idf_tools.py export)"
- $ESP_DOCS_PATH/ci/setup_idf.sh ${IDF_REPO} $IDF_COMMIT_ID $IDF_PATH $DOCTGT
- eval "$($IDF_PATH/tools/idf_tools.py --non-interactive export)"
- pip install $ESP_DOCS_PATH
- cd $DOCS_DIR
- build-docs --skip-reqs-check -l $DOCLANG -t $DOCTGT -bs latex
Expand Down Expand Up @@ -216,5 +213,5 @@ deploy_package:
dependencies:
- build_package
script:
- pip3 install .
- pip install .
- python $ESP_DOCS_PATH/ci/deploy_package.py
29 changes: 29 additions & 0 deletions ci/setup_idf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

# $1: repo url
# $2: commit id
# $3: IDF_PATH
# $4: toolchain target

# sets up the repo incl submodules
set -o errexit # Exit if command failed.

if [ -z $2 ] || [ -z $1 ] || [ -z $3 ] || [ -z $4 ] ; then
echo "Mandatory variables undefined"
exit 1;
fi;

# sets up the repo incl submodules with specified version as $2
echo "Checking out repo $1 with commit $2"
mkdir $3 && cd $3
git init
git remote add origin $1
git fetch --depth 1 origin $2
git checkout FETCH_HEAD

git submodule init
git submodule update --depth 1

# Setup IDF env
tools/idf_tools.py --non-interactive install --targets $4
tools/idf_tools.py install-python-env
3 changes: 2 additions & 1 deletion examples/basic/_static/docs_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var DOCUMENTATION_VERSIONS = {
supported_targets: [ "esp32" ]
},
VERSIONS: [
{ name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c3", "esp32h2", "esp8266", "esp32c2" ] },
{ name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c3", "esp32h2", "esp8266", "esp32c2", "esp32c6" ] },
],
IDF_TARGETS: [
{ text: "ESP32", value: "esp32"},
Expand All @@ -13,5 +13,6 @@ var DOCUMENTATION_VERSIONS = {
{ text: "ESP32-H2", value: "esp32h2"},
{ text: "ESP8266", value: "esp8266"},
{ text: "ESP32C2", value: "esp32c2"},
{ text: "ESP32C6", value: "esp32c6"},
]
};
2 changes: 1 addition & 1 deletion examples/basic/build_example.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build-docs -t esp32 esp32s2 esp32c3 esp32s3 esp32h2 esp8266 esp32c2
build-docs -t esp32 esp32s2 esp32c3 esp32s3 esp32h2 esp8266 esp32c2 esp32c6
2 changes: 1 addition & 1 deletion examples/basic/conf_common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from esp_docs.conf_docs import * # noqa: F403,F401

languages = ['en', 'zh_CN']
idf_targets = ['esp8266', 'esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32h2', 'esp32c2']
idf_targets = ['esp8266', 'esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32h2', 'esp32c2', 'esp32c6']

extensions += ['sphinx_copybutton',
'sphinxcontrib.wavedrom',
Expand Down
2 changes: 1 addition & 1 deletion examples/doxygen/build_example.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build-docs -t esp32 esp32s2 esp32c3 esp32s3 esp32h2 esp8266 esp32c2 --project-path src/
build-docs -t esp32 esp32s2 esp32c3 esp32s3 esp32h2 esp8266 esp32c2 esp32c6 --project-path src/
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = esp-docs
version = 1.2.1
version = 1.3.0
author = Espressif
author_email = [email protected]
description = Documentation building package used at Espressif
Expand Down
2 changes: 1 addition & 1 deletion src/esp_docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


LANGUAGES = ['en', 'zh_CN']
TARGETS = ['esp8266', 'esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32h2', 'esp32c2']
TARGETS = ['esp8266', 'esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32h2', 'esp32c2', 'esp32c6']

SPHINX_WARN_LOG = 'sphinx-warning-log.txt'
SPHINX_SANITIZED_LOG = 'sphinx-warning-log-sanitized.txt'
Expand Down
1 change: 1 addition & 0 deletions src/esp_docs/conf_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def setup_config_values(app, config):
'esp32c3': 'ESP32-C3',
'esp32h2': 'ESP32-H2',
'esp32c2': 'ESP32-C2',
'esp32c6': 'ESP32-C6',
}

app.add_config_value('idf_target_title_dict', idf_target_title_dict, 'env')
Expand Down
19 changes: 12 additions & 7 deletions src/esp_docs/esp_extensions/format_esp_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,52 +55,57 @@ class StringSubstituter:
"""
TARGET_NAMES = {'esp8266': 'ESP8266', 'esp32': 'ESP32', 'esp32s2': 'ESP32-S2',
'esp32s3': 'ESP32-S3', 'esp32c3': 'ESP32-C3', 'esp32c2': 'ESP32-C2',
'esp32h2': 'ESP32-H2'}
'esp32h2': 'ESP32-H2', 'esp32c6': 'ESP32-C6'}

TOOLCHAIN_PREFIX = {'esp8266': 'xtensa-lx106-elf',
'esp32': 'xtensa-esp32-elf',
'esp32s2': 'xtensa-esp32s2-elf',
'esp32s3': 'xtensa-esp32s3-elf',
'esp32c3': 'riscv32-esp-elf',
'esp32h2': 'riscv32-esp-elf',
'esp32c2': 'riscv32-esp-elf'
'esp32c2': 'riscv32-esp-elf',
'esp32c6': 'riscv32-esp-elf'
}

CONFIG_PREFIX = {'esp8266': 'esp8266', 'esp32': 'ESP32', 'esp32s2': 'ESP32S2',
'esp32s3': 'ESP32S3', 'esp32c3': 'ESP32C3', 'esp32h2': 'ESP32H2',
'esp32c2': 'ESP32C2'}
'esp32c2': 'ESP32C2', 'esp32c6': 'ESP32C6'}

TRM_EN_URL = {'esp8266': 'https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf',
'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_en.pdf',
'esp32c3': 'https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf',
'esp32s3': 'https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf',
'esp32h2': '#',
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_technical_reference_manual_en.pdf'}
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_technical_reference_manual_en.pdf',
'esp32c6': 'https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf'}

TRM_CN_URL = {'esp8266': 'https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_cn.pdf',
'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_cn.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_cn.pdf',
'esp32c3': 'https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_cn.pdf',
'esp32s3': 'https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_cn.pdf',
'esp32h2': '#',
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_technical_reference_manual_cn.pdf'}
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_technical_reference_manual_cn.pdf',
'esp32c6': 'https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_cn.pdf'}

DATASHEET_EN_URL = {'esp8266': 'https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf',
'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf',
'esp32c3': 'https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf',
'esp32s3': 'https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf',
'esp32h2': '#',
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf'}
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf',
'esp32c6': 'https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf'}

DATASHEET_CN_URL = {'esp8266': 'https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_cn.pdf',
'esp32': 'https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_cn.pdf',
'esp32s2': 'https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_cn.pdf',
'esp32c3': 'https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_cn.pdf',
'esp32s3': 'https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_cn.pdf',
'esp32h2': '#',
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_cn.pdf'}
'esp32c2': 'https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_cn.pdf',
'esp32c6': 'https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_cn.pdf'}

RE_PATTERN = re.compile(r'^\s*{IDF_TARGET_(\w+?):(.+?)}', re.MULTILINE)

Expand Down
2 changes: 1 addition & 1 deletion src/esp_docs/idf_extensions/build_system/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
project_path = os.path.abspath(os.path.dirname(__file__))

# Targets which needs --preview to build
PREVIEW_TARGETS = ['esp32h2', 'esp32c2']
PREVIEW_TARGETS = ['esp32h2', 'esp32c2', 'esp32c6']


def setup(app):
Expand Down

0 comments on commit 9675d3c

Please sign in to comment.