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

WIP: Add a manual using odoc and .mld files #355

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

NathanReb
Copy link
Contributor

No description provided.

@NathanReb NathanReb added the no changelog This PR doesn't require a changelog update label Nov 8, 2021
@NathanReb NathanReb force-pushed the mdx-manual branch 2 times, most recently from 412c257 to 6130320 Compare November 10, 2021 11:14
Copy link

@christinerose christinerose left a 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the correctness of code respectively written in multi-line code blocks and
correct code written in multiline code blocks and

doc/labels.mld Outdated
Comment on lines 12 to 101
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}.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}.

Comment on lines +20 to +108
The environement label expects a single string value which corresponds to the
name of the environment to use.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines +49 to +137
When absent, the block will be evaluated in the default environment, e.g.
the environment shared by all blocks without an [env] label.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines +3 to +6
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!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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!

Comment on lines +8 to +10
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

NathanReb added a commit to NathanReb/mdx that referenced this pull request Feb 28, 2022
This is a temporary update until we get the manual in realworldocaml#355 merged

Signed-off-by: Nathan Rebours <[email protected]>
NathanReb and others added 6 commits August 3, 2022 17:25
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR doesn't require a changelog update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants