tyxml icon indicating copy to clipboard operation
tyxml copied to clipboard

Add support for Microdata

Open toastal opened this issue 6 months ago • 10 comments

See: https://html.spec.whatwg.org/multipage/microdata.html

[^1]

[^1]: Please consider giving up MS GitHub or offering a non-proprietary, non-US-corporate-controlled mirror for this free software project. I wish to delete this Microsoft account in the future, but I need more projects like this to support alternative methods to send patches & contribute.

toastal avatar May 13 '25 12:05 toastal

These build errors also happen on the default branch. Just did a fresh checkout to find:

File "ppx/tyxml_ppx.ml", line 381, characters 18-65:
381 |   | Pexp_function (params, constraint_, (Pfunction_body content)) ->
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This pattern matches values of type 'a * 'b * 'c
       but a pattern was expected which matches values of type case list
Generating: index.html  

I have been using this branch in a Nix overlay for 2 weeks now.

toastal avatar May 26 '25 18:05 toastal

It appears to me dune test fails starting at 7b11831d7bbda6804c3efda3ac469eb3b198ec96 from #340

toastal avatar May 26 '25 18:05 toastal

@smorimoto

toastal avatar May 27 '25 11:05 toastal

Could you please rebase this?

smorimoto avatar May 27 '25 11:05 smorimoto

Local said I was up to date. I will force push again… it could have been a miss timing.

toastal avatar May 27 '25 11:05 toastal

$ git checkout microdata 
Switched to branch 'microdata'
$ git pull --rebase upstream master
From https://github.com/ocsigen/tyxml
 * branch              master     -> FETCH_HEAD
Current branch microdata is up to date.
$ dune clean
$ dune test --stop-on-first-error
File "ppx/tyxml_ppx.ml", line 381, characters 18-65:
381 |   | Pexp_function (params, constraint_, (Pfunction_body content)) ->
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This pattern matches values of type 'a * 'b * 'c
       but a pattern was expected which matches values of type case list

@smorimoto this is the same error the CI was giving

toastal avatar May 27 '25 11:05 toastal

reping @Drup

toastal avatar Jun 12 '25 19:06 toastal

@smorimoto @Drup I added 2 commits. 1) found a typo 2) trying to add in flow content which is what the spec says: https://html.spec.whatwg.org/multipage/dom.html#flow-content

That last bit, I’m very unsure of my design with constraints with the OCaml type system, but <meta itemprop> needs to be allowable & is common for use with microdata.

toastal avatar Jun 21 '25 16:06 toastal

I would like to run the test suite but I can’t with

$ dune test
File "ppx/tyxml_ppx.ml", line 381, characters 18-65:
381 |   | Pexp_function (params, constraint_, (Pfunction_body content)) ->
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This pattern matches values of type 'a * 'b * 'c
       but a pattern was expected which matches values of type case list

Tried switching to OCaml 5.2 as well to no avail.

toastal avatar Jun 21 '25 17:06 toastal

Cherry-picking out typos & syntax errors to keep focus here

toastal avatar Jun 21 '25 18:06 toastal