Zulip Chat Archive

Stream: lean4

Topic: copy code from alectryon


Adam Topaz (Nov 23 2022 at 03:40):

Is it just me or does copying code blocks from an alectryon documentation result in some crazy additional whitespace?
E.g. copying the first code block from here: https://leanprover.github.io/lean4/doc/examples/tc.lean.html
results in the following

inductive

Expr where
  |

nat  :

Nat 

Expr
  |

plus :

Expr 

Expr 

Expr
  |

bool :

Bool 

Expr
  |

and  :

Expr 

Expr 

Expr

Adam Topaz (Nov 23 2022 at 03:40):

I can't imagine this is expected behavior?

Henrik Böving (Nov 23 2022 at 05:16):

This is expected behavior. Alectryon renders the code as dozens and dozens of small HTML fragments with individual class etc. The newlines themselves are also special HTML fragments. And I guess if your browser thinks it should insert some newlines itself between fragments this is what ends up happening?

Mario Carneiro (Nov 23 2022 at 05:23):

There are definitely ways to fix this. For example, github code is highlighted but it does not do this

Mario Carneiro (Nov 23 2022 at 05:26):

it looks like the issue is the inline divs for every conceivable hover

Mario Carneiro (Nov 23 2022 at 05:39):

setting display: none on class alectryon-type-info-wrapper fixes the issue for me

Sebastian Ullrich (Nov 23 2022 at 09:07):

Right, but then how do we make them visible? Toggling display seems to break the transition-delay.


Last updated: Dec 20 2023 at 11:08 UTC