As its name suggests the pre-processor is the first stage of the whole compiling process it includes removing the comments, expanding the macros, the inclusion of the headers, etc.
In HTML and CSS when it comes to writing it, It is a bit crucial as we have to do the same job again and again like closing the tab and repeating the same attribute for the same element and it will lead to inefficiency. To overcome these problems there exists the Pre-processors. So, The Pre-processors in HTML are nothing but the same as that in other languages, it takes the input in the form of data and it converts in other types of data. In the case of markups like HTML and CSS, the popular preprocessor includes Haml and Sass.
HTML preprocessor can also be understood as it is a program that helps the developer to generate the HTML syntax from the syntax of the preprocessor. It will add some unique features which do not present in the pure HTML syntax. As preprocessors are the programs they are always processed in some languages hence the Haml processed in HTML and Sass.
HAML Pre-processor: Haml stands for HTML Abstraction Markup Language created by Hampton Catlin and the only objective behind to create it is to make the markup beautiful. It is basically a Ruby-based pre-processor and required Ruby to be installed in your local machine for the Mac OS, Ruby comes preinstalled while for windows user can install it from here. To install the Haml follow the below commands.
gem install haml
haml index.haml index.html
Note: Command should be run inside the same directory where the index file resides.
- Code for the header in Haml Pre-Processor:
%bA Computer Science Portal for Geekschevron_right
- HAML code code converted in HTML:
>A Computer Science Portal for Geeks</
- Output : The output of the above HTML or the HAML code.
Note: The Haml code will reduce the code readability for the HTML code but code reduced syntactically and also by line.
- How to append class if condition is true in Haml?
- CSS Preprocessor | SASS
- CSS Preprocessor | LESS
- HTML | <html> Tag
- HTML Course | Structure of an HTML Document
- HTML Course | Basics of HTML
- HTML | DOM HTML Object
- HTML | <html> xmlns Attribute
- What is the difference between <html lang="en'> and <html lang="en-US'> ?
- Inline HTML Helper - HTML Helpers in ASP.NET MVC
- Web technologies | HTML and XML | Question 1
- HTML | scoped Attribute
- HTML | DOM lang Property
- HTML | <section> Tag
- HTML | DOM Style backgroundClip Property
- HTML | DOM Style borderTop Property
- Web technologies Questions | HTML Course | Practice Quiz 2 | Question 1
- Web technologies Questions | HTML Course | Practice Quiz 2 | Question 7
- Web technologies Questions | HTML Course | Practice Quiz 2 | Question 8
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.