11 ms·
Elegant Markdown for a more civilized age
- autarch 15y agoWow, what a crazy idea. Decoupling parsing from output generation. What will those crazy Ruby kids think of next?
- jasonlotito 15y agoI wonder how many people are seeing the sarcasm, and how many think you are serious. =)
- pavel_lishin 15y agoWhat's the markdown tag for sarcasm again?
- stock_toaster 15y agonine whitespace characters at the end of a newline
- asolove 15y agoIt's especially interesting because this same idea is also responsible for saving Rails 3's ass from being far slower than Rails 2. Read through this discussion of how Rails 3 queries were sped up by using an AST decoupled from its final use: http://www.slideshare.net/tenderlove/zomg-why-is-this-code-so-slow http://www.slideshare.net/tenderlove/zomg-why-is-this-code-s....
- stephth 15y ago47 comments in this thread and this is the top comment. Could someone explain what value it adds to the conversation? I'm completely missing it.
- pyre 15y agoIt allows real computer scientists to laugh at stupid webdevs reinventing the wheel. </sarcasm> (Except no one was claiming that it was a novel idea, just that in the past, most Markdown processors just convert directly between Markdown and HTML, but now they are changing that. It's also funny that there seems to be some animosity in that post towards Ruby programmers for whatever reason. It's not like Markdown is an invention of Ruby, the reference implementation was written in Perl.)
- pshangov 15y agoAlso, fore a more robust and extensible Markdown parser, see the perl's Markdent: http://search.cpan.org/dist/Markdent/ http://search.cpan.org/dist/Markdent/
- stock_toaster 15y agoThe original upskirt markdown library, written by Natacha Porté[1], had a specific goal of separating the parsing of markdown and the generation of html. When github forked it, they apparently (according to Natacha's comments on her site) slowly added more and more logic which mingled and blurred the lines. Now this article seems to be coming from a standpoint that separation of the two concerns is somehow novel. A bit odd to say the least. I think this is where the o.p. was deriving sarcasm. Perhaps the real story is the separation of concerns in the ruby module wrapper, instead of at the c library level? I don't know. [1]: http://fossil.instinctive.eu/libupskirt/index http://fossil.instinctive.eu/libupskirt/index
- pavel_lishin 15y agoAt a certain point, isn't it easier to just write the HTML?
- jseliger 15y agoActually, this is related to a question I've thought about but never asked: if you're, say, writing a blog, why use Markdown over standard HTML? Does it give some advantage I'm not aware of?
- technoweenie 15y agoYou can write content faster if you're comfortable with the syntax. It also has the advantage of looking good unstyled and styled. The syntax tends to look like a styled plaintext email.
- lysol 15y agoAgreed. It gracefully degrades into something readable if parsing fails, which is not applicable to HTML.
- michaelschade 15y agoThis. I use Markdown syntax when writing blog posts since Posterous formats Markdown just fine and it lets me view my writing (mostly) unstyled in vim, which I personally find much more comfortable than some web-based editor.
- bergie 15y agoI do the same, though I guess this is more the fault of current web-based editors than of HTML itself. I'm trying to explore some ideas of simplicity in browser-based HTML editing with Hallo (http://bergie.github.com/hallo/ http://bergie.github.com/hallo/), but remains to be seen how well that works out. In the meanwhile there is always Markdown. And Vim.
- 15y ago
- FSX 15y agoNice. I like the idea with the renderers. I'm going to this idea a try too for my Python binding.
- rednaught 15y agoIs there any consensus on an improved/extended Markdown? Between MultiMarkdown, Github Flavored Markdown, Stack Exchange's additions, this new "elegant" markdown and others there seems to be bit of fragmentation in this idea of a simple markup.
- tanoku 15y agoNo, there isn't really a consensus. FWIW, this is not a "new elegant Markdown", this is a 100% standards compilant Markdown library, with optional support for some extensions that we found useful. The syntax for these extensions comes, basically, from the Markdown mailing list and PHP-Markdown Extra.
- technomancy 15y ago> this is a 100% standards compilant Markdown library Eh, what's that now? Isn't Markdown implementation-defined? I wasn't aware there was a spec, I thought it was just some notes on a dude's blog.
- benatkin 15y agoYes, it is just some notes on a dude's blog. Well put.
- rednaught 15y agoI don't know what he meant by that either.
- guywithabike 15y agoI think the "Markdown standard" could be considered to be Gruber's official docs: http://daringfireball.net/projects/markdown/syntax http://daringfireball.net/projects/markdown/syntax
- briteside 15y agoIs Maruku's metadata syntax supported? http://maruku.rubyforge.org/proposal.html http://maruku.rubyforge.org/proposal.html
- mcburton 15y agoexcellent. Maybe now there well be an elegant way to go from .markdown to .docx
- politician 15y agodocx, why?! You're being sarcastic, right? right?!
- sharkbrainguy 15y agoPandoc does that already http://johnmacfarlane.net/pandoc/ http://johnmacfarlane.net/pandoc/ Pandoc is written in haskell but there's c bindings to it https://github.com/toyvo/libpandoc https://github.com/toyvo/libpandoc so you can use it from anywhere.
- dotemacs 15y agoRedcarpet is great, but for code highlighting you can use pygments.rb, which has an embedded python in it and is therefore faster than albino. Check it out: https://github.com/tmm1/pygments.rb https://github.com/tmm1/pygments.rb
- joehewitt 15y agoI recently wrote something just like this for Node.js: https://github.com/joehewitt/markdom https://github.com/joehewitt/markdom It's used on http://uponahill.com http://uponahill.com to extract Flickr urls so I can query the Flickr API and get complete metadata about each photo. My gf, who does most of the writing/photography on the site, has found writing in Markdown and copy/pasting Flickr urls a pretty frictionless experience compared to the Wordpress CMS.
- benatkin 15y agoDarn...I was hoping it was pure javascript so I could run it client-side. Nicely done, though!
- stock_toaster 15y agoYou could try markdownjs[1]. [1]: https://github.com/evilstreak/markdown-js https://github.com/evilstreak/markdown-js
- benatkin 15y agoI already know about that and I like it. I wanted to see a different take on it, though! I'm going to take another look at it soon.
- deleted 15y ago[deleted]
- tedkimble 15y agoPerhaps because there's multiple 'markdown-ruby's and they all want to be distributed as RubyGems. More importantly, I rather like many of the names!
- rednaught 15y agoJust curious if there was a reason why this is not on the official Github blog?
- stephth 15y agoSpeaking of Markdown and Github, has anyone figured out a way to preview locally - with accuracy - how README.mdown files will look on the project page? Would Redcarpet 2 help solve this problem?
- deleted 15y ago[deleted]
- sukuriant 15y agoAm I the only one that found the font on that page distracting?
- Kwpolska 15y agoSomeone shall port this to Python (and possibly PHP).