webextensions-examples icon indicating copy to clipboard operation
webextensions-examples copied to clipboard

examples.json should include a way to list significant manifest keys

Open Rob--W opened this issue 2 years ago • 0 comments

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.json to add "manifest_keys": ["protocol_handlers"] to the open-irc-links example at https://github.com/mdn/webextensions-examples/blob/9433f842d6295db366c399df752332d78a9cc859/examples.json#L586-L590
  • Append {{WebExtExamples}} to ## Examples at files/en-us/mozilla/add-ons/webextensions/manifest.json/protocol_handlers/index.md in 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

Rob--W avatar May 12 '23 16:05 Rob--W