Skip to content

Commit 990525b

Browse files
author
Release Manager
committed
gh-36799: Create index-pdf.html in html build When we `make doc-pdf`, `reference/index-pdf.html` is also built. With this PR, it is built by default when we `make doc-html`. Here it is: https://deploy-preview-36799--sagemath- tobias.netlify.app/html/en/reference/index-pdf This is to fix the issue #36730 (comment) <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36799 Reported by: Kwankyu Lee Reviewer(s):
2 parents 1c19a98 + 6696177 commit 990525b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/sage_docbuild/builders.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,11 @@ def _output_dir(self, type, lang=None):
654654
os.makedirs(d, exist_ok=True)
655655
return d
656656

657-
def pdf(self):
657+
def html(self):
658658
"""
659-
Build top-level document.
659+
Build the top-level document.
660660
"""
661-
super().pdf()
661+
super().html()
662662

663663
# We want to build master index file which lists all of the PDF file.
664664
# We modify the file index.html from the "reference_top" target, if it
@@ -668,12 +668,8 @@ def pdf(self):
668668
reference_dir = os.path.join(SAGE_DOC, 'html', 'en', 'reference')
669669
output_dir = self._output_dir('html')
670670

671-
# Check if the top reference index.html exists.
672-
try:
673-
with open(os.path.join(reference_dir, 'index.html')) as f:
674-
html = f.read()
675-
except FileNotFoundError:
676-
return
671+
with open(os.path.join(reference_dir, 'index.html')) as f:
672+
html = f.read()
677673

678674
# Install in output_dir a symlink to the directory containing static files.
679675
# Prefer relative path for symlinks.

0 commit comments

Comments
 (0)