X

The missing HTML verb has been found

Including

So what's the deal with HTML not having an "include" feature? Countless solutions have arisen to solve this problem, but few are as straightforward as blue-phrase.

How many times have you written a web page to fulfill a particular need, where large parts of it were already written to some other source file? This is such a common task that there really should be some standard way, with only HTML, to pull source files together. But alas, there isn't.

Blue-phrase provides this feature with its include pragma. The notation is simple: just type the path and name of the source file, and surround it with grave accents ` ... `

Here's what it might look like in action:

h1 Minifigures
!include `./menu/minifigures.blue`

h1 Today's Deals
!include `./menu/specials.blue`
outlandish.blue
nav {
a `harry-potter.blue` Harry Potter
a `batman.blue` Batman
a `simpsons.blue` Simpsons
a `lord-of-the-rings.blue` Lord of the Rings
a `marvel.blue` Marvel
a `tmnt.blue` Teenage Mutant Ninja Turtles
a `scooby-doo.blue` Scooby Doo
a `pirates.blue` Pirates of the Caribbean
a `jurassic-park.blue` Jurassic Park
a `dr-who.blue` Dr. Who
a `star-wars.blue` Star Wars
}
menu/minifigures.blue
nav {
a `ninjago.blue` Ninjajo
a `party.blue` Party
a `monsters.blue` Monsters
}
menu/specials.blue

And here's the HTML result:

<html>
<head>
<title>Placeholder</title>
<meta charset=UTF-8 />
</head>
<body>
<h1>Minifigures</h1>
<nav>
<a href='harry-potter.blue'>Harry Potter</a>
<a href='batman.blue'>Batman</a>
<a href='simpsons.blue'>Simpsons</a>
<a href='lord-of-the-rings.blue'>Lord of the Rings</a>
<a href='marvel.blue'>Marvel</a>
<a href='tmnt.blue'>Teenage Mutant Ninja Turtles</a>
<a href='scooby-doo.blue'>Scooby Doo</a>
<a href='pirates.blue'>Pirates of the Caribbean</a>
<a href='jurassic-park.blue'>Jurassic Park</a>
<a href='dr-who.blue'>Dr. Who</a>
<a href='star-wars.blue'>Star Wars</a>
</nav>
<h1>Today's Deals</h1>
<nav>
<a href='ninjago.blue'>Ninjajo</a>
<a href='party.blue'>Party</a>
<a href='monsters.blue'>Monsters</a>
</nav>
</body>
</html>
outlandish.html

The missing HTML verb has been found