Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grunting #20

Merged
merged 3 commits into from
May 1, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
node_modules/
npm-debug.log

test/output/

.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
Thumbs.db
2 changes: 0 additions & 2 deletions .npmignore

This file was deleted.

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- 0.8
- 0.6
before_script:
- npm install -g grunt-cli
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Authors ordered by first contribution

* Trevor Jim <trever@research.att.com>
* Alasdair Mercer <mercer.alasdair@gmail.com>
* Alasdair Mercer <mercer.alasdair@gmail.com>
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
* [#3](https://github.com/neocotic/html.md/issues/3): Create unit test suite
* [#4](https://github.com/neocotic/html.md/issues/4): Rewrite code in CoffeeScript
* [#5](https://github.com/neocotic/html.md/issues/5): Add compatibility support for node.js
* [#6](https://github.com/neocotic/html.md/issues/6): Add build process
* [#6](https://github.com/neocotic/html.md/issues/6): Add build process
31 changes: 14 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing

Here are some guidelines that we'd like contributors to follow so that we can
have a chance of keeping things right.
Here are some guidelines that we'd like contributors to follow so that we can have a chance of
keeping things right.

## Getting Starting

Expand All @@ -15,27 +15,25 @@ have a chance of keeping things right.

* Create a topic branch from where you want to base your work
* This is usually the master branch
* Only target release branches if you are certain your fix must be on that
branch
* To quickly create a topic branch based on master; `git branch
fix/master/my_contribution master` then checkout the new branch with `git
checkout fix/master/my_contribution`
* Only target release branches if you are certain your fix must be on that branch
* To quickly create a topic branch based on master;
`git branch fix/master/my_contribution master` then checkout the new branch with
`git checkout fix/master/my_contribution`
* Avoid working directly on the `master` branch
* Make commits of logical units
* Check for unnecessary whitespace with `git diff --check` before committing
* Make sure your commit messages are in the proper format
```
(#99999) Make the example in CONTRIBUTING imperative and concrete

Without this patch applied the example commit message in the CONTRIBUTING
document is not a concrete example. This is a problem because the
contributor is left to imagine what the commit message should look like
based on a description rather than an example. This patch fixes the
Without this patch applied the example commit message in the CONTRIBUTING document is not a
concrete example. This is a problem because the contributor is left to imagine what the commit
message should look like based on a description rather than an example. This patch fixes the
problem by making the example concrete and imperative.

The first line is a real life imperative statement with a ticket number
from our issue tracker. The body describes the behavior without the patch,
why this is a problem, and how the patch fixes the problem when applied.
The first line is a real life imperative statement with a ticket number from our issue tracker.
The body describes the behavior without the patch, why this is a problem, and how the patch
fixes the problem when applied.
```
* Make sure you have added the necessary tests for your changes
* Run *all* the tests to assure nothing else was accidentally broken
Expand All @@ -48,13 +46,12 @@ have a chance of keeping things right.
```
* Push your changes to a topic branch in your fork of the repository
* Submit a pull request to neocotic's repository
* Update your issue to mark that you have submitted code and are ready for it
to be reviewed
* Update your issue to mark that you have submitted code and are ready for it to be reviewed
* Include a link to the pull request in the issue

# Additional Resources

* [html.md repository](https://github.com/neocotic/html.md)
* [Issue tracker](https://github.com/neocotic/html.md/issues)
* [General GitHub documentation](http://help.github.com)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests)
111 changes: 0 additions & 111 deletions Cakefile

This file was deleted.

49 changes: 49 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = (grunt) ->

# Configure
# ---------

grunt.initConfig

pkg: grunt.file.readJSON 'package.json'

clean:
docs: ['docs/*']
lib: ['lib/*']
dist: ['dist/*']

coffee:
all:
expand: yes
cwd: 'src'
src: '**/*.coffee'
dest: 'lib'
ext: '.js'

docco:
all:
options: output: 'docs'
src: ['src/**/*.coffee']

nodeunit:
all: ['test/**/*_test.coffee']

uglify:
all:
files: 'dist/md.min.js': ['lib/md.js']
options:
banner: """
/*! <%= pkg.name %> v<%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.licenses[0].type %> License
Make.text v1.5 | (c) 2007 Trevor Jim
*/
"""

# Tasks
# -----

for dependency of grunt.config.data.pkg.devDependencies when ~dependency.indexOf 'grunt-'
grunt.loadNpmTasks dependency

grunt.registerTask 'build', ['clean', 'coffee', 'docco', 'uglify']
grunt.registerTask 'default', ['build', 'test']
grunt.registerTask 'test', ['nodeunit']
16 changes: 8 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Build Requirements
In order to build [html.md][], you need to have the following install [git][] 1.7+ and the latest version of [node.js][] 0.6+ (which includes [npm][]).
In order to build [html.md][], you need to have the following install [git][] 1.7+ and [node.js][]
0.6+ (which includes [npm][]).

# Building
Follow these steps to build [html.md][];

1. Clone a copy of the main [html.md git repository](https://github.com/neocotic/html.md) by running `git clone git://github.com/neocotic/html.md.git`
1. Clone a copy of the main [html.md git repository](https://github.com/neocotic/html.md) by
running `git clone git://github.com/neocotic/html.md.git`
2. `cd` to the repository directory
3. Ensure you have all of the dependencies by entering `npm install`
4. For the compiled JavaScript `cd` to the repository directory and enter `cake build`
4. For the compiled JavaScript `cd` run `grunt build`
* Outputs `md.js` to the `lib` directory
* Outputs `md.min.js` (optimised version) to the `dist` directory
5. To run the full test suite enter `cake test`
6. To update the documentation enter `cake docs`
* Outputs `md.min.js` (compressed version) to the `dist` directory
* Outputs documentation to the `docs` directory
* Not currently working on Windows as it uses linux shell commands
5. To run the full test suite enter `grunt test`

[git]: http://git-scm.com
[node.js]: http://nodejs.org
[npm]: http://npmjs.org
[html.md]: http://neocotic.com/html.md
[html.md]: http://neocotic.com/html.md
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ 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.
SOFTWARE.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
\ \_\ \_\ \__\ \_\ \_\ \_\\____\\_\ \_\ \_\ \_\ \___,_\
\/_/\/_/\/__/\/_/\/_/\/_//____//_/\/_/\/_/\/_/\/__,_ /

[html.md][] is a pure JavaScript library for converting [HTML][] in to valid
[Markdown][].
[html.md][] is a pure JavaScript library for converting [HTML][] in to valid [Markdown][].

[![Build Status](https://secure.travis-ci.org/neocotic/html.md.png)](http://travis-ci.org/neocotic/html.md)

[html.md][] can be used normally in any browser as well as in the [node.js][]
environment where it also provides a command line interface.
[html.md][] can be used normally in any browser as well as in the [node.js][] environment where it
also provides a command line interface.

## Install

Install from [npm][]:
Install using the package manager for your desired environment(s):

``` bash
# for node.js:
$ npm install html-md
# OR; for the browser:
$ bower install html-md
```

## Usage
Expand Down Expand Up @@ -92,27 +94,26 @@ The following options are recognised by this method (all of which are optional);

### Miscellaneous

`md.noConflict()` returns `md` in a no-conflict state, reallocating the `md`
global variable name to its previous owner, where possible.
`md.noConflict()` returns `md` in a no-conflict state, reallocating the `md` global variable name
to its previous owner, where possible.

`md.VERSION` returns the current version.

## Bugs

If you have any problems with this library or would like to see the changes
currently in development you can do so here;
If you have any problems with this library or would like to see the changes currently in
development you can do so here;

https://github.com/neocotic/html.md/issues

## Questions?

Take a look at `docs/md.html` to get a better understanding of what the code is
doing.
Take a look at `docs/md.html` to get a better understanding of what the code is doing.

If that doesn't help, feel free to follow me on Twitter, [@neocotic][].

However, if you want more information or examples of using this library please
visit the project's homepage;
However, if you want more information or examples of using this library please visit the project's
homepage;

http://neocotic.com/html.md

Expand All @@ -121,4 +122,3 @@ http://neocotic.com/html.md
[html.md]: http://neocotic.com/html.md
[markdown]: http://en.wikipedia.org/wiki/Markdown
[node.js]: http://nodejs.org
[npm]: http://npmjs.org
6 changes: 3 additions & 3 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "html-md"
, "version": "2.0.2"
, "main": "dist/md.min.js"
"name": "html-md",
"version": "2.0.2",
"main": "dist/md.min.js"
}
Loading