Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable PDF and EPUB build#272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rffontenelle merged 11 commits intomainfrombuild-pdf
Oct 7, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 36 additions & 15 deletions.github/workflows/check.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,11 +41,16 @@ env:

jobs:

# Build documentation handling warnings as errors.
# If success, upload built docs. If failure, notify telegram and upload logs.
# Build documentation handling warnings as errors in both HTML and PDF.
# If success, upload built docs as artifact.
# If failure in HTML, notify telegram and upload logs.
build:
name: Buildtranslateddocs
name: Build docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
format: [ html, latex, epub ]
steps:
- uses: actions/checkout@v5
with:
Expand All@@ -70,20 +75,13 @@ jobs:

- name: Build docs
id: build
run: ./scripts/build.sh

- name: Upload artifact - docs
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4.3.5
with:
name: docs
path: cpython/Doc/build/html
run: ./scripts/build.sh ${{ matrix.format }}

- name: Prepare notification (only on error)
if: always() && steps.build.outcome == 'failure'
if: always() && steps.build.outcome == 'failure' && matrix.format == 'html'
id: prepare
run: |
scripts/prepmsg.sh logs/sphinxwarnings.txt logs/notify.txt
scripts/prepmsg.sh logs/sphinxwarnings-${format}.txt logs/notify.txt
cat logs/notify.txt
env:
GITHUB_JOB: ${{ github.job }}
Expand All@@ -101,11 +99,34 @@ jobs:

- name: Upload artifact - log files
if: always() && steps.build.outcome == 'failure'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.5
with:
name: ${{ inputs.version }}-build-logs
name:logs-${{ inputs.version }}-${{ matrix.format }}
path: logs/*

- name: Upload artifact - docs
if: always() && steps.build.outcome == 'success'
uses: actions/upload-artifact@v4.3.5
with:
name: python-docs-pt-br-${{ inputs.version }}-${{ matrix.format }}
path: cpython/Doc/build/${{ matrix.format }}

# Build Python docs in PDF format and make available for download.
output-pdf:
name: Build docs (pdf)
runs-on: ubuntu-latest
needs: [ 'build' ]
steps:
- uses: actions/download-artifact@v5
with:
name: python-docs-pt-br-${{ inputs.version }}-latex
- run: sudo apt-get update
- run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy texlive-lang-portuguese
- run: make
- uses: actions/upload-artifact@v4
with:
name: python-docs-pt-br-${{ inputs.version }}-pdf
path: ./*.pdf

# Run sphinx-lint to find wrong reST syntax in PO files. Always store logs.
# If issues are found, notify telegram and upload logs.
Expand Down
17 changes: 12 additions & 5 deletionsscripts/build.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
#!/bin/sh
# Build translated docs to pop up errors
# Build translated docs
# Expects input like 'html' and 'latex', defaults to 'html'.
#
# SPDX-License-Identifier: CC0-1.0

set -xeu

if [ -z "$1" ]; then
format=html
else
format="$1"
fi

# Fail earlier if required variables are not set
test -n ${PYDOC_LANGUAGE+x}

Expand All@@ -14,15 +21,15 @@ mkdir -p logs
# If version is 3.12 or older, set gettext_compact.
# This confval is not needed since 3.12.
# In 3.13, its presence messes 3.13's syntax checking (?)
opts="-D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings.txt"
opts="-D language=${PYDOC_LANGUAGE} --keep-going -w ../../logs/sphinxwarnings-${format}.txt"
minor_version=$(git -C cpython/Doc branch --show-current | sed 's|^3\.||')
if [ $minor_version -lt 12 ]; then
opts="$opts -D gettext_compact=False"
fi

make -C cpython/Dochtml SPHINXOPTS="${opts}"
make -C cpython/Doc"${format}" SPHINXOPTS="${opts}"

# Remove empty file
if [ ! -s logs/sphinxwarnings.txt ]; then
rm logs/sphinxwarnings.txt
if [ ! -s"logs/sphinxwarnings-${format}.txt" ]; then
rm"logs/sphinxwarnings-${format}.txt"
fi
Loading

[8]ページ先頭

©2009-2025 Movatter.jp