Skip to content

Commit

Permalink
Initial commit for finish list and article
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyslu committed Oct 22, 2017
0 parents commit 9cfe06c
Show file tree
Hide file tree
Showing 88 changed files with 147,894 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory of Bower components
bower_components

# Dependency directory of Node modules
node_modules

# Users Environment Variables
.lock-wscript

# Project
.idea
*.iml
.DS_Store

# Compiled files
client/css/*
client/js/*
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Sahat Yalkabov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# docoGen UI

[![License: IEEE](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/)

## Introduction

This repository is going to build template for docoGen UI

## Installation

```bash
# Install all modules needed
$ npm install
# Execution website server
$ npm start
```

## Structure

(Update soon.)

## TODO

(Update soon.)

## Author

* [Yung-Sheng Lu](http://www.github.com/yungshenglu)

---

Copyright © 2017 docoGen UI

[![License: IEEE](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
31 changes: 31 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "nsslab_website",
"dependencies": {
"react": "^0.14.9 || >=15.3.0",
"popper.js": "^1.12.5",
"magnific-popup": "^1.1.0",
"semantic": "semantic-ui#^2.2.13",
"jquery": "^3.2.1"
},
"description": "docoGen UI",
"main": "",
"keywords": [
"docoGen"
],
"authors": [
"Yung-Sheng Lu"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/toolbuddy/docogen_ui/issues"
},
"homepage": "https://github.com/toolbuddy/docogen_ui#readme",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
Binary file added client/img/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/short-paragraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/square-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
/* Gulp modules */
const gulp = require('gulp');
const autoPrefixer = require('gulp-autoprefixer');
const compileJSX = require('gulp-compile-jsx');
const concat = require('gulp-concat');
const cssMin = require('gulp-cssmin');
const gulpIf = require('gulp-if');
const less = require('gulp-less');
const plumber = require('gulp-plumber');
const staticI18nHtml = require('gulp-static-i18n-html');
const srcMaps = require('gulp-sourcemaps');
const uglify = require('gulp-uglify');
const util = require('gulp-util');
const babelify = require('babelify');
const browserify = require('browserify');
const fs = require('fs');
const watchify = require('watchify');
const argv = require('yargs').argv;

/* Vinyl modules */
const buffer = require('vinyl-buffer');
const srcStream = require('vinyl-source-stream');

/* Create production and dependencies */
const production = process.env.NODE_ENV === 'production';
const dependencies = [
'alt',
'react',
'react-dom',
'react-router',
'underscore'
];

/* Get dest parameter */
const dest = argv.p[argv.p.length - 1] == '/' ? argv.p : argv.p + '/';

/* Combine all JavaScript libraries into a single file for fewer HTTP requests */
gulp.task('vendor', function() {
return gulp
.src([
'./bower_components/jquery/dist/jquery.js',
'./bower_components/magnific-popup/dist/jquery.magnific-popup.js',
'./bower_components/semantic/dist/semantic.js'
])
.pipe(concat('vendor.js'))
.pipe(gulpIf(production, uglify({
mangle: false
})))
.pipe(gulp.dest(dest + 'js/'));
});

/* Compile third-party dependencies separately for faster performance */
gulp.task('browserify-vendor', function() {
return browserify()
.require(dependencies)
.bundle()
.pipe(srcStream('vendor.bundle.js'))
.pipe(buffer())
.pipe(gulpIf(production, uglify({
mangle: false
})))
.pipe(gulp.dest(dest + 'js/'));
});

/* Compile only project files, excluding all third-party dependencies */
gulp.task('browserify', ['browserify-vendor'], function() {
return browserify({
entries: './lib/template/main.jsx',
extensions: [
'.js',
'.json',
'.es6',
'.jsx'
],
debug: false
})
.external(dependencies)
.transform(babelify, {
presets: [
'es2015',
'react'
]
})
.bundle()
.pipe(srcStream('bundle.js'))
.pipe(buffer())
.pipe(srcMaps.init({
loadMaps: true
}))
.pipe(gulpIf(production, uglify({
mangle: false
})))
.pipe(srcMaps.write('.'))
.pipe(gulp.dest(dest + 'js/'));
});

/* Same as browserify task, but will also watch for changes and re-compile */
gulp.task('browserify-watch', ['browserify-vendor'], function() {
var bundler = watchify(browserify({
entries: './lib/template/main.jsx',
debug: true
},
watchify.args
));

bundler.external(dependencies);
bundler.transform(babelify, {
presets: [
'es2015',
'react'
]
});
bundler.on('update', rebundle);
return rebundle();

function rebundle() {
var start = Date.now();

return bundler
.bundle()
.on('error', function(err) {
util.log(util.colors.red(err.toString()));
})
.on('end', function() {
util.log(util.colors.green('Finished rebundling in', (Date.now() - start) + 'ms.'));
})
.pipe(srcStream('bundle.js'))
.pipe(buffer())
.pipe(srcMaps.init({
loadMaps: true
}
))
.pipe(srcMaps.write('.'))
.pipe(gulp.dest(dest + 'js/'));
}
});

/* Compile less stylesheets. */
gulp.task('styles', function() {
return gulp
.src('./lib/template/less/main.less')
.pipe(plumber())
.pipe(less())
.pipe(autoPrefixer())
.pipe(gulpIf(production, cssMin()))
.pipe(gulp.dest(dest + 'css/'));
});

/* Watch task */
gulp.task('watch', function() {
gulp.watch('./lib/template/less/**/*.less', ['styles']);
});

/* Duplicate themes */
gulp.task('themes', function () {
return gulp
.src('./lib/template/themes/*/*/*/*')
.pipe(gulp.dest('./test/dest/js/themes/'))
.pipe(gulp.dest('./test/dest/css/themes/'));
});

/* Initialize HTML */
gulp.task('setup', function() {
return gulp
.src('./lib/template/index.html')
.pipe(gulp.dest(dest));
})

/* Publish HTML file */
gulp.task('i18n', function() {
return gulp
.src(dest + 'index.html')
.pipe(staticI18nHtml({
locale: ''
}))
.pipe(gulp.dest(dest));
});

/* Default task */
gulp.task('default', [
'styles',
'vendor',
'browserify-watch',
'watch',
'i18n'
]);

/* Build task */
gulp.task('build', [
'styles',
'vendor',
'browserify',
'i18n'
]);

/* Initialize task */
gulp.task('initial', [
'themes',
'setup'
])
Loading

0 comments on commit 9cfe06c

Please sign in to comment.