Plugins should be able to set default values for any setting
I own the plugin https://github.com/DarrenPaulWright/dmd-readable where I remove the global index partial because I don't need it, but I would prefer to just change the default for global-index-format to "none" so other users can override it. If this is possible now, I couldn't find any documentation on it. Thanks!
Hi, apologies for the lack of docs on this subject.. in dmd, there is a helper called optionSet. In your plugin partials you can use the helper to force a particular option, like this:
{{optionSet "global-index-format" "none"~}}
See here for an example of optionSet usage in the jsdoc2md testbed. See here for the output.
Ok, I got that to work by adding {{optionSet "global-index-format" "none"~}} to main.hbs, but how would users of my plugin override this setting? Would they have to provide their own main.hbs with a different setting? I tried setting -g table in an npm script and it didn't work.
I moved the setting to template.hbs, so that should work for now, but I still feel like a setting passed in through the cli should win over anything set with optionSet in any of the templates.
I still feel like a setting passed in through the cli should win
It should, and usually does. I think what you need is a means for plugin authors to set their own default values. I'll look into this, thanks for the input.
Thanks!