Supporting the Entire HTML Spec with Macros
Let's create a DSL that supports the entire HTML spec with macros.
We'll cover the following...
We'll cover the following...
Using the tags text file
We’ve done great till now, but our goal is to create a first-class DSL. A single tag macro simply won’t cut it. Let’s elevate our sophistication by supporting all 117 valid HTML tags. We could write a hundred macros by hand, but let’s use the techniques we learned in the chapter Advanced Compile-Time Code Generation to save time and effort. As before, a quick internet search turned up a complete list of HTML tags. After a copy and paste into a flat text file, we end with a file of line-delimited tags.
Here’s a handful of lines from the file:
#
...