Skip to content

SHML-Lang/SHML-Lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


ShellScript Hypertext Markup Language

Generates dynamic HTML content via ShellScript.



INSTALL

Requirements: Web Server (Apache2 | Nginx) and FCGI Wrap

LINUX (Debian)

FCGI Wrap

debian@debian:~$ su

root@debian:~# apt install fcgiwrap

Apache2 Modules

debian@debian:~$ su -

root@debian:~# a2enmod proxy_fcgi

root@debian:~# /etc/init.d/apache2 restart


SHML

root@debian:~# sh install.sh

  • Your shell functions must be declared or included in the file: /usr/share/shml/library.sh

  • Place the index.shml file in the public directory of the web server.


index.shml

<!DOCTYPE html>
<html>
<head>
<title>SHML <% version() %></title>
</head>
<body>
<!--

Block comment...

-->
<h1>It worked! <% print("Welcome!") %></h1>
<!-- Inline comment -->
<hr>
<h2><% hello_world() %></h2>
<h3><% date(%Y-%m-%d) %></h3>
</body>
</html>

Result:


<!DOCTYPE html>
<html>
<head>
<title>SHML 1.0.0</title>
</head>
<body>
<h1>It worked! Welcome!</h1>
<hr>
<h2>Hello World!</h2>
<h3>2022-10-20</h3>
</body>
</html>