Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Not all .lhs files are Markdown format #196

Closed
goldfirere opened this Issue · 55 comments
@goldfirere

A new markup mode was recently (Oct 2012) added to render .lhs files as Markdown with some extra goodies to support Haskell. The problem is that not all .lhs files use Markdown-style comments. In particular, the code for GHC -- the main Haskell compiler -- which is hosted on github does not use Markdown formatting. For example, see this file and scroll down. It's illegible. Is there a way to detect Markdown formatting and only apply the markup magic if the comments really are Markdown?

I notice that .lhs files seem to be the only "code" files that are markup'd -- the other formats do really seem to be meant to be pretty. Markup'ing also removes line numbers, which makes github less useful for code browsing.

Thanks!

@jstolarek

This is relevant to my interests

@dagit

I've yet to see anyone treat .lhs files as markdown. So, I 100% agree with the OP that github should stop rendering .lhs as markdown. Plus all the reasons cited about ghc. The only solution I've found is to view lhs modules as "raw", but then you lose out on the pygments syntax highlighting.

@jm
jm commented

Whoops, my fault. I'll fix it Monday-ish.

Sorry for the hassle (I'm not a Haskeller by trade). If you want to add the code yourself before I get to it, it lives at http://github.com/jm/literati

@dagit

Thank you for being willing to change it!

@goldfirere

Sorry to be a pest, but has there been any motion on this? I still see the .lhs files in Github rendered as Markdown...

Thanks!

@jstolarek

@jm said he'll fix it on Monday - didn't say which one ;-) Would be great to see this one fixed!

@jm
jm commented

So sorry about dropping the ball on this one; I'll likely just back out my changes until I can figure out something smarter. :) It's on my list of things to do now!

@jstolarek

@jm, would it be possible that you withdrew changes that you mentioned in your comment? This issue is still unsolved and with the incorrect displaying of .lhs files it's almost impossible to browse GHC sources.

@cartazio

yes, fixing this would be great :)

@Mikolaj

Yes, please!

@co-dan

The rendering seem to work better in Gist: https://gist.github.com/co-dan/171fbcf6a04c52d28440

@cartazio

@co-dan thats bird style lhs, not latex style .lhs. I think the issue is the latex style lhs gets very very bad rendering

@co-dan
@mrdomino

Also relevant to my interests.

@cartazio

Bump. I had to upload a repo to bitbucket to even sanely communicate about an .lhs file.

Please fix this. I'll pester y'all every day If need be. Can I pester you every day?

No highlighting period would be better than this. Please.

@cartazio

If it's not tenable to fix, at least disable the rendering period for lhs files.

@sseveran

Please fix this ASAP.

@mrdomino
@jstolarek

+1

I like the idea of posting here every day until this gets fixed.

@cartazio

@jstolarek yes, this may be needed. :)

@NathanHowell

Looks like there are a few pull requests in the Literati repo that have been open for a few months... I was considering learning enough Ruby to fix it but it doesn't seem like he's spending any time on the project. :disappointed:

@Mikolaj

Please.

@goldfirere

Yes, I've been waiting for this for a while. Thanks.

@jm
jm commented

I'm no longer with GitHub, so I can't help. Sorry about that. Maybe one of the folks still there can either remove literati from the rendering or commit to fixing it.

(cc @NathanHowell)

@jstolarek

Sure. Just tell us who is responsible for this now.

@jm
jm commented

I haven't a clue, I'm sorry! Maybe @gjtorikian knows...?

@bkeepers
Owner

I'm looking into this now.

@jm What would the appropriate fix be? I can just remove literati, but no clue what the effects of that would be.

@jm
jm commented

@bkeepers Removing it would prevent the issue originally raised, but I guess the "best" fix is to patch literati to figure out if it's a literate Haskell file or not (pull all the comments, look for "Markdown-ness" in them?). If someone makes a PR for it on the repo, I'll merge it, but it might behoove you all to make a fork owned by @github. :smile:

@cartazio

@bkeepers one solution would be to actually have both a "document" and "code" highlighting modes for literate code files I think. (because both are valid, and both are a bit different afaik)

NB: an unrelated issue in haskell parsing (while i have your attention) is how the syntax for lifted types in datakinds are parsed as string openers https://github.com/alphaHeavy/llvm-general-typed/blob/master/src/LLVM/General/Typed/CallingConv.hs
(that said, that gets into issues of having proper parser for syntax highlighting, so thats probably out of scope)

@cartazio

BUMP BUM BUMP

@cartazio

When can i actually read https://github.com/ghc/ghc/blob/master/compiler/types/Type.lhs on the web like a human being who wants to highlight a range of line numbers and share a link like a human being

@cartazio

no highlighting is better than this mess of pseudo highlighting

@mrdomino
@cartazio

indeed. I will owe a coffee or beer or pastry or equivalent to the first person who fixes this.

I will happily pay for coffee / snack / free nerd sniping talking about cool stuff to said person when in the right city.

I mean it.

I thus declare a bounty on this ticket

@cartazio

@ocharles yeh, that is cool, but the LHS is hosed for latex style.

@cartazio

plus the whole question of "how can i share higlighted line numbers"

@pozorvlak pozorvlak referenced this issue from a commit in pozorvlak/markup
@pozorvlak pozorvlak Remove rendering of literate Haskell.
This was breaking display of a lot of code files: see #196.
73d5ebd
@cartazio

as @puffnfresh says, please merge this.

(i think we'll make this ticket a space leak until this gets addressed :) )

@bennofs

:+1: Really, browsing the GHC source via github is nearly impossible because of this bug right now.

@bkeepers
Owner

Fixed in #266. I'll post back here when it's deployed.

@cartazio

are we there yet? :+1: :-)

@bkeepers
Owner

Alright, #266 is deployed. It's very likely that your document is cached, so you may need to push a change to it for the cache to be cleared.

@bkeepers bkeepers closed this
@jstolarek

Big thumbs up!

@bkeepers
Owner

Sorry, I had to roll back this change on GitHub. We ran into some other bugs that appears to have been introduced in github-markup 1.0.3, but we never deployed that update.

@cartazio

when will it be derollbacked? :)

@bkeepers
Owner

Working on it. It is a rather complicated encoding bug that was exposed in the version of posix-spawn that we're using. I'll post here when it's fixed.

@cartazio

it seems to be fixed now looking at the GHC code + examples like https://github.com/spacekitteh/haskell-clifford/blob/feature/dynamics/src/clifford.lhs

thanks!

@bkeepers
Owner

Yep, I deployed it again on Friday and things look good.

@jm
jm commented

Thanks for fixing that @bkeepers! You've made many Haskellites (Haskellians? Haskellnauts? Haskellers?) very happy. :+1: :metal:

@cartazio

yes, the haskellers of the world owe you a thanks and a discretionary baked good or coffee or tea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.