[Plugins]: New API for using Global Config #2796
naveen521kk
started this conversation in
Suggestions and Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description of the proposed feature
Currently, there is no way for plugins to use the global
config
dictionary/structure for their own configuration. I propose to add an API or a hook that plugins can use for their own configuration.Hook Details
The plugins can define a function called
manim_add_config
which will return a dictionary. The dictionary's key isconfig
name and the dictionary's value should be the type to convert the value to (for exampleint
). The dictionary can have as many config variables as needed. Manim will see if that function is defined in the plugin and then calls it; does the necessary things to add it to the config variable.Example
In
manim-fonts
plugin, I would like to introduce a config var calledFONT_DIR
which I would expect the user to set usingmanim.cfg
or a CLI flags and the plugin will read it usingconfig
variable defined globally in manim.So I would define a function
and then read it using
Additional comments
I think there needs to similar options for plugins to add a command-line flag.
Beta Was this translation helpful? Give feedback.
All reactions