for those of you who haven’t seen this already, as part of GSOC we have been working on a set of tools to lint MDN documents to make the writer’s life easier and MDN docs more consistent.
This process has started at the beginning of June and we are ready to announce two things.
Doc Linter Webextension
We are ready to announce that we have successfully ported the SDK based add-on developped by Florian and Sebastian (https://github.com/Elchi3/mdn-doc-tests) to a working WebExtension (https://github.com/mdn/doc-linter-webextension).
This extension is adding a sidebar that you can open while editing a page on MDN and it can run a series of tests to let you know if there is any mistake in your page such as deprecated macros, too many links, empty elements, etc.
The WebExtension is a port from the SDK based add-on with nearly the same feature set as the add-on.
However, some features are not working yet due to API incompatibilities or other issues:
- The sidebar doesn’t open automatically when editing pages: There is currently no API to open the sidebar programmatically.
- There are no preferences implemented yet: This is due to the separation between the rules and the extension. This is making the modularity a bit more complex than expected.
The WebExtension should meet the requirements to be published on https://addons.mozilla.org and we’re planning to submit it soon.
Doc Linter Rules
We are also quite proud to announce that all the work that was put into making the rules used by the WebExtension also lead to making the rules available to other contexts as well, such as remote testing.
This has been done by a light refactoring of the existing rules to make them available as part of their own package (https://github.com/mdn/doc-linter-rules).
It opens a large set of possibilities such as testing directly in CKEditor, remotely, or before saving the document. The potential is great and we are thrilled to be able to make this available to everyone.
The WebExtension has already been modified to use this package of rules.
I did a very small Proof of Concept as an example of potential future remote testing (https://github.com/MatonAnthony/remote-mdn-linter).
What’s next ?!
A bright future for this project.
During the following month, we hope to solve as many bugs as possible and improve the package of rules.
We would also like to add features that you think are missing. If you would like a new feature or a new rule, feel free to open a bug in one of the repositories or to ping me (@anthony) or Florian (@fscholz) on IRC or send me an email.