Giter Site home page Giter Site logo

Comments (13)

rkdarst avatar rkdarst commented on August 27, 2024 1

It seems like yes, but you really would want it to be called index.rst, so that the root would work. I am making another test repository to narrow down the problem (it happens with only sphinx+sphinx-copybotton, so after I narrow down some more, I will report it to sphinx-copybutton while I continue investigating)

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

After some investigation...

Looking at the source, this is the element of the copy button itself. It seems the icon is not showing, and instead the alt text is, which :

<img src="#_static/copy-button.svg" alt="Copy to clipboard">

Note the extra # on it, so the image link doesn't work. My sites don't have that # there. If I add the # on my site, I get the same behavior as you see there.

I have no idea yet where that # can come from. I downloaded that repository and built it myself, and it worked. Has it always been this way? I notice this directly has a code-block inside of a signature class, and I couldn't find any other examples of that. Could you try varying different things and see if you can find any other patterns of it occuring. Does it happen when building locally?

My current hope is there was some bug in some upstream version of libraries, which is fixed now, so this will go away by itself...

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

I have tried to move the code block outside the signature directive and it still shows the alt-text. It happens only for code blocks (or literal includes) in index.rst anywhere else in the document the icon is shown correctly. It also happens when building through the GitHub action :(

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Nope, it does not work locally either.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

Update!

  • make html works on the main page
  • make dirhtml fails on the main page

Also index.rst is the only document which keeps its name: all other get renamed to index.html and put into a sub-directory, to have pretty URLs. This isn't the first error of an executablebooks project for the dirhtml builder, but I can't yet see how it could be a problem of sphinx-copybutton itself... I will investigate more.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

Reply from ENCCS/intermediate-mpi#42, since I commented on the wrong issue:

A-ha! Thanks for the detective work! So if we renamed index.rst to something else it would fix the problem?

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Many thanks for digging!

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

I think it is a Sphinx problem. Debugging found here:
executablebooks/sphinx-copybutton#110

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

Fixes for Sphinx and sphinx_rtd_theme:

But these require an upstream release to properly fix. Next up, local hackish command to do it.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

My workaround for fixing is this is currently

sed -i 's/url_root="#"/url_root=""/' _build/dirhtml/index.html || true

Let's see if it works for intermediate-mpi before I apply it here.

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

It worked! Thanks!

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

This is now fixed upstream in both sphinx and sphinx_rtd_theme. sphinx-book-theme is not affected. Other themes may possible need fixing, if they have copied the wrong code.

I think this workaround should be maintained for quite a while, though, since things will be slow to update everywhere, and we don't want to strongly tie to any particular versions.

Thanks for reporting this!

from sphinx-lesson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.