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

Scrapped QuickDocs data for css and html from MDN to css.json and html.json #13268

Merged
merged 7 commits into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="css-prop-defn" tabIndex="0"> <!-- tabIndex needed: otherwise click focuses CodeMirror scroller and Esc won't work -->
<div class="css-prop-defn {{#fullscreenSummary}}fullscreen-summary{{/fullscreenSummary}}" tabIndex="0"> <!-- tabIndex needed: otherwise click focuses CodeMirror scroller and Esc won't work -->
<div class="css-prop-summary">
<h1>{{propName}}</h1>
<div>{{{summary}}}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

/**
* Inline widget to display WebPlatformDocs JSON data nicely formatted
* Inline widget to display MDNDocs JSON data nicely formatted
*/
define(function (require, exports, module) {
'use strict';
Expand All @@ -42,22 +42,23 @@ define(function (require, exports, module) {
var SCROLL_LINE_HEIGHT = 40;

// Load CSS
ExtensionUtils.loadStyleSheet(module, "WebPlatformDocs.less");
ExtensionUtils.loadStyleSheet(module, "MDNDocs.less");


/**
* @param {!string} cssPropName
* @param {!{SUMMARY:string, URL:string, VALUES:?Array.<{value:string, description:string}>}} cssPropDetails
*/
function InlineDocsViewer(cssPropName, cssPropDetails) {
function InlineDocsViewer(PropName, PropDetails) {
InlineWidget.call(this);

var templateVars = {
propName : cssPropName,
summary : cssPropDetails.SUMMARY,
propValues : cssPropDetails.VALUES || [],
url : cssPropDetails.URL,
Strings : Strings
propName : PropName,
summary : PropDetails.SUMMARY,
fullscreenSummary : !(PropDetails.VALUES && PropDetails.VALUES.length),
propValues : PropDetails.VALUES || [],
url : PropDetails.URL,
Strings : Strings
};

var html = Mustache.render(inlineEditorTemplate, templateVars);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@
}
}

.fullscreen-summary {
.css-prop-summary {
width: 95%;
}

.css-prop-values, .divider-holder {
display: none;
}
}

.content-bottom {
// Used to pull bottom edge of .css-prop-defn down below its two floated children.
// Also prevents .more-info (after us in DOM order) from overlapping the float: right content.
Expand Down
3 changes: 3 additions & 0 deletions src/extensions/default/MDNDocs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Updating the Docs
* 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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we need to change grunt to avoid to have MDNDocs/tools in the distribution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MDN/tools is not generated in dist in grunt task

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great 😄

* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think things like MDNDocsScrapper should belong in https://github.com/brackets-userland

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will add it in brackets-userland

8,322 changes: 8,322 additions & 0 deletions src/extensions/default/MDNDocs/css.json

Large diffs are not rendered by default.

550 changes: 550 additions & 0 deletions src/extensions/default/MDNDocs/html.json

Large diffs are not rendered by default.

186 changes: 186 additions & 0 deletions src/extensions/default/MDNDocs/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading