Wait, wait, I'm confused
Sourcing
After years of working with HTML, coders know that hyperlinks are specified using an href attribute and images are specified using a src attribute, but c'mon who remembers what to use for objects, forms and blockquotes?
There are many places in HTML where external URLs are specified, but it's all too arbitrary how it's done. Consider all these HTML tags, and the attributes used for their external source files:
semantax | attribute |
---|---|
a | href |
link | href |
area | href |
base | href |
img | src |
input | src |
source | src |
audio | src |
video | src |
embed | src |
track | src |
iframe | src |
img | src |
script | src |
object | data |
form | action |
blockquote | cite |
q | cite |
Sourceref syntax
BLUEPHRASE cleans this up by leveling the notation for URLs into sourceref notation: simply surround the path and file with grave accents ` ... `. When the BLUEPROCESSOR's smart technology encounters this notation, it uses the current semantic context to determine which HTML attribute to emit.
Here's a sample ...
and it's equivalent HTML ...
Pragmas with sourcerefs
The BLUEPHRASE notation for sourcerefs extends to pragmas as well. The use, enclosure, and include pragmas all specify external files using sourcerefs.
!use `standard-vars.blue`
!enclosure `template.blue`
!include `menu.blue`
Using BLUEPHRASE for config files
Software developers who develop configuration files will really appreciate how this consistency and ease of use works. The notation acts as both a delimiter — especially important when filename have spaces or special characters; and a syntactic shorthand — there's no need to specify a keyword for your key-value pairs.
Here's a real life example of an RWSERVE configuration file: