Skip to content

Commit 762165b

Browse files
committed
1 parent 6efc776 commit 762165b

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

lib/html_f.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,18 @@ struct
502502

503503
let a_aria name = space_sep_attrib ("aria-" ^ name)
504504

505+
(* Microdata *)
506+
507+
let a_itemid = uri_attrib "itemid"
508+
509+
let a_itemprop = string_attrib "itemprop"
510+
511+
let a_itemref = space_sep_attrib "itemref"
512+
513+
let a_itemscope = constant_attrib "itemscope"
514+
515+
let a_itemtype = uris_attrib "itemtype"
516+
505517
type 'a elt = Xml.elt
506518

507519
type ('a, 'b) nullary = ?a: (('a attrib) list) -> unit -> 'b elt

lib/html_sigs.mli

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,24 @@ module type T = sig
694694
@see <https://www.w3.org/TR/wai-aria-1.1/#state_prop_def> List of WAI-ARIA attributes
695695
*)
696696

697+
(** {3 Microdata support} *)
698+
699+
(** {{: https://html.spec.whatwg.org/multipage/microdata.html} Microdata} is
700+
a specification written by the W3C, defining a set of additional HTML
701+
attributes that can be applied to elements to annotate content with
702+
specific machine-readable labels using schemas.
703+
*)
704+
705+
val a_itemid : Xml.uri wrap -> [> | `ItemID ] attrib
706+
707+
val a_itemprop : string wrap -> [> | `ItemProp ] attrib
708+
709+
val a_itemref : idrefs wrap -> [> | `ItemRef ] attrib
710+
711+
val a_itemscope : unit -> [> | `ItemScope ] attrib
712+
713+
val a_itemtype : Xml.uri list wrap -> [> | `ItemType ] attrib
714+
697715
(** {2:elements Elements} *)
698716

699717
val txt : string wrap -> [> | txt] elt

lib/html_types.mli

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,19 @@ type aria =
380380
| `Aria
381381
]
382382

383+
(** {2 Microdata} *)
384+
385+
type microdata =
386+
[
387+
| `ItemID
388+
| `ItemProp
389+
| `ItemRef
390+
| `ItemScope
391+
| `ItemType
392+
]
393+
383394
(** Common attributes *)
384-
type common = [ | core | i18n | events | aria ]
395+
type common = [ | core | i18n | events | aria | microdata ]
385396

386397
(** {1 Categories of HTML elements}
387398

0 commit comments

Comments
 (0)