Skip to content

Commit

Permalink
Use enabled_if_env to switch pdf-export
Browse files Browse the repository at this point in the history
Signed-off-by: Arthit Suriyawongkul <[email protected]>
  • Loading branch information
bact authored and goneall committed Jul 30, 2024
1 parent 2d8ed65 commit 048daca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/validate_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 048daca

Please sign in to comment.