Skip to content

Commit

Permalink
Very initial commit. Still work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayliu50 committed Jul 15, 2017
1 parent c077032 commit e83747e
Show file tree
Hide file tree
Showing 18 changed files with 890 additions and 245 deletions.
110 changes: 54 additions & 56 deletions Brocfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

var filterCoffeeScript = require('broccoli-coffee');
var compileSass = require('broccoli-sass');
var pug = require('broccoli-pug');
Expand All @@ -9,76 +8,76 @@ var removeTrees = require('broccoli-file-remover');
var concatenate = require('broccoli-concat');
var uglify = require('broccoli-uglify-js');
var autoprefixer = require('broccoli-autoprefixer');
var angularTemplates = require("broccoli-angular-templates-cache");
var angularTemplates = require('broccoli-angular-templates-cache');
var AssetRev = require('broccoli-asset-rev');

var DEBUG = true
var MODULE_NAME = 'prototypeAngularApp'
var DEBUG = true;
var MODULE_NAME = 'prototypeAngularApp';

var app = 'app'
var app = 'app';

var coffee = funnel(app, {
include: ['**/*.coffee'],
exclude: ['demo/*'],
destDir: ''
})
destDir: '',
});

var scripts = filterCoffeeScript(coffee, {
bare: true
})
// var scripts = filterCoffeeScript(coffee, {
// bare: true
// })

var views = funnel(app, {
srcDir: '/',
include: ['**/*.pug'],
destDir: '.'
})
destDir: '.',
});

var appHtml = pug([views], {
render: true,
pugOptions: {
doctype: 'html',
pretty: DEBUG
}
pretty: DEBUG,
},
});

if (!DEBUG) {
var appHtmlJs = angularTemplates(appHtml, {
srcDir: './',
moduleName: MODULE_NAME
moduleName: MODULE_NAME,
});

scripts = mergeTrees([scripts, appHtmlJs])
// scripts = mergeTrees([scripts, appHtmlJs])

appHtml = funnel(appHtml, {
srcDir: '/',
include: ['index.html'],
destDir: '.'
})
destDir: '.',
});
}

scripts = concatenate(scripts, {
inputFiles: ['**/*.js'],
outputFile: '/scripts/app.js'
})
// scripts = concatenate(scripts, {
// inputFiles: ['**/*.js'],
// outputFile: '/scripts/app.js'
// })

var styles = sass([app + '/styles'], 'app.scss', 'app.css', {
outputStyle: DEBUG ? 'expanded' : 'compressed',
})
outputStyle: DEBUG ? 'expanded' : 'compressed',
});

if (!DEBUG) {
styles = autoprefixer(styles)
styles = autoprefixer(styles);
}

styles = concatenate(styles, {
inputFiles: ['**/*.css'],
outputFile: '/styles/app.css'
})
outputFile: '/styles/app.css',
});

var fonts = funnel(app, {
srcDir: 'fonts',
destDir: 'fonts',
allowEmpty: true,
})
});

var font_awesome = funnel('bower_components', {
srcDir: '/font-awesome/fonts',
Expand All @@ -88,45 +87,43 @@ var font_awesome = funnel('bower_components', {
'fontawesome-webfont.ttf',
'fontawesome-webfont.woff',
'fontawesome-webfont.woff2',
'FontAwesome.otf'
'FontAwesome.otf',
],
destDir: 'fonts'
})
destDir: 'fonts',
});

fonts = mergeTrees([fonts, font_awesome])
fonts = mergeTrees([fonts, font_awesome]);

var images = funnel(app, {
srcDir: 'images',
destDir: 'images',
allowEmpty: true,
})
});

var bowerCss = concatenate('bower_components', {
inputFiles: [
'font-awesome/css/font-awesome.min.css'
],
outputFile: '/styles/vendor.css'
})
inputFiles: ['font-awesome/css/font-awesome.min.css'],
outputFile: '/styles/vendor.css',
});

var appCss = mergeTrees([styles, bowerCss])
var appCss = mergeTrees([styles, bowerCss]);

// appCss = uglify(appCss, {})

// todo: get this to concatenate into one file
var bower = funnel('bower_components', {
srcDir: '/',
include: [
'jquery/dist/jquery.js',
'angular/angular.js',
'angular-ui-router/release/angular-ui-router.js',
'bower-angular-placeholders/src/img/img.js',
'bower-angular-placeholders/src/txt/txt.js',
'lodash/lodash.js',
'normalize-css/normalize.css',
'prism/prism.js',
'prism/components/prism-c.js',
// 'jquery/dist/jquery.js',
// 'angular/angular.js',
// 'angular-ui-router/release/angular-ui-router.js',
// 'bower-angular-placeholders/src/img/img.js',
// 'bower-angular-placeholders/src/txt/txt.js',
// 'lodash/lodash.js',
],
destDir: 'bower'
})

destDir: 'bower',
});

// var bower = concatenate('bower_components', {
// inputFiles: [
Expand All @@ -142,12 +139,14 @@ var bower = funnel('bower_components', {

// bower = uglify(bower, {})

var appJs = mergeTrees([scripts, bower]) // todo: merge vendor stuff into appJs if applicable
var appJs = mergeTrees([
// scripts,
bower,
]); // todo: merge vendor stuff into appJs if applicable

// unit testing
// var test;


// if (DEBUG) {
// test = funnel('test', {
// srcDir: './',
Expand All @@ -173,10 +172,9 @@ var appJs = mergeTrees([scripts, bower]) // todo: merge vendor stuff into appJs
var assets;

if (DEBUG) {
assets = mergeTrees([appJs, appCss, appHtml, fonts, images])
}
else {
assets = mergeTrees([appJs, appCss, appHtml, fonts, images])
assets = mergeTrees([appJs, appCss, appHtml, fonts, images]);
} else {
assets = mergeTrees([appJs, appCss, appHtml, fonts, images]);
}

module.exports = assets
module.exports = assets;
55 changes: 25 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
# A Prototyping Framework #
You will probably find ways that it doesn't support older browsers, or produce production-ready code. And you will find things set up in my own little, opinionated way of how things should be. You are free to use it, but prepare to be disappointed without making modifications yourself.
# QMK Cheatsheet #

Source code for the QMK Cheatsheet.



## Things to do ##

- add styling
- make printable
- add more topics (below)

## Topics not (yet?) covered ##

- dynamic macros
- mouse keys
- custom functions
- leader key
- common config.h settings

# Development #
Here are the instructions for building this cheatsheet in a development environment.

Oh, and I would NOT recommend this to be run on Windows, not until broccoli and all its dependencies are more fully supported. I have tried this on OSX and Ubuntu Linux and those seem to work fine.

- [Angular 1.6](https://angularjs.org/)
- [Lodash](http://lodash.com/)
- [CoffeeScript](coffeescript.org)
- [Sass](http://sass-lang.com/)
- [Pug](https://pugjs.org/api/getting-started.html)
- [FontAwesome](http://fontawesome.io/)
- Build using [Broccoli](https://github.com/broccolijs/broccoli)

## Getting Started ##

### Knowledge Check ###
This prototyping framework draws from the following knowledge (roughly in order of importance):

- [Required] [How Angular works](http://www.thinkster.io/angularjs/GtaQ0oMGIl). How you need to [think differently](http://stackoverflow.com/questions/14994391/how-do-i-think-in-angularjs-if-i-have-a-jquery-background) than when working with jQuery.
- [Recommended] How to read and write [Sass (SCSS)](http://sass-lang.com/guide)
- [Recommended] How to read and write [CoffeeScript](http://coffeescript.org/)
- [Recommended] [What Lodash provides you](http://lodash.com/docs) (hint, it's very similar to Underscore if you have heard of it)
- [Optional] Important for if you don't care for Pug or Coffeescript: know [how to edit the Brocfile.js](https://github.com/broccolijs/broccoli)
- [Optional] How to read and write [Pug](https://pugjs.org/api/getting-started.htmlreference/)

### Requires the following to be installed ###
So go and install these for your operating system
- [Node.js](http://nodejs.org/)
- [Ruby](http://rubyinstaller.org/downloads/) with [Bundler](http://bundler.io/)

Run this

Expand All @@ -42,7 +47,7 @@ Run after getting source code, in the source root directory
bower install
```

###Get the server running###
### Get the server running ###

```
broccoli serve
Expand Down Expand Up @@ -73,16 +78,6 @@ Broccoli has the ability to build the assets without running a server
broccoli build [your-target-folder-name-here]
```

### Debugging Options ###

Turning on DEBUG in `Brocfile.js` will disable Angular template caching and asset-rev.

## Known Issues with the Environment ##

- Broccoli is configured to only process CoffeeScript (not even plain Javascript), Pug (not even plain HTML), and SCSS. For those not happy with that, it should be just a touchup in the Brocfile.js. Feel free to submit pull requests.
- Windows development environment is NOT supported, because it is not fully supported by broccoli

## To do ##
## Known Issues with the Development Environment ##

- Get Susy v3 set up
- Upgrade away from Bower?
- Windows development environment is NOT supported, because it is not fully supported by broccoli
4 changes: 0 additions & 4 deletions app/components/app.coffee

This file was deleted.

21 changes: 0 additions & 21 deletions app/components/main/main.coffee

This file was deleted.

22 changes: 0 additions & 22 deletions app/components/main/main.pug

This file was deleted.

3 changes: 0 additions & 3 deletions app/components/services/customService.coffee

This file was deleted.

24 changes: 13 additions & 11 deletions app/index.pug
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
doctype html
html(lang="en")
head
title Start your prototyping
// todo: get all these bower files to come out of the same concatenated file
script(src='/bower/jquery/dist/jquery.js')
script(src='/bower/lodash/lodash.js')
script(src='/bower/angular/angular.js')
script(src='/bower/angular-ui-router/release/angular-ui-router.js')
script(src='/bower/bower-angular-placeholders/src/img/img.js')
script(src='/bower/bower-angular-placeholders/src/txt/txt.js')
script(src='/scripts/app.js')
title QMK Cheatsheet
script(src='/bower/prism/prism.js')
script(src='/bower/prism/components/prism-c.js')
link(rel='stylesheet', href='/styles/vendor.css')
link(rel='stylesheet', href='/styles/app.css')

body(ng-app="prototypeAngularApp")
main-component
body
h1 QMK Cheatsheet
main
include pages/layer
include pages/modifiers
include pages/macros
include pages/tap-dance
footer.
Version 0.1 by Jay Liu
#[a(href="https://github.com/jayliu50/qmk-cheatsheet/issues" target="_blank") Report Issues]
Loading

0 comments on commit e83747e

Please sign in to comment.