Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown input also would be cool #10

Open
smondet opened this issue Jul 18, 2017 · 1 comment
Open

Markdown input also would be cool #10

smondet opened this issue Jul 18, 2017 · 1 comment

Comments

@smondet
Copy link

smondet commented Jul 18, 2017

If omd's output is fully valid, It shouldn't be hard to convert markdown to html and then to Tyxml?

@Armael
Copy link
Owner

Armael commented Jul 19, 2017

I just added a README that clarifies a bit the goal of the tool. It should indeed be easy to plug omd to tyxml's PPX; however I would say it is out of the scope of this tool. What tyxml-translator does is prettifying the output of tyxml's PPX, to make it human readable, and serve as a documentation tool demonstrating the correspondence between HTML and Tyxml combinators.

If you simply want to produce tyxml from markdown, then you can simply use tyxml's PPX, and it should be as easy as https://github.com/Armael/tyxml-translator/blob/master/src/translator.ml#L10 i.e.

let ocaml_of_html (lang : Ppx_common.lang) (s : string) : expression =
  Ppx_tyxml.markup_to_expr
    lang Location.none
    [Exp.constant (Const.string s)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants