-
Notifications
You must be signed in to change notification settings - Fork 409
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 for literate programming #895
Comments
An update:
|
To support that we just need to generalize reason support. We can have a way to setup a scheme for source files:
Then dune would automatically recognize .mdx files as implementation file and .mdxi files as interface files. |
Note that the file extension will remain |
@samoht This looks very cool! Does it make sense to have support for odoc too? Although markdown is a very popular format (and the one supported by GitHub), the main documentation format we use for all our packages is still ocamldoc. It would be very useful to have this feature in the |
@rizo there should be no need to do anything special to have support for odoc since odoc takes cmt files as input |
What are |
Ah, I misunderstood the question. @samoht, mld files are additional odoc files that use the ocamldoc syntax. For instance you may have an index.mld file. |
@samoht So to clarify my question. If I have an I would be very interested in contributing support for odoc. EDIT: Here're some WIP docs for |
Yes that would be possible. Currently |
Excellent, thank you! :-) Opened an issue as you suggested: https://github.com/samoht/mdx/issues/17. |
Update: I started working on the code block extraction logic in odoc (ocaml/odoc#303). This will allow us to annotate and extract code blocks found in I wrote a document about this feature, it explains how the dune integration could work. The design is still in flux, but if you have any ideas or suggestions for this feature, please let me know. |
We've added first class support for dialects. I think literal programming should fall under that. If dialects are in any way deficient, please raise separate issues. |
It would be nice if we could have first-class support for literate programming in
dune
. The idea would be to tag certain files as "file which needs to be pre-processed" to generate a file in a way very similar to what is done for the Reason support.And example is here where the
ocaml
code blocks in a markdown file can be extracted into a self-contained.ml
file which can compiled and linked like a normal OCaml file.A bonus would be to support setting various pre-processor (using different aliases I guess), for instance to set-up cram-tests (e.g. check that
::
and1>
outputs are correct). This is related to #622 and #771The text was updated successfully, but these errors were encountered: