Skip to content

Commit f40b850

Browse files
committed
Pull in MDN documentation with attribution.
Collect documentations on CSS properties and compile into mdn-documentation.js. Certain properties are excluded because of inaccurency. - Fix microsoft/vscode#46866 - Fix microsoft/vscode#46423 - Fix microsoft/vscode#27204
1 parent 37c4090 commit f40b850

File tree

6 files changed

+218
-7620
lines changed

6 files changed

+218
-7620
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ License
6161
(MIT License)
6262

6363
Copyright 2016, Microsoft
64+
65+
With the exceptions of,
66+
67+
- `build/mdn-documentation.js`, which is built upon content from [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web)
68+
and distributed under CC BY-SA 2.5.

build/mdn-data-importer.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
const path = require('path')
77
const fs = require('fs')
88

9+
const mdnDocumentations = require('./mdn-documentation')
10+
11+
const mdnExcludedProperties = [
12+
'--*', // custom properties
13+
'gap', // grid-gap
14+
'row-gap', // grid-row-gap
15+
'image-resolution', // https://www.w3.org/TR/css-images-4/#propdef-image-resolution
16+
]
17+
918
function buildPropertiesWithMDNData(vscProperties) {
1019
const propertyMap = {}
1120

@@ -22,6 +31,10 @@ function buildPropertiesWithMDNData(vscProperties) {
2231
}
2332
}
2433

34+
mdnExcludedProperties.forEach(p => {
35+
delete allMDNProperties[p]
36+
})
37+
2538
/**
2639
* 1. Go through VSC properties. For each entry that has a matching entry in MDN, merge both entry.
2740
*/
@@ -45,7 +58,7 @@ function buildPropertiesWithMDNData(vscProperties) {
4558
if (!propertyMap[pn]) {
4659
propertyMap[pn] = {
4760
name: pn,
48-
description: '',
61+
desc: mdnDocumentations[pn] ? mdnDocumentations[pn] : '',
4962
restriction: 'none',
5063
...extractMDNProperties(allMDNProperties[pn])
5164
}

0 commit comments

Comments
 (0)