a programmable interface.
+$ page $: meta=info code=mime data=manx ==
a page has 3 parts: metadata, source code, and its state.
data.page is what you see when you navigate to a page in hawk.
it is the ui and the data for the page.
it's type is manx, an xml node.
code.page defines the logic of how data.page is produced.
the code is compiled against a command and returns a $load.
the type of code.page is $mime, having two parts:
p
: $mite: the content-type:
a path denoting what kind of code is here.
/text/plain
/text/javascript
/text/hawk-500
q
: $octs: the data
a mime is compatible with web response types.
this means that one day, you'll be able to store images and videos directly in hawk on your urbit.
the only truly programmable mite in hawk is hawk-500.
meta.page is the metadata for a page.
metadata is inherited from parent files.
for fine grained control of metadata inheritance see inheritance masking
there are few important metadata attributes that you may want to place on your pages:
/title
: %tas
text: human readable title for the page
(aka, the text that is shown in the browser tab)
if no, title is set, the path to this page will be used instead.
/pulse
: %f
flag: representing whether to occasionally refresh this page.
“refresh” means: send an empty card.
this is very useful for calling external apis on a timer. (ex: personal weather app)
/peek/public
: %f
flag: whether the page is readable on the clearweb
/poke/public
: %f
flag: whether the forms on the page can be submitted from the clearweb