Comments (6)
What do you think @Elchi3 and @ddbeck ?
from yari.
I like the idea of the feature itself, linking to the JSON file directly, a lot. I'd use this on a daily basis. There are a few caveats though.
And the method you've suggested would work in a lot of cases—probably the overwhelming majority—if we passed the full BCD hierarchy into the stumptown JSON (right now it cuts off at the __compat
object, though it would be trivial to add the full BCD identifier as part of the browser_compatibility
content object type).
Unfortunately, there are still a lot of cases where it wouldn't quite work as you've described. Consider Response.ok
as an example. Its BCD identifier is api.Response.ok
, but feature data is in the file /api/Response.json
(since it's a subfeature of api.Response
).
If you had the full hierarchy, you could hard code the depth of features that correspond to a file. You'd have to do this for each of the feature categories (api.*
, css.{at-rules,properties,selectors,types}.*
, etc.). A better, smarter thing to do might be to give the browser-compat-data
package a real API for this sort of thing (e.g., call some method with a feature identifier to get back the GitHub URL for that feature—it'd be possible to get the exact line number, even). I imagine such a thing would be useful for more than just stumptown.
Either way, we could have the stumptown content JSON look something like this:
{
"type": "browser_compatibility",
"value": {
"__compat": { … }
},
"source_id": "api.Response.ok",
"github_source_url": "https://github.com/mdn/browser-compat-data/blob/master/api/Response.json"
}
from yari.
I don't think I really understood the source_id
because if you can make that above JSON block, stumptown-renderer just needs the github_source_url
.
from yari.
So, what would it take to make that stuff a reality in stumptown-content? Can it be done?
from yari.
@ddbeck Can we close this now? (now that we have the new new-issue link)
Or did you have in mind to do more fine-tuned links directly into the files in the bcd repo.
from yari.
Yep, this is good enough for now. Thank you!
from yari.
Related Issues (20)
- MDN Plus menu item wraps in Brave HOT 4
- Rename Markdown links when an internal page is moved using `yarn content move`
- PR test in mdn/translated-content is slower than before HOT 6
- Changing focus from the search box causes top result to not work HOT 2
- Do not raise "Anchor not lowercase" flaw when the anchor is a fragment directive
- chore(short-survey): MDN Web Docs content discovery
- docs/web pages are broken when cookies are disabled HOT 2
- Missing space in the text in BCD table HOT 3
- Sidebar links are duplicated when you are navigating inside the "Common questions" section HOT 5
- The page is not working
- Entire korean learn pages are messed up HOT 3
- Remove Markdown links in content when a page is deleted using command `yarn content delete` HOT 1
- BCD not rendered for `html.global_attributes.virtualkeyboardpolicy` HOT 3
- Error setting up repo on Windows
- [Regression?] Generate clickable tags for description terms HOT 6
- No way (flaws or build log) to detect errors in {{CSSInfo}} HOT 2
- survey: web components survey
- HTML Input type examples don't match the type/description HOT 6
- Left Navigation Bar not Works Properly HOT 12
- UI bug HOT 2
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 yari.