-
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
WIP: Add a manual using odoc and .mld
files
#355
base: main
Are you sure you want to change the base?
Conversation
412c257
to
6130320
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some minor line editing, as well as grammar and syntax suggestions. Please let me know if you're looking for a different type of feedback as well.
|
||
Welcome to the MDX Manual! | ||
|
||
MDX is a tool to help developpers and authors keep their documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDX is a tool to help developpers and authors keep their documentation | |
MDX is a tool to help developers and authors keep their documentation |
It ensures that the code examples you write compile and behave the way you | ||
expect them to by actually running them. | ||
|
||
It is for example used to verify all of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is for example used to verify all of | |
For example, you can use MDX to verify all |
It is for example used to verify all of | ||
{{:https://dev.realworldocaml.org/}Realworlocaml}'s examples! | ||
|
||
MDX is released on opam. You can install it in your switch by running: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDX is released on opam. You can install it in your switch by running: | |
MDX is released on Opam, so you can install it in your switch by running: |
|
||
{1 Basic Usage} | ||
|
||
You can use MDX with your Markdown or [.mli] documentation, where it will ensure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use MDX with your Markdown or [.mli] documentation, where it will ensure | |
You can use MDX with your Markdown or [.mli] documentation, which ensures |
{1 Basic Usage} | ||
|
||
You can use MDX with your Markdown or [.mli] documentation, where it will ensure | ||
the correctness of code respectively written in multi-line code blocks and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the correctness of code respectively written in multi-line code blocks and | |
correct code written in multiline code blocks and |
doc/labels.mld
Outdated
This label allows you to assign an environment to an OCaml block. That means | ||
you benefit from whole the code that has been previously evaluated in that | ||
environment, be it from other code blocks or {{!page-preludes}preludes}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label allows you to assign an environment to an OCaml block. That means | |
you benefit from whole the code that has been previously evaluated in that | |
environment, be it from other code blocks or {{!page-preludes}preludes}. | |
This label allows you to assign an environment to an OCaml block. That means | |
you benefit from all the previously evaluated code in that | |
environment, be it from other code blocks or {{!page-preludes}preludes}. |
The environement label expects a single string value which corresponds to the | ||
name of the environment to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environement label expects a single string value which corresponds to the | |
name of the environment to use. | |
The environment label expects a single string value that corresponds to the current environment's name. |
When absent, the block will be evaluated in the default environment, e.g. | ||
the environment shared by all blocks without an [env] label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When absent, the block will be evaluated in the default environment, e.g. | |
the environment shared by all blocks without an [env] label. | |
When absent, the block will be evaluated in the default environment, e.g., | |
the environment shared by all blocks without an [env] label. |
Preludes are fragments of code that can be evaluated ahead of running the | ||
code in OCaml and OCaml toplevel MDX blocks. They can be used to globally | ||
open modules, register toplevel printers, set some globals like | ||
[Printexc.record_backtrace], you name it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preludes are fragments of code that can be evaluated ahead of running the | |
code in OCaml and OCaml toplevel MDX blocks. They can be used to globally | |
open modules, register toplevel printers, set some globals like | |
[Printexc.record_backtrace], you name it! | |
Preludes are fragments of code that can be evaluated ahead of running the | |
code in OCaml and OCaml toplevel MDX blocks. They can globally | |
open modules, register toplevel printers, set some globals like | |
[Printexc.record_backtrace], and more! |
They are especially useful if you want to hide or share this kind of setup | ||
phase, e.g. if you are writing polished documentation you want to publish | ||
or you are using MDX to add tests in your mli files directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are especially useful if you want to hide or share this kind of setup | |
phase, e.g. if you are writing polished documentation you want to publish | |
or you are using MDX to add tests in your mli files directly. | |
They are especially useful if you want to hide or share this kind of setup | |
phase, e.g., you want to publish polished documentation | |
or you are using MDX to add tests directly in your [mli] files. |
This is a temporary update until we get the manual in realworldocaml#355 merged Signed-off-by: Nathan Rebours <[email protected]>
This introduce a new, more explicit labels `block-type=...` which is meant to replace the four separate labels `cram`, `ocaml`, `toplevel` and `include` in the future. It is added for a transition period at the end of which the four labels of the apocalypse should be removed in favor of this new one. Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
52c4e7d
to
dfc13b6
Compare
No description provided.