Introduction
👋Greetings! This EJS User Documentation aims to provide you with a concise yet informative introduction to EJS and its advantages when it comes to creating dynamic web applications. Whether you are just starting out, rest assured that this documentation will assist you in gaining a better understanding of EJS.
What is EJS?
EJS, which stands for Embedded JavaScript, is a powerful tool that allows developers to generate HTML markup for web pages. With EJS, you can create reusable and dynamic content that can be easily rendered on your web applications. This guide is specifically designed for beginners who are interested in learning about EJS and its capabilities for building dynamic web applications.
Intended Users
This documentation is targeted toward the following users:
-
Beginner developers who are new to EJS and want to learn how to use it to build dynamic web applications.
-
Experienced developers who are already familiar with EJS but want to refresh their knowledge or learn new techniques.
-
Anyone who is interested in web development and wants to learn more about the benefits and capabilities of EJS as a templating language.
Prerequisite Knowledge
This documentation assumes the following:
-
Basic knowledge of HTML and CSS: EJS is a templating language that creates HTML markup. Knowing HTML and CSS can be useful when using EJS.
-
Basic knowledge of JavaScript: EJS uses JavaScript syntax to generate dynamic content. Understanding JavaScript concepts such as variables, functions, and loops can be beneficial.
-
Some familiarity with web development concepts: It's helpful to have a basic understanding of web development concepts such as server-side programming, HTTP requests, and rendering HTML pages.
Software Requirements
Note
Please click on the name of the software to go to the official download website!
-
Node.js: EJS runs on Node.js (JavaScript runtime environment).
-
Visual Studio Code : This is required to create and edit your EJS files. This documentation is using "Visual Studio Code". However, you can choose other code editor such as Sublime Text.
-
EJS module This documentation will guide you through the installation process of EJS 👍
Procedures Overview
-
This section guides you through the process of installing EJS on your local machine. The steps include checking for prerequisites such as having Node.js installed and creating a package.json file using the npm init command. Then, you will be instructed to run the command 'npm install ejs --save' in the project directory using the terminal.
-
This task explains how to create EJS templates and embed dynamic content within them. The process involves creating a new file with the .ejs extension in the views directory, adding basic HTML markup, using <%= %> tags to embed EJS code in the HTML markup, and passing dynamic data from the server to the EJS template using the res.render() method.
- Conditional statements in EJS templates
This task explains how to use conditional statements in EJS templates to display different content based on conditions. It covers the syntax for creating if statements, else statements, and else-if statements using various tags.
Creator
The following user documentation is created by :
Selina Se In Park (neulmisscj@gmail.com), Brian Xu (mattx0121@gmail.com)
The document uses syntax highlighting to distinguish code from text and uses headings to organize different sections.