Skip to content

Commit

Permalink
prepare release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tivie committed Jun 4, 2015
1 parent 22537b8 commit db371b5
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 164 deletions.
28 changes: 14 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[*.js]
indent_style = space;
indent_size = 2;
continuation_indent_size = 2;
insert_final_newline = true;
quote_type = single;
space_after_anonymous_functions = true;
space_after_control_statements = true;
spaces_around_operators = true;
trim_trailing_whitespace = true;
spaces_in_brackets = false;
curly_bracket_next_line = true;
indent_brace_style = 1TBS;
end_of_line = lf;
charset = utf-8;
indent_style = space
indent_size = 2
continuation_indent_size = 2
insert_final_newline = true
quote_type = single
space_after_anonymous_functions = true
space_after_control_statements = true
spaces_around_operators = true
trim_trailing_whitespace = true
spaces_in_brackets = false
curly_bracket_next_line = true
indent_brace_style = 1TBS
end_of_line = lf
charset = utf-8
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ node_modules

# Users Environment Variables
.lock-wscript

#IntelliJ
.idea

8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
language: node_js
node_js:
- "0.8"
- "0.10"

#travis build speed up
before_install:
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
- npm install -g npm@latest
- npm install -g grunt-cli

#travis build speed up
sudo: false
cache:
directories:
Expand Down
44 changes: 12 additions & 32 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module.exports = function (grunt) {
'use strict';

require('shelljs/global');

var config = {
pkg: grunt.file.readJSON('package.json'),
concat: {
Expand All @@ -15,6 +13,15 @@ module.exports = function (grunt) {
dest: 'dist/<%= pkg.name %>.js'
}
},
comments: {
js: {
options: {
singleline: true,
multiline: true
},
src: ['<%= concat.dist.dest %>']
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n',
Expand Down Expand Up @@ -53,43 +60,16 @@ module.exports = function (grunt) {
reporter: 'spec'
}
}
},
// Client-side tests
mocha: {
test: {
src: ['test/browser.html'],
options: {
run: true
}
}
},
githooks: {
all: {
'pre-commit': 'pre-commit'
}
}
};

grunt.initConfig(config);

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-githooks');
require('load-grunt-tasks')(grunt);

grunt.registerTask('lint', ['jshint', 'jscs']);
grunt.registerTask('test', ['lint', 'mocha', 'simplemocha']);
grunt.registerTask('build', ['test', 'concat', 'uglify']);
grunt.registerTask('pre-commit', ['build', 'add-compressed-to-git']);

// Add compressed and minified files before committing
grunt.registerTask('add-compressed-to-git', function () {
exec('git add dist/');
});
grunt.registerTask('test', ['lint', 'simplemocha']);
grunt.registerTask('build', ['test', 'concat', 'comments', 'uglify']);

grunt.registerTask('default', []);
};
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ After including the extension in your application, you just need to enable it in
## Example

```javascript
var converter = new Showdown.converter({extensions: ['prettify']}),
var converter = new showdown.Converter({extensions: ['prettify']}),
input = "Here's a simple hello world in javascript:\n" +
"\n" +
" alert('Hello World!');\n" +
Expand All @@ -56,5 +56,5 @@ This should output the equivalent to:
```

## License
These files are distributed under BSD license. For more information, please check the [LICENSE file](https://github.com/showdownjs/prettify-extension/blob/master/LICENSE) in the source code.

These files are distributed under BSD license. For more information,
please check the [LICENSE file](https://github.com/showdownjs/prettify-extension/blob/master/LICENSE) in the source code.
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "showdown-prettify",
"description": "Add markdown prettify favor to showdown",
"description": "Add markdown prettify flavor to showdown",
"homepage": "https://github.com/showdownjs/prettify-extension",
"license": "BSD",
"authors": [
"Estevão Santos (https://github.com/tivie)",
"Estevão Soares dos Santos (https://github.com/tivie)",
"Pascal Deschênes (https://github.com/pdeschen)",
"Corey Innis (https://github.com/coreyti)",
"John Fraser"
Expand All @@ -22,7 +22,7 @@
},
"main": ["dist/showdown-prettify.js"],
"dependencies": {
"showdown": "^0.3.4"
"showdown": "1.0.x"
},
"ignore": [
"src/",
Expand Down
24 changes: 7 additions & 17 deletions dist/showdown-prettify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown-prettify.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/showdown-prettify.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown-prettify.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "showdown-prettify",
"version": "0.0.2",
"description": "Add markdown prettify favor to showdown",
"version": "1.0.0",
"description": "Add markdown prettify flavor to showdown",
"keywords": [
"markdown",
"showdown",
"showdown extension",
"prettify"
],
"author": "John Fraser",
"license": "BSD",
"author": "Estevão Soares dos Santos",
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "https://github.com/showdownjs/prettify-extension.git",
Expand All @@ -20,26 +20,22 @@
},
"main": "./dist/showdown-prettify-extension.js",
"scripts": {
"postinstall": "grunt githooks",
"test": "grunt test"
},
"dependencies": {
"showdown": "0.x.x"
"showdown": "1.0.x"
},
"devDependencies": {
"chai": "^1.10.0",
"chai": "^2.3.0",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"load-grunt-tasks": "^3.2.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-uglify": "^0.6.0",
"grunt-conventional-changelog": "^1.1.0",
"grunt-githooks": "^0.3.1",
"grunt-jscs": "^1.2.0",
"grunt-mocha": "^0.4.11",
"grunt-simple-mocha": "^0.4.0",
"jscs": "^1.10.0",
"mocha": "^2.1.0",
"shelljs": "^0.3.0"
"grunt-stripcomments": "^0.3.1"
}
}
13 changes: 6 additions & 7 deletions src/prettify.js → src/showdown-prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@

(function () {

var prettify = function (converter) {
var prettify = function () {
return [
{
type: 'output',
filter: function (source) {

return source.replace(/(<pre>)?<code>/gi, function (match, pre) {
return source.replace(/(<pre[^>]*>)?[\n\s]?<code([^>]*)>/gi, function (match, pre, codeClass) {
if (pre) {
return '<pre class="prettyprint linenums" tabIndex="0"><code data-inner="1">';
return '<pre class="prettyprint linenums"><code' + codeClass + '>';
} else {
return '<code class="prettyprint">';
return ' <code class="prettyprint">';
}
});
}
Expand All @@ -25,8 +24,8 @@
};

// Client-side export
if (typeof window !== 'undefined' && window.Showdown && window.Showdown.extensions) {
window.Showdown.extensions.prettify = prettify;
if (typeof window !== 'undefined' && window.showdown && window.showdown.extensions) {
window.showdown.extensions.prettify = prettify;
}
// Server-side export
if (typeof module !== 'undefined') {
Expand Down
61 changes: 0 additions & 61 deletions test/browser.html

This file was deleted.

6 changes: 0 additions & 6 deletions test/cases/basic.html

This file was deleted.

8 changes: 8 additions & 0 deletions test/cases/github-style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p>Here's some github code style</p>

<pre class="prettyprint linenums"><code class="js">var foo = bar;

function bazinga() {
return 'bazinga!!';
}
</code></pre>
9 changes: 9 additions & 0 deletions test/cases/github-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Here's some github code style

```js
var foo = bar;

function bazinga() {
return 'bazinga!!';
}
```
Loading

0 comments on commit db371b5

Please sign in to comment.