Comments (10)
I plugged in turndown (removing anchors) and that seems to work well. https://github.com/notoriousb1t/mdn-crawler/blob/master/summaries.json
I plan to start integrating this tonight
from csstype.
Sounds good to me. I will update the PR tonight with those changes.
from csstype.
There's no short description for properties available in the source as you said. They have been discussing it but I don't know how prioritized it is.
Until then, we could use the patching mechanism to complete property comments with short descriptions. It should be quite straight forward if there's a possibility to copy them from TypeStyle or somewhere else. You're welcome to give it a try.
We snap the @see
link from mdn-browser-compat-data
. They cover a majority of the properties, but some of them are missing. It would be great to patch those too if you're up for it.
from csstype.
Ok, so some early success is getting property descriptions. I wrote a simple crawler to pull the first meaningful paragraph from each @see url. Because the writing format on MDN is good and predictable, this turns out to be a good description for jsdocs. This approach allows us to request new info by emptying out the contents of that dictionary entry. This should also keep the build from spamming their site all the time.
Prototype: https://github.com/notoriousb1t/mdn-crawler
Here is the output of the process so far: https://github.com/notoriousb1t/mdn-crawler/blob/master/summaries.json
I am going to look for a way to fold this into the build process in csstype.
from csstype.
This looks great! 👍 The less manual work the better. This even catched a 404 link for appearance
that should be fixed or removed at their end.
It would be nice if it somehow could preserve simple text formatting like code and bold in markdown instead. Do you think that's manageable?
from csstype.
I mentioned the patching mechanism before but that's for manual stuff so this should be its own thing. Thanks for looking into this.
from csstype.
Some notes about the PR:
- I couldn't figure out a way to fetch the summaries ahead of time for the properties that need it, so I ended up doing it on demand.
- Fetching summaries on demand requests inline. I attempted to make this async, but it ended up polluting the code base with async/await. Instead I brought in sync-request which is probably okay since this is a build process and not code running directly in production. Maybe there is a different way to solve this problem.
- I had to re-arrange the comment section a little bit so the summary would come first (as is typical in jsdocs)
- urls.json has the cached results and should be checked in with the project so we can avoid hitting MDN each time we need to do a build.
Thoughts?
from csstype.
Yeah, the whole thing should have been async from the start. I only have my self to blame for that. We should rewrite the whole thing one day.
It looks good overall. But one thought is that the summary is sneaked into __compat.mdn_summary
as if it came from MDN source. What's the reason for that? I'm thinking that it could confuse someone else in the future.
from csstype.
The primary reason I added it onto the data structure is that there are talks about adding into the json structure in the source on the repo. It should be pretty easy to transition if/when that happens. It is technically from an MDN source (although not from compatibility). I also wanted to avoid making unnecessary changes to the flow of the program.
Maybe we need to call it out as being scraped. Something like summary_from_mdn_web
or move it to the top of the structure?
from csstype.
Renaming it and only add the property to the return type instead of adding it to the source type would be enough for me. Does that sound reasonable?
from csstype.
Related Issues (20)
- How to limit the StandardLonghandProperties[`propertyName`] type to valid strings? HOT 1
- CSS Typed OM support HOT 1
- Missing '-webkit-user-drag'
- Ability to use an object with the value representing the css type
- Support for Container Queries HOT 4
- Strict types HOT 4
- Add `text-wrap` / `textWrap` from CSS4 (Chrome 113)
- add return type of `getComputedStyle()`
- Idea to wrap types into element types?
- How to migrate from old version to latest version
- Missing '-webkit-column-gap'
- missing '-webkit-padding-after' and '-webkit-padding-before'
- mdn/data deprecated HOT 1
- Regarding documentation and site for csstype
- Which version is the current version? Is it v3.1.2 or v2.6.0
- [3.1.3] typing issue with @emotion/serialize HOT 8
- New version causes breaks in Definitely Typed package `mui-datatables`
- WebkitUserSelects will resolve to user-select but not to -webkit-user-select
- Is there a reason why vendor prefixes in IE start with a lowercase letter?
- feat: add `view-*` CSS properties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csstype.