7 ms·
Show HN: New markup language for fans of Haml and Markdown
- lytedev 8y agoI think this looks really great! Love the idea of the front matter enabling things like default classes. Writing HTML or markup using something like Haml or Pug is just so much more enjoyable than using raw HTML/XML. The structure is forcibly clearer and you simply type less. I know some who like Emmet, but this is so much better than that. It's too bad that sometimes it isn't an option! =(
- anthonybullard 8y agoActually just a method of enabling default classes for certain control sequences would be great, or some simple configuration for ie accessibility defaults(auto IDs, roles, etc). Give me that in a Markdown implementation and that's 99% of what I want. Awaiting the 30 responses to implementations that already have this...
- amingilani 8y agoI'm not sure if the advantages are significant enough over using haml markdown filters (last example) to warrant creating an implementation. Great idea though.
- spraak 8y ago[REDACTED]
- inem 8y agoYou're welcome! :)
- legulere 8y agoThe first example already seems so wrong as it sets the documents style in the content.
- dansingerman 8y agoI know I'm very likely to be in a minority here, but I hate both Haml and Markdown. I much prefer HTML and erb.
- zellyn 8y agoYou're not alone. I hate non-HTML languages for generating HTML. It's a perfectly fine syntax.
- dansingerman 8y agoAgreed! If I need to debug it in chrome inspector (or similar) I don't like to have to think in terms of the abstraction I'm using to get the result I want. Web development is complex enough (server side, js, css) without adding an abstraction layer to your markup too.
- dfee 8y agoI prefer to code in bits. The problem with HTML is it’s verbose. So folks like to save some keystrokes (and mistakes).
- anthonybullard 8y agoTry turning it over to non-technical people. You will be surprised at how non-intuitive html can be, and what extremely nasty things they will do when they decide to learn just a little bit, ie style attribute hacking galore. If you want dead simple, consistently styled content to be written by non-technical folks, Markdown is much better IMHO.
- zellyn 8y agoOh, markdown is great. I meant the things that are just different syntax for HTML.
- dnomad 8y agoThis is something that can change with a bit of training. All the "plain text" formatting languages tend to break down. They work until they don't and then somebody invents yet another text-based pseudo-markup language. Asciidoc is best of the worst but fundamentally it's a bad idea. If you're willing to make the investment in tools and training there's a lot of value in enabling people to write real HTML (and MathML) or, better, Docbook + domain-relevant XML that produces real UI-agnostic structured information. The problem here is that the tools are terrible or expensive or bloated. There's no reason why this should be the case and it's likely a real market opportunity.
- habitue 8y agoOk, so usually I'm not a fan of the sarcastic "Hey, you just reinvented X! We've been doing that since the 90s!" But in this case: <h2 class=“f2 helvetica strike”>Fancy title <strong>with some bold</strong></h2> Tachyons really seems to have reinvented the <font> tag. Like, exactly. Come on guys. Edit: Apparently I'm out of the loop, and this style (atomic css) is now good. I'll take this as an opportunity to learn to refrain from making snide comments about fields I am not deeply involved in
- abraham 8y agoThe font tag is considered obsolete by MDN. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fo...
- nocman 8y agoI'm trying to understand your point. Are you saying that in support of habitue's comment, or as a counter-argument?
- habitue 8y agoI interpreted abraham's comment as "Right, it's just like the font tag, but the font tag is deprecated, so we use this instead". Implicit in my original comment was that "everybody knows the font tag is a bad idea so this is a bad idea too", which I think abraham missed. That being said, apparently I'm wrong and this style is back in vogue. CSS Zen garden style design has just failed hard apparently, so this is how things are done.
- atombender 8y agoYou missed the point here. This is a marriage of two existing formats: Markdown, which you probably know, and HAML, a templating language that was popular with Rails and Sinatra for a while (less so these days, I think). HAML uses CSS-like syntax to allow you to write HTML more succinctly: %div.foo.bar means <div class="foo bar">, for example. It has tons of short of concise syntax to make it a more pleasant alternative to HTML. It uses whitespace-sensitive indentation, like Python, so no end tags. This isn't reinventing the font tag. It's an alternative to putting HTML in Markdown, which many people do because Markdown is very limited. Sometimes you need to insert something that isn't supported. Not saying this is good, just explaining how your criticism doesn't apply.
- ChuckMcM 8y agoThis is a worthy effort. Markdown isn't quite there in terms of slightly more complex web sites, and Haml is definitely more complex for the simple things than I would like. I currently have a scheme where I have combined a bit of the perl Template::Toolkit and markdown so that I can write %DIV sidebar% ##Interesting fact## This fact it tangentially related to the __content__ and will appear in a sidebar. %ENDDIV% Which throws the <div class="sidebar"> .. </div> around the content. Basically by slurping it through the toolkit first, then markdown second. It is still clunky and I always have to load all the perl dependencies after I do a significant upgrade to me dev machine but so far it works. I'll try to keep an eye on it.
- deleted 8y ago[deleted]
- chipotle_coyote 8y agoBefore Markdown, there was another plain text markup system called Textile, which seems to be all but forgotten -- and I'm not sure "Hamdown" has a lot of advantages over Textile, beyond being more familiar to fans of Haml. (Which could be very important for many use cases, of course.) The opening example in Hamdown's readme would look like this in Textile: h1. Main Title h2(f2 helvetica strike). Fancy title *with some bold* Some content I used to prefer Textile to Markdown (and I ran a web site using Textpattern, the CMS designed by Textile's creator, which still has one of the nicer template languages and plugin systems of any system I've used). I eventually gave up and joined the Markdown crowd, and I'm generally happy with it, but in some ways Textile is still superior. It has some aspects of Haml's "HTML but simpler" approach, but Textile still reads more like, well, text in a way that (at least to me) Haml mostly doesn't. https://txstyle.org https://txstyle.org
- apocalyptic0n3 8y agoWe use Textile on our Redmine install. It's not terrible, but it always seems like I am writing more markup than should really be necessary
- chipotle_coyote 8y agoIt's possible that Textile is a little bit too "middle ground": it's not trying to be a fully semantic markup language like AsciiDoc, but it's not as minimal as Markdown's "cover the common cases as easily as possible and fall back to HTML for everything else" approach, which I suspect is kind of what led Markdown to win. (Also what lets it get away with its "who needs specs" approach that drives some people nuts, of course.) That suggests Hamdown might also be too middle ground, although it'd be more familiar to folks who are already Haml fans. Personally I always found Haml a little off-putting, but I have absolutely no good reason why.
- fizx 8y agoI feel like they were both equally popular in ~2007, but Github-flavored markdown killed Textile.
- pspeter3 8y agoI think making the spec easy to write and easy to parse would be huge. Have you tried creating any parsers yet?
- inem 8y agoNope, no yet. But I've got few recommendations from hamlit gem author Takashi Kokobun. Takashi recommends to take a look at these gems: - https://github.com/judofyr/temple https://github.com/judofyr/temple - https://github.com/eagletmt/haml_parser https://github.com/eagletmt/haml_parser
- techntoke 8y agoIf you create it in Ruby, you're going to have a bad time. The reason I love Hugo is that it is fast and compiles. I'd love to see an optimized implementation of a markdown language and template engine in C, but Hugo is next best.
- rbjorklin 8y agoHow does this compare to RestructuredText?
- inem 8y agoRestructuredText seem to me like an alternative to Markdown. Hamdown idea is to enable automated content-generation by allowing ruby code embedding (like you can do with HAML)
- blattimwind 8y agorST is actually more like an easier to write and easier-to-read-as-plaintext HTML alternative, since it specifies a DOM-like document model, cross-document referencing and a well-formed mechanism for markup extensions.
- inem 8y agoHamdown author here. To make it clear the I don't see this as a replacement for HTML/ERB/whatever templating solution for your web app. The niche is rather narrow - it is for people who use static site generators like Jekyll/Middleman, and write content mostly in Markdown. I often simply want to do a quick look-and-feel experiment by styling some of the elements with Tachyons. This is where Markdown becomes a bottleneck. Another idea is to make front-matter a first class citizen of Hamdown so that you could add a bit of structured data on top of your blog post and use on the page. P.S. You kinda can achieve this with kramdown, but I find its syntax super-weird.
- masukomi 8y agoSo is this the "lean startup" equivalent of a Show HN? "I have this great idea. buy it here!" oh really we haven't implemented anything, but now that we see a bunch of people tried to buy it... I'm fine with the idea of running ideas past the community here, but this really feels like a bait and switch. It's not a new markup language. It's a new IDEA for a markup language.
- jwecker 8y agoIt doesn't look like it's trying to be a startup at all, just showing an idea to HN- but I guess you're saying it should be more of an "ask for early feedback on HN" instead of "Show HN"- which implies show something that is working. I'm OK with "Show HN" being the default idiom for anyone posting their own link. Guess it could have had a "(proposal)" or something in the title.
- techntoke 8y agoAgreed. I've seen this more and more where people link to incomplete proposals on GitHub, but have very misleading titles. At least they know how to work the system to get their content on the front page.
- IshKebab 8y agoWhy not just put HTML in your markdown? Lots of parsers support it, you rarely need it so who cares if it's ugly, it avoids having to learn another thing, and it lets you do anything.
- techntoke 8y agoBecause Markdown works really well for content creators, but it could use a few extra features. I am not a fan of the examples they used, but believe Markdown could use some revamping. `##### test` for example is not as efficient and easy to read as `#5 test`.
- berti 8y agoI disagree. The indentation of the extra #s makes it much easier to scan the document structure with your eyes. #5 would only make sense if you're only using your markdown as a source for translating to some other format and you want to save some typing.
- AlphaWeaver 8y agoThis reminds me of a fun personal project [0] I implemented a few years ago. Very similar syntax. [0]: https://github.com/weaversam8/ctml https://github.com/weaversam8/ctml
- inem 8y ago
- ___dam___ 8y agoYou missed one hell of an opportunity here when you didn't choose to call it... MarkHAML
- anater 8y agoThis is so clearly the best post. Where are the upvotes?
- bitofhope 8y agoI'm afraid I'll have to be one of the curmudgeonly naysayers, too. The nice thing about Markdown is that the source file is just as readable as the output. Haml and hamdown fail at this. If I'm gonna have a computer parse "%h2.f2.helvetica.strike" for me, it might as well handle an entire HTML document. Think of Markdown as a WYSIWYG format. The plaintext is the document, but there just happen to exist tools for automatically displaying it as HTML too. If something looks wrong as plaintext Markdown, you're doing Markdown wrong.
- BerislavLopac 8y agoOf course, there is an XKCD cartoon for every occasion: https://xkcd.com/927/ https://xkcd.com/927/
- krapp 8y agoI know this isn't the fault of the author but I don't like the way periods seem to be overloaded in the Haml example: %h2.f2.helvetica.strike The first period denotes a tag on the left and a class attribute on the right, but the other periods just denote sibling classes. They don't parse into the same syntax, and my instinct is to read it as (h2 (f2 (helvetica (strike))) but that's not what's happening. And adding significant whitespace to Markdown and everything else to me just serves to obfuscate and abstract away the one thing I most want in a markup language that emits HTML, which is to easily visualize the tree and the markup.
- javascriptPhD 8y agothank you for your service