Opened 2 years ago

Closed 2 years ago

#30418 closed defect (fixed)

Missing PDF icons in the Sage documentation website

Reported by: Kwankyu Lee Owned by:
Priority: minor Milestone: sage-9.3
Component: documentation Keywords:
Cc: John Palmieri Merged in:
Authors: Kwankyu Lee Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: f69c403 (Commits, GitHub, GitLab) Commit: f69c40344b39c14869711e8b145d1150b8a7e8e6
Dependencies: Stopgaps:

Status badges

Description (last modified by Kwankyu Lee)

This ticket is a spin-off from #29993.

In local/share/doc/sage/html/en/index.html, there are supposed to be PDF icons next to each document, as links leading to the PDF builds. Those are missing, because the file _static/pdf.png is missing. For some reason, it is not copied from src/doc/en/website/static to local/share/doc/sage/html/en/_static.

To see the problem, check that:

Running make doc-clean; sage --docbuild all html does not install the PDF icon to the right place, that is under local/share/doc/sage/html/en/website/_static.

But running make doc-clean; sage --docbuild website html does install the PDF icon to the right place.

Change History (15)

comment:1 Changed 2 years ago by Kwankyu Lee

Description: modified (diff)

comment:2 Changed 2 years ago by John Palmieri

Cc: John Palmieri added

comment:3 Changed 2 years ago by John Palmieri

This change works:

  • src/sage_setup/docbuild/__init__.py

    diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py
    index 0841f429e7..9c2e6ed4e2 100644
    a b class ReferenceBuilder(AllBuilder): 
    580580            # of the PDF file.  So we create an html file, based on
    581581            # the file index.html from the "website" target.
    582582            if format == 'pdf':
    583                 # First build the website page. This only takes a few seconds.
    584                 getattr(get_builder('website'), 'html')()
    585 
    586583                website_dir = os.path.join(SAGE_DOC, 'html', 'en', 'website')
    587584                output_dir = self._output_dir(format, lang)
    588585
    def main(): 
    17261723    # Set up Intersphinx cache
    17271724    C = IntersphinxCache()
    17281725
     1726    if type == 'pdf':
     1727        # First build the website page. This only takes a few seconds.
     1728        getattr(get_builder('website'), 'html')()
    17291729    builder = getattr(get_builder(name), type)
    17301730    builder()

This moves the test to the top-level main. We could certainly test for more than if type == 'pdf, for example also name == 'all' or name == 'reference'. Or maybe it's just a good idea to always build the website html page and get the pdf icon there.

Last edited 2 years ago by John Palmieri (previous) (diff)

comment:4 in reply to:  3 ; Changed 2 years ago by Kwankyu Lee

Replying to jhpalmieri:

The code in lines 583--585 has nothing to do with the current issue. It should not be removed.

Your code in lines 1726--1728 is effectively the same with running sage --docbuild website html. This just covers the issue.

The issue of this ticket is to see why sage --docbuild all html does not install the pdf icon. The pdf icon is not installed because the website builder does not copy its static files folder. I checked this problem is also with the developer manual builder.

Last edited 2 years ago by Kwankyu Lee (previous) (diff)

comment:5 in reply to:  4 ; Changed 2 years ago by John Palmieri

Replying to klee:

Replying to jhpalmieri:

The code in lines 583--585 has nothing to do with the current issue.

I think that code is intended to build the basic website framework for the PDF documentation. It appears to matter when getattr(get_builder('website'), 'html')() is executed, as far as installing the appropriate static files. Can you explain why?

It should not be removed.

Of course I didn't remove it, I moved it.

Your code in lines 1726--1728 is effectively the same with running sage --docbuild website html. This just covers the issue.

I know that. The question is why it works and why running getattr(get_builder('website'), 'html')() at a different stage does not.

The issue of this ticket is to see why sage --docbuild all html does not install the pdf icon.

I disagree: you don't want the PDF icon if you haven't built the PDF documentation. So sage --docbuild all html should ideally not install the PDF icon.

The pdf icon is not installed because the website builder does not copy its static files folder. I checked this problem is also with the developer manual builder.

Last edited 2 years ago by John Palmieri (previous) (diff)

comment:6 in reply to:  5 Changed 2 years ago by Kwankyu Lee

Replying to jhpalmieri:

Replying to klee:

Replying to jhpalmieri:

The code in lines 583--585 has nothing to do with the current issue.

I think that code is intended to build the basic website framework for the PDF documentation. It appears to matter when getattr(get_builder('website'), 'html')() is executed, as far as installing the appropriate static files. Can you explain why?

The main purpose of the code is to provide the htmls for the basic website framework. The other code following it assumes that the htmls are in place. If you remove the code from the place where it is, the assumption is broken.

Your code in lines 1726--1728 is effectively the same with running sage --docbuild website html. This just covers the issue.

I know that. The question is why it works and why running getattr(get_builder('website'), 'html')() at a different stage does not.

The question must be solved before we think of any cure.

The issue of this ticket is to see why sage --docbuild all html does not install the pdf icon.

I disagree: you don't want the PDF icon if you haven't built the PDF documentation. So sage --docbuild all html should ideally not install the PDF icon.

The PDF icon problem is just a consequence of the bigger problem of sage --docbuild all html not copying the static files (of website and developer documentations.)

comment:7 Changed 2 years ago by Kwankyu Lee

Authors: Kwankyu Lee
Branch: u/klee/30418

comment:8 Changed 2 years ago by git

Commit: 245a1a3f9b79352233a0b5890029662d3e6f0823

Branch pushed to git repo; I updated commit sha1. New commits:

245a1a3Add html_common_static_path to fix a bug in conf.py

comment:9 Changed 2 years ago by Kwankyu Lee

Status: newneeds_review

comment:10 Changed 2 years ago by git

Commit: 245a1a3f9b79352233a0b5890029662d3e6f082328b022462d56a3d84e42cdc57da697ec1849f867

Branch pushed to git repo; I updated commit sha1. New commits:

28b0224Remove u prefix from strings

comment:11 Changed 2 years ago by git

Commit: 28b022462d56a3d84e42cdc57da697ec1849f867f69c40344b39c14869711e8b145d1150b8a7e8e6

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f69c403Remove u prefix from strings

comment:12 Changed 2 years ago by Kwankyu Lee

It would be nice for this ticket to get reviewed for sage 9.2.

comment:13 Changed 2 years ago by John Palmieri

Reviewers: John Palmieri
Status: needs_reviewpositive_review

Looks okay to me.

comment:14 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.2sage-9.3

comment:15 Changed 2 years ago by Volker Braun

Branch: u/klee/30418f69c40344b39c14869711e8b145d1150b8a7e8e6
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.