diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eecbb41..63d9136 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,4 @@ + stages: - check - test @@ -99,14 +100,16 @@ build_idf_docs_html: - .build_template variables: DOCS_DIR: $CI_PROJECT_DIR/esp-idf/docs - IDF_COMMIT_ID: 3faf5ba8f784f + IDF_COMMIT_ID: 7d680980894fbcc1532f6934c1e3a2f0f8181d64 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 && eval "$(tools/idf_tools.py --non-interactive export)" + - 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)" + - pip install $ESP_DOCS_PATH - cd $DOCS_DIR - build-docs --skip-reqs-check -l $DOCLANG -t $DOCTGT parallel: @@ -119,14 +122,16 @@ build_idf_docs_pdf: - .build_template variables: DOCS_DIR: $CI_PROJECT_DIR/esp-idf/docs - IDF_COMMIT_ID: 3faf5ba8f784f + IDF_COMMIT_ID: 7d680980894fbcc1532f6934c1e3a2f0f8181d64 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 && eval "$(tools/idf_tools.py --non-interactive export)" + - 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)" + - pip install $ESP_DOCS_PATH - cd $DOCS_DIR - build-docs --skip-reqs-check -l $DOCLANG -t $DOCTGT -bs latex parallel: diff --git a/setup.cfg b/setup.cfg index 3a460f6..6ca9c7c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = esp-docs -version = 1.1.0 +version = 1.2.0 author = Espressif author_email = marius.vikhammer@espressif.com description = Documentation building package used at Espressif @@ -35,7 +35,7 @@ install_requires = nwdiag==2.0.0 recommonmark sphinx_selective_exclude==1.0.3 - sphinx_idf_theme==1.0.1 + sphinx_idf_theme==1.1.0 [options.packages.find] where = src diff --git a/src/esp_docs/conf_docs.py b/src/esp_docs/conf_docs.py index c61ddf0..8bbf147 100644 --- a/src/esp_docs/conf_docs.py +++ b/src/esp_docs/conf_docs.py @@ -162,6 +162,9 @@ 'github_version': get_github_rev(), } +# Set optional name used by latest branch (defaults to "master") +latest_branch_name = os.environ.get('ESP_DOCS_LATEST_BRANCH_NAME', 'master') + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. diff --git a/src/esp_docs/sanitize_version.py b/src/esp_docs/sanitize_version.py index 1047ec5..1369581 100644 --- a/src/esp_docs/sanitize_version.py +++ b/src/esp_docs/sanitize_version.py @@ -35,7 +35,9 @@ def sanitize_version(original_version): except KeyError: version = original_version - if version == 'master': + latest_branch_name = os.environ.get('ESP_DOCS_LATEST_BRANCH_NAME', 'master') + + if version == latest_branch_name: return 'latest' version = version.replace('/', '-')