Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit cf1c051

Browse files
saurabh95ficristo
authored andcommitted
Scrapped QuickDocs data for css and html from MDN to css.json and html.json (#13268)
* Scrapped summary and values of css properties from MDN to css.json * Migrated mozilla's extension of MDNDocs to Brackets with some minor changes * Removed redundant file * Fixed faling tests, modified a test to test HTML docs * Renamed all WebPlatformDocs strings to MDNDocs * Addressed review comments * Removed the usage of array for supported languages
1 parent 8e2891a commit cf1c051

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+9186
-156
lines changed

src/extensions/default/WebPlatformDocs/InlineDocsViewer.html renamed to src/extensions/default/MDNDocs/InlineDocsViewer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="css-prop-defn" tabIndex="0"> <!-- tabIndex needed: otherwise click focuses CodeMirror scroller and Esc won't work -->
1+
<div class="css-prop-defn {{#fullscreenSummary}}fullscreen-summary{{/fullscreenSummary}}" tabIndex="0"> <!-- tabIndex needed: otherwise click focuses CodeMirror scroller and Esc won't work -->
22
<div class="css-prop-summary">
33
<h1>{{propName}}</h1>
44
<div>{{{summary}}}</div>

src/extensions/default/WebPlatformDocs/InlineDocsViewer.js renamed to src/extensions/default/MDNDocs/InlineDocsViewer.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
/**
25-
* Inline widget to display WebPlatformDocs JSON data nicely formatted
25+
* Inline widget to display MDNDocs JSON data nicely formatted
2626
*/
2727
define(function (require, exports, module) {
2828
'use strict';
@@ -42,22 +42,23 @@ define(function (require, exports, module) {
4242
var SCROLL_LINE_HEIGHT = 40;
4343

4444
// Load CSS
45-
ExtensionUtils.loadStyleSheet(module, "WebPlatformDocs.less");
45+
ExtensionUtils.loadStyleSheet(module, "MDNDocs.less");
4646

4747

4848
/**
4949
* @param {!string} cssPropName
5050
* @param {!{SUMMARY:string, URL:string, VALUES:?Array.<{value:string, description:string}>}} cssPropDetails
5151
*/
52-
function InlineDocsViewer(cssPropName, cssPropDetails) {
52+
function InlineDocsViewer(PropName, PropDetails) {
5353
InlineWidget.call(this);
5454

5555
var templateVars = {
56-
propName : cssPropName,
57-
summary : cssPropDetails.SUMMARY,
58-
propValues : cssPropDetails.VALUES || [],
59-
url : cssPropDetails.URL,
60-
Strings : Strings
56+
propName : PropName,
57+
summary : PropDetails.SUMMARY,
58+
fullscreenSummary : !(PropDetails.VALUES && PropDetails.VALUES.length),
59+
propValues : PropDetails.VALUES || [],
60+
url : PropDetails.URL,
61+
Strings : Strings
6162
};
6263

6364
var html = Mustache.render(inlineEditorTemplate, templateVars);

src/extensions/default/WebPlatformDocs/WebPlatformDocs.less renamed to src/extensions/default/MDNDocs/MDNDocs.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@
144144
}
145145
}
146146

147+
.fullscreen-summary {
148+
.css-prop-summary {
149+
width: 95%;
150+
}
151+
152+
.css-prop-values, .divider-holder {
153+
display: none;
154+
}
155+
}
156+
147157
.content-bottom {
148158
// Used to pull bottom edge of .css-prop-defn down below its two floated children.
149159
// Also prevents .more-info (after us in DOM order) from overlapping the float: right content.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Updating the Docs
2+
* Use the Node script [scrape-mdn](https://github.com/mozilla/brackets/tree/master/src/extensions/extra/MDNDocs/tools/scrape-mdn) to update the `css.json` and `html.json` contents:
3+
* Both the JSON files will have URL and Summary, but for css.json we need to have possible values of each css property along with small description, so use this Node script [MDNDocsScrapper](https://github.com/saurabh95/MDNDocsScrapper), this takes css.json as input and then creates a newcss.json with the desired content.

src/extensions/default/MDNDocs/css.json

Lines changed: 8322 additions & 0 deletions
Large diffs are not rendered by default.

src/extensions/default/MDNDocs/html.json

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 186 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)