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

Recognise the metadata field on Odoc code blocks #339

Closed
wants to merge 1 commit into from

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Aug 3, 2021

Odoc's parser will change again: ocaml-doc/odoc-parser#2
It was decided to parse the "metadata" field of code blocks into two fields: the language tag and an arbitrary string. It is not possible to write the second field without the first.

If the metadata is absent, the code block is run as OCaml. This is backward compatible.

Until now, Mdx would strip it from the original file by ignoring it at parsing and not outputting it back. (#333 (comment))

The language tag is used as the header and the other field is for
labels.

If the metadata is absent, the code block is run as OCaml. This is
backward compatible.

Until now, Mdx would strip it from the original file by ignoring it at
parsing and not outputting it back.
Comment on lines +33 to +36
{@sh set-FOO=Hello,set-BAR=Bash[$ echo $FOO $BAR
Hello Bash

]}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The initial newline character is moved to the end in this sh block. Any idea ?

@Julow Julow marked this pull request as draft August 3, 2021 19:03
@Julow
Copy link
Collaborator Author

Julow commented Aug 3, 2021

This is a draft PR because the new parser isn't released yet.

@Julow
Copy link
Collaborator Author

Julow commented Dec 14, 2021

Closed in favor of #357

@Julow Julow closed this Dec 14, 2021
Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this pull request Jan 28, 2022
CHANGES:

#### Added

- Add support for adding language tags and metadata labels in `mli` files.
  (realworldocaml/mdx#339, realworldocaml/mdx#357, @Julow, @Leonidas-from-XIV)
- Add support for running non-deterministic tests in `dune` MDX 0.2 stanza by
  setting the `MDX_RUN_NON_DETERMINISTIC` environment variable. (realworldocaml/mdx#365,
  realworldocaml/mdx#366, @Leonidas-from-XIV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant