mdn / mdn/webextensions-examples
examples.json should include a way to list significant manifest keys
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 4.5k
- Forks
- 2.6k
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 3
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CONTRIBUTING and examples.json in mdn/webextensions-examples, then inspect the WebExtAllExamples.ejs and WebExtExamples.ejs macros in mdn/yari. Review the protocol_handlers manifest documentation in mdn/content as the reference case. Done means significant manifest keys are recorded, both macros parse them, and the relevant documentation pages render the examples and manifest key in their tables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100