webextensions-examples
webextensions-examples copied to clipboard
examples.json should include a way to list significant manifest keys
examples.json lists all samples plus relevant extension APIs in javascript_apis. But there are several extension APIs with significant functionality in its manifest keys. By significant, I mean not just because it is referenced (e.g. name and description are quite meaningless), but because the example is a notably good demonstration of the APIs in use.
To make it easier to find the right examples, we should introduce a new key, e.g. manifest_keys to link examples to manifest keys.
Tasks:
- [ ] Update CONTRIBUTING to list the new key.
- [ ] Update examples.json to mention significant manifest keys.
- [ ] Update macro to parse key in https://github.com/mdn/yari/blob/main/kumascript/macros/WebExtAllExamples.ejs
- [ ] Update macro to parse key in https://github.com/mdn/yari/blob/main/kumascript/macros/WebExtExamples.ejs
- [ ] Update articles under https://github.com/mdn/content/tree/main/files/en-us/mozilla/add-ons/webextensions/manifest.json to (automatically) reference the new examples with the macro.
Example of expected results:
- Update
examples.jsonto add"manifest_keys": ["protocol_handlers"]to theopen-irc-linksexample at https://github.com/mdn/webextensions-examples/blob/9433f842d6295db366c399df752332d78a9cc859/examples.json#L586-L590 - Append
{{WebExtExamples}}to## Examplesatfiles/en-us/mozilla/add-ons/webextensions/manifest.json/protocol_handlers/index.mdin the mdn/content repo - The example should be rendered at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers#example
- The table of examples should also list the manifest key at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Examples