Recognise the metadata field on Odoc code blocks#339
Closed
Julow wants to merge 1 commit intorealworldocaml:mainfrom
Closed
Recognise the metadata field on Odoc code blocks#339Julow wants to merge 1 commit intorealworldocaml:mainfrom
Julow wants to merge 1 commit intorealworldocaml:mainfrom
Conversation
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.
Julow
commented
Aug 3, 2021
Comment on lines
+33
to
+36
| {@sh set-FOO=Hello,set-BAR=Bash[$ echo $FOO $BAR | ||
| Hello Bash | ||
|
|
||
| ]} |
Collaborator
Author
There was a problem hiding this comment.
The initial newline character is moved to the end in this sh block. Any idea ?
Collaborator
Author
|
This is a draft PR because the new parser isn't released yet. |
Collaborator
Author
|
Closed in favor of #357 |
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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))