Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #105 from gratipay/reversing-grunt
Browse files Browse the repository at this point in the history
Add missing docs about JavaScript toolchain
  • Loading branch information
chadwhitacre committed Nov 4, 2015
2 parents 317ff31 + 7c9c235 commit 761f7d1
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Following the tutorial http://www.smashingmagazine.com/2013/10/get-up-running-grunt/
// trying to understand what is going on here.
// Better clarified by http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/

module.exports = function(grunt) {
'use strict';

Expand Down
58 changes: 53 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

grtp.co [![Builds][]][Travis] [![Deps][]][Gemnasium]
=======

Expand All @@ -8,27 +9,34 @@ Gratipay widgets + widget API
[Deps]: https://Gemnasium.com/gratipay/grtp.co.png "Dependency Status"
[Gemnasium]: https://gemnasium.com/gratipay/grtp.co

## Getting Started

## Getting Started with Development

Quickstart:
```
$ git clone [email protected]:gratipay/grtp.co.git
$ cd grtp.co
$ make run
```

Then visit <http://localhost:9537/test/>
Then visit <http://localhost:9537/test/>. For more details, read
Development section below.


## Documentation
JSDoc comments are used, but documentation generation is not setup yet. The
code is documented, please dive in.

For now ocumentation for widgets API is present in JSDoc comments,
but not generated into more readable format.

Configuration options:
- `window.grtpAPI` - Where to look for the grtp.co API
- defaults to `//grtp.co/v1/`
- `window.gratipayURI` - Where to look for Gratipay
- defaults to `https://gratipay.com/`


## Examples

In the following examples, just switch out `rummik` with your Gratipay username.

### Standard Widgets
Expand Down Expand Up @@ -84,14 +92,51 @@ widget's HTML, and the following classes:


## Other Widgets

[Shields.io](http://shields.io): [![](http://img.shields.io/gratipay/Gratipay.svg)](http://shields.io)
```html
<img src="http://img.shields.io/gratipay/Gratipay.svg">
```

[Google Gadget](lib/v1/blogger) for Blogger.

## Release and Deployment

## Development

https://grtp.co/ is a static site. But it is generated from sources.

Typical site like https://gratipay.com/ is divided into `backend` and
`frontend`. `backend` is Python code that runs on server side.
`frontend` is HTML+CSS+Javascript that is processed by browser.

https://grtp.co/ is pure `frontend`, but its HTML+CSS+Javascript
sources from repository are not what is being run on the site.
Before sources can be deployed, they need to be minified, tested and,
if you wryte styles in SASS, the .sass files need to be compiled into
CSS. So repository layout looks like:

lib/ - source files that need to be compiled
www/ - static files that are copied as-is

Javascript tools to build, lint and test source are similar to Python
tools. This can be matched approximately as this:

JavaScript | Python
--------------------------------------------------------
npm | pip
package.json | setup.py, setup.cfg, requirements.txt
Grunt | make, fabric, SCons
Gruntfile.js | Makefile, fabfile.py, SConstruct

Grunt is popular JS build systems, and there are many others, like
Gulp for example. It should be noted that `npm` itself has some kind
of dependency management, so you may not need Grunt at all.

http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/


### Release and Deployment

Grtp.co is hosted on a Digital Ocean VPS (called `droplet`) accessible
through SSH. It runs nginx and the publishing root is
`/home/grtp.co/production`.
Expand All @@ -110,6 +155,7 @@ After you make changes, you can reload configuration:
```

#### Deploy

Bump version in `package.json` and create new tag.

Add the remote to your own local repo:
Expand All @@ -124,6 +170,7 @@ code and copies files from `lib` to `www`.


## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality. Lint and test your
code using [grunt](https://github.com/gruntjs/grunt).
Expand All @@ -133,4 +180,5 @@ To help keep a consistent style, we also recommend using


## License

Released into the public domain (per CC0).

0 comments on commit 761f7d1

Please sign in to comment.