Skip to content

A tool to eliminate repetition of code in static HTML pages

Notifications You must be signed in to change notification settings

prakashraman/incme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

INCME

INCME (Include Me) is a tool that eliminates the repetition of code when you have to create static HTML pages.

USAGE

$ ruby simple-site-maker.rb --source-dir=<path-of-source-dir> --dest-dir=<path-to-dest-dir>

source-dir : The directory that contains the html pages and the include pages
dest-dir: The directory to be created with the generated pages

HOW IT WORKS

All the pages are parsed through for the [[inc: <include_file_name>]] tag and that tag is replaced with the contents of the include_file. Thats it !

include_file: the include file needs to be available at /includes/<include_file_name>

Note: currently js, exe, gif, png, jpeg files are not parsed

SOURCE FOLDER STRUCTURE

|- _includes_
|- <remaining files>
\- <remaining files>

_includes_ : This folder must contain all the include_files that can be accessed via [[inc: <include_file_name>]]. This is the only mandatory folder

EXAMPLE

source folder structure
source 
|- _includes_
   |- header
   \- footer
|- index.html
\- logo.png
contents of header: (include file)
<html>
<head>
 <title>Simple Site Maker</title>
<head>
<body>
contents of footer: (include file)
</body>
</html>
contents of index.html
[[inc: header]]
<img src="logo.png">
Hello World
[[inc: footer]]

Run the below command

$ ruby simple-site-maker.rb --source-dir=source --dest-dir=gen

#"gen" folder is created with "index.html" in it
contents of the generated gen/index.html
<html>
<head>
 <title>Simple Site Maker</title>
<head>
<body>
<img src="logo.png">
Hello World
</body>
</html>

Thats it !

About

A tool to eliminate repetition of code in static HTML pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages