Skip to content

Commit

Permalink
Fix whitespace, typos and markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaelig committed May 4, 2016
1 parent d27430c commit 37d16f4
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -4,4 +4,4 @@ node_js:
install:
- npm install
script:
- npm test
- npm test
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -160,7 +160,7 @@ gulp.src('./design/props.json')

***

####`theo.registerTransform(type, valueTransforms)`
#### `theo.registerTransform(type, valueTransforms)`

Register a new transform. Existing transforms with the same name
will be overwritten.
Expand Down Expand Up @@ -204,7 +204,7 @@ No valueTransforms will be applied

***

####`theo.registerValueTransform(name, matcher, transformer)` <a name="registerValueTransform"></a>
#### `theo.registerValueTransform(name, matcher, transformer)` <a name="registerValueTransform"></a>

Register a new valueTransform. Existing valueTransforms with the same name
will be overwritten.
Expand Down Expand Up @@ -245,7 +245,7 @@ Parse the value as a color and return an 6 digit hex string
Parse the value as a color and return an 8 digit hex string

**percentage/float**
Parse a string percentage value and return a float represention
Parse a string percentage value and return a float representation

**relative/pixel**
Parse a relative size value (em/rem) and return a pixel representation.
Expand Down Expand Up @@ -304,7 +304,7 @@ gulp.src('design/props.json')

***

####`theo.registerFormat(name, formatter)`
#### `theo.registerFormat(name, formatter)`

Register a new format. Existing formats with the same name
will be overwritten.
Expand Down Expand Up @@ -466,14 +466,14 @@ define(function() {
});
```

###### styleguide
###### Styleguide

See [salesforce-ux.github.io/design-properties]()
See <https://salesforce-ux.github.io/design-properties>.


***

####`theo.plugins.getResult([callback])`
#### `theo.plugins.getResult([callback])`

Get the result of a transform/format

Expand Down
18 changes: 10 additions & 8 deletions src/props/formats/html.jsx
Expand Up @@ -250,9 +250,10 @@ let Styleguide = React.createClass({
<h1>Design Attribute Guide</h1>
</div>
</header>
<div className="container">
<main role="main">
<table>
<div className="container">
<main role="main">
<table>
<tbody>
{this.renderSection('text-color', 'Text Colors')}
{this.renderSection('background-color', 'Background Colors')}
{this.renderSection('gradient', 'Gradients')}
Expand All @@ -269,9 +270,10 @@ let Styleguide = React.createClass({
{this.renderSection('radius', 'Radius')}
{this.renderSection('time', 'Time')}
{this.renderSection('media-query', 'Media Queries')}
</table>
</main>
</div>
</tbody>
</table>
</main>
</div>
</body>
</html>
)
Expand All @@ -280,7 +282,7 @@ let Styleguide = React.createClass({

module.exports = function(json) {
return `
<!doctype html>
<!DOCTYPE html>
${React.renderToStaticMarkup(<Styleguide json={json} />)}
`;
};
};
6 changes: 3 additions & 3 deletions src/props/index.js
Expand Up @@ -235,7 +235,7 @@ registerFormat('list.scss', (json, options) => {

registerFormat('map.scss', (json, options) => {
options = _.defaults({}, options, {
nameSuffix: '-map'
nameSuffix: '-map'
});
let items = _.map(json.props, prop => {
let name = kebabCase(prop.name);
Expand All @@ -261,7 +261,7 @@ registerFormat('map.scss', (json, options) => {

registerFormat('map.variables.scss', (json, options) => {
options = _.defaults({}, options, {
nameSuffix: '-map-variables'
nameSuffix: '-map-variables'
});
_.transform(json.props, (result, value, name, props) => {
props[name].value = `$${kebabCase(name)}`;
Expand Down Expand Up @@ -429,7 +429,7 @@ module.exports = {
*
* @param {function} [callback]
* @return {stream}
*/
*/
getResult(callback) {
return through.obj((file, enc, next) => {
if (typeof callback === 'function' && file.isBuffer()) {
Expand Down
4 changes: 2 additions & 2 deletions src/props/prop-set.js
Expand Up @@ -18,7 +18,7 @@ let util = require('./util');
let TheoError = require('./util/error');

class PropSet {

constructor(file, valueTransforms, options={}) {
if (typeof file.isBuffer !== 'function' || typeof file.isBuffer === 'undefined') {
throw TheoError('transform() must use vinyl files');
Expand Down Expand Up @@ -173,7 +173,7 @@ class PropSet {
// Extract the meta data
let meta = prop['.meta'];
if (this.options.includeMeta !== true) {
delete prop['.meta'];
delete prop['.meta'];
}
// Transform the value
this._transformValue(prop, meta);
Expand Down
14 changes: 7 additions & 7 deletions test/props/index.js
Expand Up @@ -29,7 +29,7 @@ function isError(error) {
}

describe('$props', function() {

describe('#getValueTransform()', function() {
it('throws an error if the valueTransform is not registered', function() {
assert.throws(function() {
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('$props.plugins', function() {
});
it('formats props', function(done) {
var error, result;
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
var postResult;
gulp.src(samplePath)
.on('error', function(err) {
Expand All @@ -274,7 +274,7 @@ describe('$props.plugins', function() {
});
it('filters props before formatting', function(done) {
var error, result;
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
//var preResult = JSON.parse(fs.readFileSync(samplePath));
var postResult;
gulp.src(samplePath)
Expand All @@ -291,7 +291,7 @@ describe('$props.plugins', function() {
});
it('maps props before formatting', function(done) {
var error, result;
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
//var preResult = JSON.parse(fs.readFileSync(samplePath));
var postResult;
gulp.src(samplePath)
Expand All @@ -314,7 +314,7 @@ describe('$props.plugins', function() {
});
it('renames the file correctly', function(done) {
var resultFile;
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
var samplePath = path.resolve(__dirname, 'mock', 'sample.json');
gulp.src(samplePath)
.on('finish', function() {
assert(resultFile.relative === 'sample.scss');
Expand Down Expand Up @@ -434,7 +434,7 @@ describe('$props.plugins', function() {
});

describe('$props:valueTransforms', function() {

describe('color/rgb', function() {
var t = $props.getValueTransform('color/rgb').transformer;
it('converts hex to rgb', function() {
Expand Down Expand Up @@ -835,7 +835,7 @@ describe('$props:formats', function() {
describe('html', function() {
before($format('raw', 'html', paths.sink));
it('outputs html', function() {
var re = new RegExp(_.escapeRegExp('<!doctype html>'));
var re = new RegExp(_.escapeRegExp('<!DOCTYPE html>'));
assert(re.test(result));
});
it('has example rows', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/props/prop-set.js
Expand Up @@ -29,7 +29,7 @@ function isError(error) {
describe('PropSet', function() {

var def, file, t1, t2, set;

beforeEach(function() {
var p = path.resolve(__dirname, 'mock', 'c.json');
var f = fs.readFileSync(p);
Expand Down Expand Up @@ -320,7 +320,7 @@ describe('PropSet', function() {
assert(!t1.transformer.called);
});
});

describe('#transform', function() {
it('transforms the props', transformProps);
it('returns the PropSet', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/stream-util/index.js
Expand Up @@ -41,7 +41,7 @@ describe('$stream', function() {
beforeEach(function() {
files = [];
});

describe('#filter()', function() {
it('throws an error if a non functional argument is passed', function() {
assert.throws(function() {
Expand Down

0 comments on commit 37d16f4

Please sign in to comment.