mdformat icon indicating copy to clipboard operation
mdformat copied to clipboard

Let plugins add options to `.mdformat.toml` file

Open csala opened this issue 3 years ago • 0 comments

Context

Currently, mdformat plugins are allowed to implement a add_cli_options function to add arguments to the mdformat ArgumentParser, but there is no way to allow those options to be added to the .mdformat.toml file without monkey patching the mdformat._conf module to add the new options to the DEFAULT_OPTS dictionary or _validate_keys and _validate_values functions.

Proposal

Add a way for plugins to declare acceptable options and values for the mdformat.toml file.

Along the way, maybe also slightly reformat how the options are declared, so that they are not hard-coded in two different places (_conf and _cli) independently. An option for this would be to have them declared only inside _conf, with a way for plugins to alter them, and then have both the _cli.ArgumentParser and the _conf validation functions read and use them.

Tasks and updates

No response

csala avatar Dec 30 '22 10:12 csala