Skip to content

Commit

Permalink
Version incremented to 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Taka Okunishi committed May 1, 2016
1 parent ec8e5c9 commit ec4946d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
16 changes: 8 additions & 8 deletions lib/.index.js.bud
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

'use strict'

const apeTmpl = require('ape-tmpl'),
pkg = require('../package.json');
const apeTmpl = require('ape-tmpl')
const pkg = require('../package.json')

module.exports = apeTmpl.indexJsBud({
desc:pkg.description,
module:pkg.name,
dirname:__dirname
});
desc: pkg.description,
module: pkg.name,
dirname: __dirname
})

if(!module.parent){
require('coz').render(__filename);
if (!module.parent) {
require('coz').render(__filename)
}
39 changes: 18 additions & 21 deletions lib/highlight_jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@

'use strict'

const argx = require('argx'),
nsh = require('node-syntaxhighlighter'),
jsx = require('jsx-syntaxhighlighter'),
fs = require('fs');
const nsh = require('node-syntaxhighlighter')
const jsx = require('jsx-syntaxhighlighter')
const fs = require('fs')

/** @lends highlightJsx */
function highlightJsx(src, options) {
let args = argx(arguments);
let style = highlightJsx.style();
options = args.pop('object');
return [
'<div>',
'<style scoped="scoped">' + style + '</style>',
nsh.highlight(src, jsx, {gutter: false}
),
'</div>'
].join('');
function highlightJsx (src, options = {}) {
let style = highlightJsx.style()
return [
'<div>',
'<style scoped="scoped">' + style + '</style>',
nsh.highlight(src, jsx, { gutter: false }
),
'</div>'
].join('')
}

highlightJsx.style = function () {
let filename = nsh.getStyles()[0].sourcePath;
return fs.readFileSync(filename).toString();
};
let filename = nsh.getStyles()[ 0 ].sourcePath
return fs.readFileSync(filename).toString()
}

highlightJsx.fromFile = function (filename, options) {
let src = fs.readFileSync(filename).toString();
return highlightJsx(src, options);
let src = fs.readFileSync(filename).toString()
return highlightJsx(src, options)
}
module.exports = highlightJsx;
module.exports = highlightJsx
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ape-highlighting",
"version": "3.0.0",
"version": "3.0.1",
"description": "ape framework module for highlighting.",
"main": "lib",
"scripts": {
Expand All @@ -22,8 +22,6 @@
},
"homepage": "https://github.com/ape-repo/ape-highlighting#readme",
"dependencies": {
"argx": "^2.0.2",
"async": "^1.5.2",
"jsx-syntaxhighlighter": "^0.1.0",
"node-syntaxhighlighter": "^0.8.1"
},
Expand Down

0 comments on commit ec4946d

Please sign in to comment.