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

Can't highlight text or ctrl-f in certain figures – inline the relevant svgs? #12

Closed
csvoss opened this issue Aug 20, 2020 · 3 comments
Assignees

Comments

@csvoss
Copy link
Collaborator

csvoss commented Aug 20, 2020

Some figures have text that can't be highlighted, nor that can be searched for using ctrl-f in the browser. Chris tells me that the solution to this may be to inline the svgs, for example during the build process. I bet there's a nice way to perform this using svelte directly!

@ludwigschubert ludwigschubert self-assigned this Sep 1, 2020
@ludwigschubert
Copy link
Member

ludwigschubert commented Sep 1, 2020

Jupp, that's right! Our main file is a .ejs — embedded javascript that gets evaluated at build time. Webpack is configured to use a ejs-loader plugin. In the index.ejs file we can then use a weird templating syntax, e.g. for our CSS:

<style id="distill-article-specific-styles">
    <%=require("../static/styles.css") %>
</style>

Will go through and inline SVGs! :-)

@ludwigschubert
Copy link
Member

Update on an additional complication: The SVG export converted much of the text to outlines ("paths"). I'll see if I can re-export or redo some of the diagrams. :-)

@ludwigschubert
Copy link
Member

I ended up importing most diagrams as PNGs, re-adding important text using HTML+CSS. Final polish TBD across all viewports, though.

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

2 participants