-
Notifications
You must be signed in to change notification settings - Fork 45
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
Support structure definitions over multiple code fences #158
Comments
To fix that, you can write the snippets to a file, using the Maybe related to realworldocaml/book#3150 where code is written to a file but not executed. |
A work around that we use for these kind of examples in RWO is to extract the code fragments from actual example That works because in this case, |
1 second too slow, damn... |
We're currently just using https://github.com/CraigFe/irmin.io/blob/mdx-verification/data/tutorial/dune |
It's not ideal, since (as far as I understand) it requires one of:
What I have now is a literate programming workflow in which
However, it seems fine to me if Mdx maintainers decide that a literate programming workflow is out-of-scope and would be better filled by other (new) tools: e.g. Coqdoc for OCaml or literate Haskell for OCaml (both of these require an explicit 'render as Markdown' step, but have the advantages of also being renderable as e.g. LaTeX). For now, the |
I'm not sure I understand this specific point. The whole point of #205 and #234 is to make mdx files compatible with external markdown tools so that you don't need I understand that you don't want to maintain two files (one for the code and one for the doc) and this is a perfectly valid reason not to use "regular" mdx here. I'm not sure the other points are valid though. In particular you currently have to maintain a set of rules for properly invoking
The new mdx stanza is fairly light and keeping the example ml file and the doc in sync is just a matter of running I'm not trying to convince you that you should change your workflow but rather to better understand why the regular one doesn't currently suit you and/or what a litterate programming tool should look like. |
I agree in as much as it makes e.g. the
Hmm, isn't this a new point altogether? I didn't mention the
I'm not sure it's that effortless. Having any kind of manual sync step at all is a bit problematic since it gets in the way of incremental compilation / "development" servers that allow you to work against the rendered output. That's a shame, since it means you can't use such tools out-of-the-box, but again workarounds probably exist. It also makes the opam switch a compulsory part of the development environment, even for small things like typo/grammar fixes that are often done by non-maintainers. |
Ok I'm starting to understand. The main issue here really is the fact that the I'd argue that the
This was more of an answer about how much of burden it is to setup an example+sync workflow compared to a |
I think the main issue with the
This seems to be me just misunderstanding what a " A glance at RWO suggests that that isn't the case, and that Given that, I think my concerns with the |
We do really need to work on the documentation! |
The Irmin tutorials currently contain many instances of Markdown text within a module definition, e.g:
This is particularly important when tutorialising backend definitions, as these require several large module definitions. However, it appears that these are currently unsupported by
ocaml-mdx
:It would be nice if
mdx
would support this sort of pattern 🙂The text was updated successfully, but these errors were encountered: