Chris,
This is absolutely possible but you need access to the HTML file in question first. To summarize, the macro would:
1) Read the html file
2) Parse out the elements with IDs
3) Add static inline fields to the class just like the example does for files.
Step 2 might be the hardest, I'm not sure of the best tool to do that in Haxe.
Cheers,
-tim