Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace <img /> with something else (e.g. glyphicon) #24

Open
gorgitko opened this issue Mar 9, 2021 · 0 comments
Open

Replace <img /> with something else (e.g. glyphicon) #24

gorgitko opened this issue Mar 9, 2021 · 0 comments

Comments

@gorgitko
Copy link

gorgitko commented Mar 9, 2021

Hello,

would it be possible to use something else for klippy button than <img /> tag (defined here)? For example, glyphicons could be used, as they are integrated into Bootstrap, which is a part of rmarkdown.

Now I am using this dirty hack in Rmd file to replace klippy button images with glyphicons:

$(document).ready(function() {
  setTimeout(function() {
    $("img.octicon").each(function(i, el) {
      el.parentNode.innerHTML = '<span class="octicon glyphicon glyphicon-copy"></span>'
    });
  }, 500);
});

Why would that be needed? I am using rmdformats to style my Rmd documents and some of them are adding a gallery mode used for each <img /> (e.g. readthedown style). That is, when you click on an image, zoomed version is displayed along with navigation between images. And, unfortunately, klippy is interfering with that, so when you click on a copy button, the gallery mode is triggered.

Thanks for looking into this and many thanks for this awesome package! 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant