realworldocaml / mdx

Execute code blocks inside your documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confused about behavior

opened this issue · comments

I'm very new to using this tool. I'm trying to use the pp option. I'm unsure about what the intended usage is for the file inclusion.

I have a markdown file with one inline ocaml snippet and one snippet that uses the file sync feature. When I run ocaml-mdx pp readme.md, I only see the inline snippet. Is that intentional? If so, should I use the following to validate the file?

ocamlc -impl snippet.ml -o ... # validate external snippet
ocamlc -pp 'ocaml-mdx pp' -impl readme.md -o ... # validate inline snippets

I wasn't able to deduce this from the README instructions.

Hi, it looks like you need the mdx test command instead of mdx pp, you can also have a look at how to use mdx from dune (see https://dune.readthedocs.io/en/latest/dune-files.html#mdx-since-2-4)