(** this file exists because ocamllsp / merlin doesn't recognize metaocaml ~syntax~extension points. so all meta code is in separate file. thankfully for this project, the meta code is only during the implementation of router pattern matching *)
[@@@module (Sys.getenv "HOME" ^ "/u/webs/run__html.ml")]
[@@@module "%/../l9-pages.ml"]
module Html =
struct include Cow.Html include Run__html end

let about_make_pat name doc =
.< function "about" :: target :: [], query, o when name = target ->
let to_client = o#writer in
Io.Flow.copy_string begin Html.ok @@ Html.to_string @@ L9_pages.about name doc end to_client >.
[@metaocaml.functionliteral] [@@warning "-8"]

let not_found =
.< function _, _, o ->
let to_client = o#writer in
Io.Flow.copy_string begin Html.not_found @@ Html.to_string @@ L9_pages.not_found end to_client >.
[@metaocaml.functionliteral] [@@warning "-8"]

let version =
.< function ("version" :: _), _, _ -> traceln "KM-series Layer 9 version 0.2.0 aka. ~/layer9.02" >. [@metaocaml.functionliteral]
[@@warning "-8"]

let p xs = .<fun x ->
.~( Codelib.make_match .<x>. @@
xs @ [ version; not_found ]
)
>.