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

HTML display issues in docs #46

Closed
cormullion opened this issue Mar 18, 2022 · 11 comments
Closed

HTML display issues in docs #46

cormullion opened this issue Mar 18, 2022 · 11 comments

Comments

@cormullion
Copy link

Nice package! I saw this in the documentation:

Screenshot 2022-03-18 at 11 54 18

I don't know why the whitespace isn't being formatted correctly though. Perhaps it's how Documenter does it...

@FedeClaudi
Copy link
Owner

Thanks! I hope you enjoy using Term!

Where in the docs is that? It looks fine for me here: https://fedeclaudi.github.io/Term.jl/stable/
image

@cormullion
Copy link
Author

cormullion commented Mar 18, 2022

It's the first page of the docs: https://fedeclaudi.github.io/Term.jl/dev/

I'm on MacOS Monterey, latest Safari (15.1). It's the same on FireFox (98.0.1). Just checked, it's the same on my iPhone. Perhaps there's a different interpretation of CSS... 😱😱

@FedeClaudi
Copy link
Owner

mmm bizarre, it looks fine for me anywhere. Perhaps try ctrl+shift+R to reload?

@YongHee-Kim
Copy link
Contributor

Yeah font seems to be matching... but length of o is different in your environment?
image

@FedeClaudi
Copy link
Owner

Whaaat, that's so weird. This is on the docs?
The o seem to have the same width to me, but the spacing between them is different.

@mostol
Copy link

mostol commented Mar 21, 2022

It looks like this might be an issue with the JuliaMono typeface. If you swap to another monospace font, it lines up correctly:

Screen.Recording.2022-03-21.at.2.08.51.PM.mp4

On closer inspection, it looks like this only happens on lines with bolded areas. JuliaMono is supposed to be monospace regardless of weight, but apparently that's not happening here. I checked out the CSS stylesheet and it looks like only JuliaMono-Regular.woff2 is used, so the browser is doing its own "faux"-bolding to the regular font instead of using the properly-aligned bold version (e.g. JuliaMono-Bold), which messes up the whole "monospaced" thing. A quick add of a @font-family rule to the CSS seems to confirm this; if I tack on

@font-face {
    font-family: JuliaMono;
    /* Pulling the font file straight from the JulaMono repo for convenience */
    src: url("https://github.com/cormullion/juliamono/blob/master/webfonts/JuliaMono-Bold.woff2?raw=true") format("woff2");
    font-weight: bold;
    text-rendering: optimizeLegibility;
}

then it works as intended (and looks really nice, great work on this fantastic package! 😍):

Screen Shot 2022-03-21 at 2 32 58 PM

If I were to take a guess, I'd think maybe the difference in appearance between users might be based on 1) how their browser handles faux-bolding, or perhaps 2) whether they actually have JuliaMono installed on their device already.

Edit: This might be an upstream issue with Documenter.jl; I opened an issue there as well.

@FedeClaudi
Copy link
Owner

and looks really nice, great work on this fantastic package!

Thank you, I hope you enjoy it!

Since it's not a Term issue I'll close, unless you need to open to keep track of it but I see you've opened a related one.

@mostol
Copy link

mostol commented Mar 21, 2022

Yeah, go ahead and close it, and hopefully I can get it fixed soon on the Documenter.jl end.

@cormullion
Copy link
Author

Thanks for the cool sleuthing, @mostol !

@mostol
Copy link

mostol commented Apr 5, 2022

Just an update: A quick CSS change was merged into Documenter.jl (see above), so this should theoretically be cleared up whenever the Term.jl docs are built/published with the latest version including the fix.

(Hats off to @cormullion for very conveniently already having the necessary CSS file hosted and ready-to-import.)

@FedeClaudi
Copy link
Owner

By the way, is there any advice on how ti display stuff like progress bars?
To print progress bars Term needs to do some terminal magic, and that doesn't seem to play well with how the docs are rendered: https://fedeclaudi.github.io/Term.jl/dev/adv/progressbars/, any advice?

I also seem to have broken something at the bottom of this page: https://fedeclaudi.github.io/Term.jl/dev/basics/colors/

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

4 participants