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.
This is relevant to my interests
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.
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
Thank you for being willing to change it!
Sorry to be a pest, but has there been any motion on this? I still see the .lhs files in Github rendered as Markdown...
@jm said he'll fix it on Monday - didn't say which one ;-) Would be great to see this one fixed!
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!
@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.
yes, fixing this would be great :)
The rendering seem to work better in Gist: https://gist.github.com/co-dan/171fbcf6a04c52d28440
@co-dan thats bird style lhs, not latex style .lhs. I think the issue is the latex style lhs gets very very bad rendering
Also relevant to my interests.
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.
If it's not tenable to fix, at least disable the rendering period for lhs files.
Please fix this ASAP.
I like the idea of posting here every day until this gets fixed.
@jstolarek yes, this may be needed. :)
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.
Yes, I've been waiting for this for a while. Thanks.
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.
Sure. Just tell us who is responsible for this now.
I haven't a clue, I'm sorry! Maybe @gjtorikian knows...?
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.
@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.
@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)
BUMP BUM BUMP
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
no highlighting is better than this mess of pseudo highlighting
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
Aw, I liked my Markdown .lhs :) https://github.com/ocharles/snaplet-oauth2/blob/master/examples/Main.lhs
@ocharles yeh, that is cool, but the LHS is hosed for latex style.
plus the whole question of "how can i share higlighted line numbers"
Remove rendering of literate Haskell.
This was breaking display of a lot of code files: see #196.
as @puffnfresh says, please merge this.
(i think we'll make this ticket a space leak until this gets addressed :) )
Really, browsing the GHC source via github is nearly impossible because of this bug right now.
Fixed in #266. I'll post back here when it's deployed.
are we there yet? :-)
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.
Big thumbs up!
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.
when will it be derollbacked? :)
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.
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
Yep, I deployed it again on Friday and things look good.
Thanks for fixing that @bkeepers! You've made many Haskellites (Haskellians? Haskellnauts? Haskellers?) very happy.
yes, the haskellers of the world owe you a thanks and a discretionary baked good or coffee or tea