-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
627 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"validateIndentation": 2, | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"requireOperatorBeforeLineBreak": true, | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"validateIndentation": 2, | ||
"validateQuoteMarks": "'", | ||
"disallowMultipleLineStrings": true, | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"requireMultipleVarDecl": true, | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"=", | ||
"+=", | ||
"-=", | ||
"*=", | ||
"/=", | ||
"%=", | ||
"<<=", | ||
">>=", | ||
">>>=", | ||
"&=", | ||
"|=", | ||
"^=", | ||
"+=", | ||
"+", | ||
"-", | ||
"*", | ||
"/", | ||
"%", | ||
"<<", | ||
">>", | ||
">>>", | ||
"&", | ||
"|", | ||
"^", | ||
"&&", | ||
"||", | ||
"===", | ||
"==", | ||
">=", | ||
"<=", | ||
"<", | ||
">", | ||
"!=", | ||
"!==" | ||
], | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireSpacesInForStatement": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInsideObjectBrackets": "all", | ||
"disallowSpacesInsideArrayBrackets": "all", | ||
"disallowSpacesInsideParentheses": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"requireParamTypes": true | ||
}, | ||
"disallowMultipleLineBreaks": true, | ||
"disallowNewlineBeforeBlockStatements": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": "nofunc", | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"undef": false, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"onevar": true, | ||
"globals": { | ||
"angular": true, | ||
"module": true, | ||
"define": true, | ||
"window": true, | ||
"showdown": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
|
||
#travis build speed up | ||
sudo: false | ||
cache: | ||
directories: | ||
- node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
module.exports = function (grunt) { | ||
'use strict'; | ||
|
||
require('shelljs/global'); | ||
|
||
var config = { | ||
pkg: grunt.file.readJSON('package.json'), | ||
concat: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', | ||
sourceMap: true | ||
}, | ||
dist: { | ||
src: ['src/*.js'], | ||
dest: 'dist/<%= pkg.name %>.js' | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', | ||
sourceMap: true | ||
}, | ||
dist: { | ||
files: { | ||
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] | ||
} | ||
} | ||
}, | ||
jshint: { | ||
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'] | ||
}, | ||
jscs: { | ||
options: { | ||
config: '.jscs.json', | ||
files: [ | ||
'Gruntfile.js', | ||
'src/**/*.js', | ||
'test/**/*.js' | ||
] | ||
} | ||
}, | ||
changelog: { | ||
options: {} | ||
}, | ||
//Server-side tests | ||
simplemocha: { | ||
test: { | ||
src: 'test/node.js', | ||
options: { | ||
globals: ['should'], | ||
timeout: 3000, | ||
ignoreLeaks: false, | ||
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'); | ||
|
||
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('default', []); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,60 @@ | ||
prettify | ||
======== | ||
Showdown's Prettify Extension | ||
========================== | ||
|
||
[![Build Status](https://travis-ci.org/showdownjs/prettify-extension)](https://travis-ci.org/showdownjs/prettify-extension.svg) [![npm version](https://badge.fury.io/js/showdown-prettify.svg)](http://badge.fury.io/js/showdown-prettify) [![npm version](https://badge.fury.io/bo/showdown-prettify.svg)](http://badge.fury.io/bo/showdown-prettify) | ||
|
||
------ | ||
|
||
**An extension to add [Google Prettify](http://code.google.com/p/google-code-prettify/) hints to [showdown](https://github.com/showdownjs/showdown)'s HTML output ** | ||
|
||
|
||
## Installation | ||
|
||
### With [npm](http://npmjs.org) | ||
|
||
npm install showdown-prettify | ||
|
||
### With [bower](http://bower.io/) | ||
|
||
bower install showdown-prettify | ||
|
||
### Manual | ||
|
||
You can also [download the latest release zip or tarball](https://github.com/showdownjs/prettify-extension/releases) and include it in your webpage, after showdown: | ||
|
||
<script src="showdown.min.js"> | ||
<script src="showdown-prettify.min.js"> | ||
|
||
### Enabling the extension | ||
|
||
After including the extension in your application, you just need to enable it in showdown. | ||
|
||
var converter = new Showdown.converter({extensions: ['prettify']}); | ||
|
||
## Example | ||
|
||
```javascript | ||
var converter = new Showdown.converter({extensions: ['prettify']}), | ||
input = "Here's a simple hello world in javascript:\n" + | ||
"\n" + | ||
" alert('Hello World!');\n" + | ||
"\n" + | ||
"The `alert` function is a build-in global from `window`."; | ||
html = converter.makeHtml(input); | ||
console.log(html); | ||
``` | ||
|
||
This should output the equivalent to: | ||
|
||
```html | ||
<p>Here's a simple hello world in javascript:</p> | ||
|
||
<pre class="prettyprint linenums" tabIndex="0"><code data-inner="1">alert('Hello World!'); | ||
</code></pre> | ||
|
||
<p>The <code class="prettyprint">alert</code> function is a build-in global from <code class="prettyprint">window</code>.</p> | ||
``` | ||
|
||
## 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. | ||
|
||
Prettify extension for Showdown.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "showdown-prettify", | ||
"description": "Add markdown prettify favor to showdown", | ||
"homepage": "https://github.com/showdownjs/prettify-extension", | ||
"license": "BSD", | ||
"authors": [ | ||
"Estevão Santos (https://github.com/tivie)", | ||
"Pascal Deschênes (https://github.com/pdeschen)", | ||
"Corey Innis (https://github.com/coreyti)", | ||
"John Fraser" | ||
], | ||
"keywords": [ | ||
"markdown", | ||
"showdown", | ||
"showdown extension", | ||
"prettify" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/showdownjs/prettify-extension.git", | ||
"web": "https://github.com/showdownjs/prettify-extension" | ||
}, | ||
"main": ["dist/showdown-prettify.js"], | ||
"ignore": [ | ||
"src/", | ||
"test/", | ||
".editorconfig", | ||
".gitignore", | ||
".jscs.json", | ||
".jshintrc", | ||
".travis.yml", | ||
"Gruntfile.js" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.