Compare commits

..

No commits in common. "dba0ad45507386926c034be83a32ffabdd8eba4e" and "c3c68f88d63d1f1cd47ecb0f97b4aa00d9aa02d9" have entirely different histories.

View file

@ -30,6 +30,7 @@ let
# TODO: add fields for upstream documentation references
# TODO: programmatically generate documentation
options = with lib; {
attrs = mkAttrs { };
categories = mkOption {
type = types.listOfUnique (types.enum content-categories);
};
@ -135,7 +136,7 @@ let
if isBool value then
if value then name else ""
# TODO: some attributes must be explicitly empty
else optionalString (toString value != "") ''${name}="${toString value}"''
else optionalString (toString value != "") ''${name}=${value}''
)
attrs)
);
@ -156,7 +157,6 @@ let
imports = [ element ];
options = {
inherit (element-types) html;
attrs = mkAttrs { };
};
config.categories = [ ];
@ -169,7 +169,6 @@ let
html = { name, ... }: {
imports = [ element ];
options = {
attrs = mkAttrs { };
inherit (element-types) head body;
};
@ -183,7 +182,6 @@ let
head = { name, ... }: {
imports = [ element ];
options = with lib; {
attrs = mkAttrs { };
# https://html.spec.whatwg.org/multipage/semantics.html#the-head-element:concept-element-content-model
# XXX: this doesn't implement the iframe srcdoc semantics
# as those have questionable value and would complicate things a bit.
@ -291,7 +289,6 @@ let
title = { name, ... }: {
imports = [ element ];
options.attrs = mkAttrs { };
options.text = mkOption {
type = types.str;
};
@ -303,17 +300,18 @@ let
base = { name, ... }: {
imports = [ element ];
# TODO: "A base element must have either an href attribute, a target attribute, or both."
options = global-attrs // { inherit (attrs) href target; };
attrs = mkAttrs { inherit (attrs) href target; };
config.categories = [ "metadata" ];
config.__toString = self: "<base${print-attrs self}>";
};
link = { name, ... }: {
imports = [ element ];
options = mkAttrs {
options = mkAttrs
{
# TODO: more attributes
# https://html.spec.whatwg.org/multipage/semantics.html#the-link-element:concept-element-attributes
inherit (attrs) href;
} // {
# XXX: there are variants of `rel` for `link`, `a`/`area`, and `form`
rel = mkOption {
# https://html.spec.whatwg.org/multipage/semantics.html#attr-link-rel
@ -346,13 +344,12 @@ let
# TODO: figure out how to make body-ok `link` elements
# https://html.spec.whatwg.org/multipage/semantics.html#allowed-in-the-body
config.categories = [ "metadata" ];
config.__toString = self: "<link${print-attrs self}>";
config.__toString = self: "<name${print-attrs self.attrs} />";
};
body = { name, ... }: {
imports = [ element ];
options = {
attrs = mkAttrs { };
content = mkOption {
type = with types;
# HACK: bail out for now