ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.63k stars 408 forks source link

Arbitrary flags for mdx #6416

Open MisterDA opened 2 years ago

MisterDA commented 2 years ago

Desired Behavior

Although the mdx stanza in Dune covers a lot of possible interactions with ocaml-mdx, it doesn't cover all. It would be nice for easier debugging of mdx files to be able to add the verbose flag, for instance. There are also some customization options not covered by Dune: the syntax, various debugging flags, selecting subsections… The interaction between the current stanzas and specifying custom flags could be tricky. Maybe user-defined flags should overwrite stanzas? Or should we look in user flags to make sure there's no duplication? It would also make it easier to add new features to ocaml-mdx if the stanza doesn't catch up right away.

Example

The mdx stanza taken from current_examples:

(mdx
 (packages current_examples)
 (package current_examples)
 (files example_pipelines.md writing_plugins.md internals.md))

The same, with additional user-defined flags:

(mdx
 (packages current_examples)
 (package current_examples)
 (flags :standard --verbose --syntax=mli)
 (files example_pipelines.md writing_plugins.md internals.md))
emillon commented 1 year ago

See #2145 for a precedent with odoc. We decided not to support arbitrary flags, but rather to map these to dune features. I think that's what we should aim for too.

What kind of flags are you after?

 (flags :standard --verbose --syntax=mli)
 (files example_pipelines.md writing_plugins.md internals.md))