Is there an alternative to HTML? [closed]

A good choice is Haml. In Haml, you write highly structured markup that resembles a stripped-down form of HTML, and where common things have easy shortcuts. For example, adding an element, div, id, or class is done just by changing one character.

It even lets you pass variables in and operate on them in the language of your choice by deferring to a scripting language, so it's actually more powerful than HTML since the implicit scripting makes it Turing-complete.

Here's an example:

  %body
    #header
      %h1 Bob Loblaw's Law Blog
      %h2 by Bob Loblaw
    #content
      - @entries.each do |entry|
        .entry
          %h3.title= entry.title
          %p.date= entry.posted
    #footer
      %p
        All content copyright © Bob Loblaw.

This becomes something like:

<div id='header'>
  <h1>Bob Loblaw's Law Blog</h1>
  <h2>by Bob Loblaw</h2>
</div>
<div id='content'>
  <div class='entry'>
    <h3 class='title'>You don't need double-talk; you need Bob Loblaw</h3>
    <p class='date'>Tuesday, October 31, 2006</p>
  </div>
  <div class='entry'>
    <h3 class='title'>Why should you go to jail for a crime someone else noticed?</h3>
    <p class='date'>Friday, August 11, 2006</p>
  </div>
</div>
<div id='footer'>
  <p>
    All content copyright © Bob Loblaw.
  </p>
</div>

A friend and I just started Layx: a new layout language based on Cassowary, the constraint solving toolkit that Apple is using for their user interfaces. It's only for web now, but it will be multiplatform -mobile natively- someday.

It is designed to be extremely simple and easy (like python), and as asked, it compiles internally to HTML, dynamically, as the interface has to be updated if layers have to be moved or resized.

It's a really new project -alpha version-, so try it knowing that.

Project website: http://www.layx.org/

Online demo: http://www.layx.org/demo/

Open Source repository: http://github.com/layxlang/layx

I hope it helps and feedback is always welcome!

Regards

EDIT (8 Jan, 2015): Open source link added

EDIT (15 Jan, 2015): Demo link added


You're essentially asking for a lightweight markup language that can be converted to HTML, popular/well-known examples of which include BBCode, Markdown, and MediaWiki markup.


I know the question is old but I got to it searching for answers, and I thought I would update the replies with my own.

As already pointed, the question asks primarily for template engines (not so much languages) as the point is generating HTML.

If the objective is to be consistent with CoffeeScript, then CoffeeKup is the way to go. Personally, among the ones that I have seen, in the search for terseness, Pug is the one that looks best to me, it is heavily influenced by Haml (accepted and top answer), and improves it (IMHO) in several aspects: more terse, more elegant and clear (subjective, fair enough) and does not require Ruby, as it is JavaScript based.