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

Katex in static output #655

Open
yourealwaysbe opened this issue Jul 1, 2020 · 3 comments
Open

Katex in static output #655

yourealwaysbe opened this issue Jul 1, 2020 · 3 comments

Comments

@yourealwaysbe
Copy link

yourealwaysbe commented Jul 1, 2020

The Katex CSS does not properly load in the static output of Idyll Equations leading to duplicated equations. It is linked via a URL that does not work under the file:// protocol.

To Reproduce

  1. idyll create
  2. accept defaults to produce a basic article
  3. replace index.idyll with a file containing only "[Equation]x = x + 1[/Equation]"
  4. run "idyll build"
  5. open with "firefox build/index.html"
  6. the equation displays twice

The equation displays twice because the Katex stylesheet appears to be included with a URL that does not work under the file:// protocol. Could the CSS be included in the stylesheet produced by "idyll build" instead?

    <link
      rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.css"
    />

Expected behavior
Equation appears once / css is loadable.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Browser: Firefox
  • Version: 77.0.1
@mathisonian
Copy link
Member

@yourealwaysbe does changing the URL to explicitly be https:// solve this problem? If so that's probably the simplest fix but we could alternatively conditionally include it in the CSS bundle that idyll produces.

If we need to update the CSS building logic that is done here https://github.com/idyll-lang/idyll/blob/master/packages/idyll-cli/src/pipeline/css.js#L16-L26

@yourealwaysbe
Copy link
Author

Changing the URL fixes it.

Am i right in thinking that the static page output is otherwise self-contained, except the katex CSS link?

@mathisonian
Copy link
Member

Yes that's right @yourealwaysbe

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

No branches or pull requests

2 participants