Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ocsigen/tyxml
Build valid HTML and SVG documents
https://github.com/ocsigen/tyxml
html ocaml ocsigen svg
Last synced: 3 months ago
JSON representation
Build valid HTML and SVG documents
- Host: GitHub
- URL: https://github.com/ocsigen/tyxml
- Owner: ocsigen
- License: other
- Created: 2013-07-29T22:07:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-17T05:46:57.000Z (6 months ago)
- Last Synced: 2024-05-17T12:55:17.303Z (6 months ago)
- Topics: html, ocaml, ocsigen, svg
- Language: OCaml
- Homepage: https://ocsigen.org/tyxml/
- Size: 41.7 MB
- Stars: 162
- Watchers: 19
- Forks: 56
- Open Issues: 56
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: docs/Contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - tyxml
README
# TyXML
TyXML is a library for building statically correct HTML5 and SVG documents:
```ocaml
open Tyxml
let to_ocaml = Html.(a ~a:[a_href "ocaml.org"] [txt "OCaml!"])
```Tyxml can also be used with the standard HTML syntax, using the PPX:
```ocaml
open Tyxml
let%html to_ocaml = "OCaml!"
```Finally, TyXML can be used with Reason's JSX syntax:
```reason
open Tyxml;
let to_reason = "Reason!"
```TyXML provides a set of combinators which use the OCaml type system
to ensure the validity of the generated document.
TyXML can be used on a wide variety of context, either to produce
textual documents, to manipulate
the DOM tree using [Js_of_ocaml][], build virtual DOM with [virtual-dom][],
or for tierless web programming with [Eliom][].The documentation can be consulted
[on the TyXML website](https://ocsigen.org/tyxml/). Examples are
available in the [examples](examples) directory.[Eliom]: https://ocsigen.org/eliom/latest/manual/clientserver-html.html
[Js_of_ocaml]: https://ocsigen.org/js_of_ocaml/latest/api/js_of_ocaml-tyxml/Js_of_ocaml_tyxml/Tyxml_js
[virtual-dom]: https://github.com/janestreet/virtual_dom## Installation
TyXML is available in [OPAM](https://opam.ocaml.org/):
```sh
opam install tyxml
```To install the PPX:
```sh
opam install tyxml-ppx
```To install the JSX:
```sh
opam install tyxml-jsx
```