Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
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
Expand Up @@ -10,7 +10,7 @@ <h1>{{propName}}</h1>
<div class="scroller" tabIndex="0"> <!-- tabIndex needed: otherwise can't be focused on open or via click -->
<dl>
{{#propValues}}
<dt>{{value}}</dt>
<dt>{{{value}}}</dt>
<dd>{{{description}}}</dd>
{{/propValues}}
</dl>
Expand Down
8 changes: 2 additions & 6 deletions src/extensions/default/WebPlatformDocs/InlineDocsViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,15 @@ define(function (require, exports, module) {

/**
* @param {!string} cssPropName
* @param {!{SUMMARY:string, URL:string, VALUES:Array.<{TITLE:string, DESCRIPTION:string}>}} cssPropDetails
* @param {!{SUMMARY:string, URL:string, VALUES:?Array.<{value:string, description:string}>}} cssPropDetails
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the JSDoc gurus: Is this (to be exact, the VALUES:?Array) valid?

*/
function InlineDocsViewer(cssPropName, cssPropDetails) {
InlineWidget.call(this);

var propValues = cssPropDetails.VALUES.map(function (valueInfo) {
return { value: valueInfo.TITLE, description: valueInfo.DESCRIPTION };
});

var templateVars = {
propName : cssPropName,
summary : cssPropDetails.SUMMARY,
propValues : propValues,
propValues : cssPropDetails.VALUES || [],
url : cssPropDetails.URL,
Strings : Strings
};
Expand Down
5 changes: 5 additions & 0 deletions src/extensions/default/WebPlatformDocs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Updating the Docs
Use the Node script [update-wpd-docs](https://github.com/MarcelGerber/update-wpd-docs) to update the `css.json` contents:
```
[sudo] node update-wpd-docs --exclude-vendor-prefixed --output <bracketsRepo>/src/extensions/default/WebPlatformDocs/css.json
```
15 changes: 15 additions & 0 deletions src/extensions/default/WebPlatformDocs/WebPlatformDocs.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
b {
font-weight: @font-weight-semibold;
}

table {
width: 100%;
margin-bottom: 1em;
th, td {
border: 1px solid lighten(@bc-text-thin-quiet, 20%);
padding: 0 .15em;
}
}
}

/* Left-hand column */
Expand Down Expand Up @@ -207,5 +216,11 @@ a.more-info {
color: @dark-bc-text;
text-shadow: 0 1px 0 @dark-bc-highlight;
}

table {
th, td {
border-color: darken(@dark-bc-text-thin-quiet, 35%);
}
}
}
}
2 changes: 1 addition & 1 deletion src/extensions/default/WebPlatformDocs/css.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/extensions/default/WebPlatformDocs/unittests.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ define(function (require, exports, module) {

valuesArr.forEach(function (value) {
values.push({
TITLE: value[0] || undefined,
DESCRIPTION: value[1] || undefined
title: value[0] || undefined,
description: value[1] || undefined
});
});

Expand Down