Skip to content

Commit

Permalink
Added documentation site to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Nguyen committed Oct 15, 2014
1 parent 9dd1156 commit e8a7a22
Show file tree
Hide file tree
Showing 120 changed files with 2,713 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
build
node_modules
npm-debug.log
npm-debug.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ This allows you to override any variables defined in [custom-variables.less](htt

## Contribute

[Material-UI](http://callemall.github.io/material-ui/) came about from our love of [React](http://facebook.github.io/react/) and [Google's Material Design](https://www.google.com/design/spec/material-design/introduction.html). We're currently using it on a project at [Call-Em-All](https://www.call-em-all.com/) and plan on adding to it and making it better. If you'd like to help, check out our [gh-pages](https://github.com/callemall/material-ui/tree/gh-pages) branch. We'd greatly appreciate any feedback you may have. :)
[Material-UI](http://callemall.github.io/material-ui/) came about from our love of [React](http://facebook.github.io/react/) and [Google's Material Design](https://www.google.com/design/spec/material-design/introduction.html). We're currently using it on a project at [Call-Em-All](https://www.call-em-all.com/) and plan on adding to it and making it better. If you'd like to help, check out the [docs folder](https://github.com/callemall/material-ui/tree/master/docs). We'd greatly appreciate any contribution you make. :)

2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
16 changes: 16 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Material-UI](http://callemall.github.io/material-ui/)

This is the documentation site for [Material-UI](http://callemall.github.io/material-ui/).

## Development Installation Notes
After cloning the repository, install dependencies:
```
cd <project folder>/material-ui/docs
npm install
npm install -g gulp
```

Now you can run your local server:
```
gulp
```
23 changes: 23 additions & 0 deletions docs/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
AppBar: require('./js/app-bar.jsx'),
AppCanvas: require('./js/app-canvas.jsx'),
Checkbox: require('./js/checkbox.jsx'),
DropDownIcon: require('./js/drop-down-icon.jsx'),
DropDownMenu: require('./js/drop-down-menu.jsx'),
Icon: require('./js/icon.jsx'),
Input: require('./js/input.jsx'),
LeftNav: require('./js/left-nav.jsx'),
MenuItem: require('./js/menu-item.jsx'),
Menu: require('./js/menu.jsx'),
Mixins: {
Classable: require('./js/mixins/classable.js'),
ClickAwayable: require('./js/mixins/click-awayable.js')
},
PaperButton: require('./js/paper-button.jsx'),
Paper: require('./js/paper.jsx'),
RadioButton: require('./js/radio-button.jsx'),
Toggle: require('./js/toggle.jsx'),
Toast: require('./js/toast.jsx'),
Toolbar: require('./js/toolbar.jsx'),
ToolbarGroup: require('./js/toolbar-group.jsx')
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/gulp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var requireDir = require('require-dir');

// Require all tasks in gulp/tasks, including subfolders
requireDir('./tasks', { recurse: true });
10 changes: 10 additions & 0 deletions docs/gulp/tasks/browserSync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var browserSync = require('browser-sync');
var gulp = require('gulp');

gulp.task('browserSync', ['build'], function() {
browserSync.init(['build/**'], {
server: {
baseDir: ['build', 'src']
}
});
});
45 changes: 45 additions & 0 deletions docs/gulp/tasks/browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* browserify task
---------------
Bundle javascripty things with browserify!
If the watch task is running, this uses watchify instead
of browserify for faster bundling using caching.
*/

var gulp = require('gulp');
var browserify = require('browserify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var bundleLogger = require('../util/bundleLogger');
var handleErrors = require('../util/handleErrors');


gulp.task('browserify', function() {

var bundler = watchify(browserify('./src/app/app.jsx', watchify.args));

var bundle = function(ids) {
// Log when bundling starts
bundleLogger.start();

return bundler
.bundle()
// Report compile errors
.on('error', handleErrors)
// Use vinyl-source-stream to make the
// stream gulp compatible. Specifiy the
// desired output filename here.
.pipe(source('app.js'))
// Specify the output destination
.pipe(gulp.dest('./build/'))
// Log when bundling completes!
.on('end', bundleLogger.end);
};

if(global.isWatching) {
// Rebundle with watchify on changes.
bundler.on('update', bundle);
}

return bundle();
});
3 changes: 3 additions & 0 deletions docs/gulp/tasks/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var gulp = require('gulp');

gulp.task('build', ['browserify', 'markup', 'less', 'fonts']);
3 changes: 3 additions & 0 deletions docs/gulp/tasks/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var gulp = require('gulp');

gulp.task('default', ['watch']);
6 changes: 6 additions & 0 deletions docs/gulp/tasks/fonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var gulp = require('gulp');

gulp.task('fonts', function() {
return gulp.src('./dist/less/material-ui-icons/fonts/**')
.pipe(gulp.dest('build/fonts'));
});
11 changes: 11 additions & 0 deletions docs/gulp/tasks/less.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var gulp = require('gulp'),
less = require('gulp-less'),
sourcemaps = require('gulp-sourcemaps');

gulp.task('less', function() {
return gulp.src('src/less/main.less')
.pipe(sourcemaps.init())
.pipe(less())
.pipe(sourcemaps.write())
.pipe(gulp.dest('build'));
});
6 changes: 6 additions & 0 deletions docs/gulp/tasks/markup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var gulp = require('gulp');

gulp.task('markup', function() {
return gulp.src('src/www/**')
.pipe(gulp.dest('build'));
});
5 changes: 5 additions & 0 deletions docs/gulp/tasks/setWatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var gulp = require('gulp');

gulp.task('setWatch', function() {
global.isWatching = true;
});
13 changes: 13 additions & 0 deletions docs/gulp/tasks/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Notes:
- gulp/tasks/browserify.js handles js recompiling with watchify
- gulp/tasks/browserSync.js automatically reloads any files
that change within the directory it's serving from
*/

var gulp = require('gulp');

gulp.task('watch', ['setWatch', 'browserSync'], function() {
gulp.watch('src/www/**', ['markup']);
gulp.watch('src/less/**', ['less']);
gulp.watch('dist/less/**', ['less']);
});
21 changes: 21 additions & 0 deletions docs/gulp/util/bundleLogger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* bundleLogger
------------
Provides gulp style logs to the bundle method in browserify.js
*/

var gutil = require('gulp-util');
var prettyHrtime = require('pretty-hrtime');
var startTime;

module.exports = {
start: function() {
startTime = process.hrtime();
gutil.log('Running', gutil.colors.green("'bundle'") + '...');
},

end: function() {
var taskTime = process.hrtime(startTime);
var prettyTime = prettyHrtime(taskTime);
gutil.log('Finished', gutil.colors.green("'bundle'"), 'in', gutil.colors.magenta(prettyTime));
}
};
15 changes: 15 additions & 0 deletions docs/gulp/util/handleErrors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var notify = require("gulp-notify");

module.exports = function() {

var args = Array.prototype.slice.call(arguments);

// Send error to notification center with gulp-notify
notify.onError({
title: "Compile Error",
message: "<%= error.message %>"
}).apply(this, args);

// Keep gulp from hanging on this task
this.emit('end');
};
12 changes: 12 additions & 0 deletions docs/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
gulpfile.js
===========
Rather than manage one giant configuration file responsible
for creating multiple tasks, each task has been broken out into
its own file in gulp/tasks. Any file in that folder gets automatically
required by the loop in ./gulp/index.js (required below).
To add a new task, simply add a new task file to gulp/tasks.
*/

require('./gulp');
41 changes: 41 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "material-ui-docs",
"version": "0.0.1",
"description": "Documentation site for material-ui",
"private": true,
"browser": {
"mui": "./dist/index.js",
"hljs": "./src/app/vendor/highlight-js/highlight.pack.js",
"react": "react/addons"
},
"browserify": {
"transform": [
"reactify",
"browserify-shim"
]
},
"browserify-shim": {
"hljs": "hljs"
},
"devDependencies": {
"browser-sync": "^1.3.3",
"browserify": "^5.9.1",
"browserify-shim": "^3.6.0",
"gulp": "^3.8.7",
"gulp-less": "^1.3.3",
"gulp-notify": "^1.4.2",
"gulp-sourcemaps": "^1.1.1",
"gulp-util": "^3.0.0",
"pretty-hrtime": "^0.2.1",
"reactify": "^0.14.0",
"require-dir": "^0.1.0",
"underscore": "^1.6.0",
"vinyl-source-stream": "^0.1.1",
"watchify": "^1.0.1"
},
"dependencies": {
"jquery": "^2.1.1",
"backbone": "^1.1.2",
"react": "^0.11.1"
}
}
20 changes: 20 additions & 0 deletions docs/src/app/app-dispatcher.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var Dispatcher = require('./vendor/flux/dispatcher.js');
var copyProperties = require('react/lib/copyProperties');

var AppDispatcher = copyProperties(new Dispatcher(), {

ActionTypes: {
NAV_URL_CHANGE: 'nav-url-change',
NAV_USER_CLICK: 'nav-user-click'
},

dispatchAction: function(type, payload) {
this.dispatch({
type: type,
payload: payload
})
}

});

module.exports = AppDispatcher;
29 changes: 29 additions & 0 deletions docs/src/app/app-router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var _ = require('underscore'),
Backbone = require('backbone'),
Dispatcher = require('./app-dispatcher.js'),

AppRouter = Backbone.Router.extend({

routes: {
'*path': 'handleDefaultRoute'
},

initialize: function() {
this.dispatchToken = Dispatcher.register(_.bind(this.onDispatched, this));
},

handleDefaultRoute: function(url) {
Dispatcher.dispatchAction(Dispatcher.ActionTypes.NAV_URL_CHANGE, { url: url });
},

onDispatched: function(action) {
switch (action.type) {
case Dispatcher.ActionTypes.NAV_USER_CLICK:
this.navigate(action.payload.url);
break;
}
}

});

module.exports = new AppRouter();
25 changes: 25 additions & 0 deletions docs/src/app/app.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @jsx React.DOM
*/

(function () {

var $ = require('jquery'),
Backbone = require('backbone'),
React = require('react'),
AppRouter = require('./app-router.js'),
MasterComponent = require('./components/master.jsx');

Backbone.$ = $;

//Needed for React Developer Tools
window.React = React;

//Render the main app component
React.renderComponent(<MasterComponent />, document.body);

Backbone.history.start();

})();


Loading

0 comments on commit e8a7a22

Please sign in to comment.