From 048daca1ecbfa7b416d03bba662fdf052a8ae8cb Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Fri, 26 Jul 2024 08:08:43 +0100 Subject: [PATCH] Use enabled_if_env to switch pdf-export Signed-off-by: Arthit Suriyawongkul --- .github/workflows/validate_pull_request.yml | 7 +++---- mkdocs.yml | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_pull_request.yml b/.github/workflows/validate_pull_request.yml index 070cf57d80..02a4f49ab5 100644 --- a/.github/workflows/validate_pull_request.yml +++ b/.github/workflows/validate_pull_request.yml @@ -29,9 +29,7 @@ jobs: run: pip install -r spec-parser/requirements.txt - name: Build model files run: python3 spec-parser/main.py spdx-3-model/model spdx-spec/docs/model - - name: Disable time-consuming PDF build in this PR validation workflow - run: sed -i '/pdf-export:/,/combined:/ d' spdx-spec/mkdocs.yml # Remove 2 lines in config - - name: Build docs to validate + - name: Build the site to validate working-directory: spdx-spec run: | MODEL_YML="docs/model/mkdocs-files.yml" @@ -47,4 +45,5 @@ jobs: echo "=====================" echo "Start mkdocs build" echo "=====================" - mkdocs build --config-file "$FINAL_MKDOCS_YML" --verbose --clean + ENABLE_PDF_EXPORT=0 mkdocs build --clean --config-file "$FINAL_MKDOCS_YML" --verbose + # Build without the time-consuming PDF export diff --git a/mkdocs.yml b/mkdocs.yml index 1a9bdf2261..bfaac1a77e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,8 @@ plugins: canonical_version: latest # tell search engines to prefer the latest version - pdf-export: combined: true + media_type: print + enabled_if_env: ENABLE_PDF_EXPORT # only export PDF if this is set to 1 extra_css: - css/style.css markdown_extensions: @@ -22,8 +24,8 @@ markdown_extensions: strict: true validation: nav: - omitted_files: warn - not_found: warn + omitted_files: info # allow during development where there are moving parts + not_found: info # allow during development where there are moving parts absolute_links: warn links: not_found: warn