-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Improve MDN JSDoc wording - less wordy #29748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@sandersn do you think it can/should be done? I can either try to PR into your DOM processing scripts repo (where??) or implement a simple post-processing script here in this repo. |
Hooray! Somebody else who has heard of Mervyn Peake! Anyway, this is in principle a fine idea. The file you want is https://github.com/Microsoft/TSJS-lib-generator/blob/master/src/mdnfetcher.ts. I see two obstacles:
I am definitely interested in a seeing a PR so I could compare the increased complexity with increased brevity. I don't think that string replacers would take much time to implement. You may get 80% of the benefit from just 2 or 3. |
Awesome, here is a quick PR for that: microsoft/TypeScript-DOM-lib-generator#659 Updated baselines too -- easy to see the difference in wording. Must say I quite like the result! |
This now should be closed as updated typings are merged in TypeScript repository. (unless it's waiting for the official release) |
Search Terms
MDN JSDoc
Suggestion
A recent boost to
dom.generated.d.ts
#29690 brought in tons of MDN docs, which is super-helpful.However, MDN format is well fit for Jane Austen, if not Mervyn Peake. For though sophisticated and corteous, 'tis not entirely fit for short form that is IDE tooltips and completions.
Perhaps, a fair bit of creative massaging can cut the introductions to a minimum?
The first thing to remove are introductions, repeating the name of the symbol, its type and various pocket lint words like 'this' 'represents' and so on.
I would suggest scrolling through the JSDocs added in PR DOM update February 2019 #29690 and making a set of 20-30 regex-assisted context-aware string replacers.
Then run DOM update scripts again with those, after which scroll through the JSDocs and nitpick if anything still needs tweaking. Hopefully not!
Next time DOM update is run, use those existing massaging string replacers, so the
.d.ts
stays lean and hungry.Use Cases
IDE light-up features: tooltips, completions, signature tips.
Examples
Replace with:
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: