Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an alternative to HTML? [closed]

Is there a language I can use to write my website's HTML, which:

  • converts to HTML without having to write the HTML directly
  • has all the power of HTML
  • is less verbose than HTML and XML

For example, it should be to HTML what CoffeeScript is to JS.

Also, what is your experience with whatever you suggest?

Also have a look at Comparison of web template engines and Scala Tags

like image 947
Alex Avatar asked Jul 07 '11 00:07

Alex


People also ask

How do you do HTML tags?

An HTML tag is a special word or letter surrounded by angle brackets, < and >. You use tags to create HTML elements , such as paragraphs or links. Many elements have an opening tag and a closing tag — for example, a p (paragraph) element has a <p> tag, followed by the paragraph text, followed by a closing </p> tag.

What is considered HTML content?

Copied! HTML stands for HyperText Markup Language. It is a standard markup language for web page creation. It allows the creation and structure of sections, paragraphs, and links using HTML elements (the building blocks of a web page) such as tags and attributes.

What is italic tag in HTML?

The <i> tag in HTML is used to display the content in italic style. This tag is generally used to display the technical term, phrase, the important word in a different language. The <i> tag is a container tag that contains the opening tag, content & closing tag. Syntax: <i> Contents</i>


1 Answers

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> 
like image 63
John Feminella Avatar answered Sep 28 '22 16:09

John Feminella