Skip to content

Commit

Permalink
Renames html-renderer to syntaxhighlighter-html-renderer.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgorbatchev committed Feb 7, 2016
1 parent 89535ae commit 59e7678
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
17 changes: 12 additions & 5 deletions README.md
@@ -1,16 +1,23 @@
# syntaxhighlighter/html-renderer
# syntaxhighlighter-html-renderer

HTML renderer module for [SyntaxHighlighter](https://github.com/syntaxhighlighter/syntaxhighlighter). It takes in the source, list of processed matches and returns HTML string.
[![GratiPay](https://img.shields.io/gratipay/user/alexgorbatchev.svg)](https://gratipay.com/alexgorbatchev/)
[![Build Status](https://travis-ci.org/syntaxhighlighter/syntaxhighlighter-html-renderer.svg)](https://travis-ci.org/syntaxhighlighter/syntaxhighlighter-html-renderer)
![Downloads](https://img.shields.io/npm/dm/syntaxhighlighter-html-renderer.svg)
![Version](https://img.shields.io/npm/v/syntaxhighlighter-html-renderer.svg)

[![Build Status](https://travis-ci.org/syntaxhighlighter/html-renderer.svg)](https://travis-ci.org/syntaxhighlighter/html-renderer)
HTML renderer module for [SyntaxHighlighter](https://github.com/syntaxhighlighter/syntaxhighlighter). It takes in the source, list of processed matches and returns HTML string.

## Installation

npm install html-renderer
```
npm install html-renderer
```

## Testing

npm test
```
npm test
```

## License

Expand Down
4 changes: 1 addition & 3 deletions html-renderer.js → index.js
Expand Up @@ -39,7 +39,7 @@ function getLinesToHighlight(opts)
return results;
}

function Renderer(code, matches, opts)
export default function Renderer(code, matches, opts)
{
var _this = this;

Expand Down Expand Up @@ -388,5 +388,3 @@ Renderer.prototype = {
return html;
},
};

module.exports = Renderer;
13 changes: 7 additions & 6 deletions package.json
@@ -1,22 +1,23 @@
{
"name": "html-renderer",
"name": "syntaxhighlighter-html-renderer",
"version": "4.0.0",
"description": "HTML renderer module for SyntaxHighlighter.",
"keywords": [
"syntaxhighlighter",
"html",
"renderer"
"renderer",
"core"
],
"homepage": "https://github.com/syntaxhighlighter/html-renderer",
"bugs": "https://github.com/syntaxhighlighter/html-renderer/issues",
"homepage": "https://github.com/syntaxhighlighter/syntaxhighlighter-html-renderer",
"bugs": "https://github.com/syntaxhighlighter/syntaxhighlighter-html-renderer/issues",
"author": {
"name": "Alex Gorbatchev",
"url": "https://github.com/alexgorbatchev"
},
"main": "./html-renderer.js",
"main": "./index.js",
"repository": {
"type": "git",
"url": "https://github.com/syntaxhighlighter/html-renderer.git"
"url": "https://github.com/syntaxhighlighter/syntaxhighlighter-html-renderer.git"
},
"scripts": {
"test": "mocha --opts mocha.opts test.js"
Expand Down
15 changes: 7 additions & 8 deletions test.js
@@ -1,9 +1,8 @@
const $ = require('cheerio');
const chai = require('chai');
const fs = require('fs');
const match = require('syntaxhighlighter-match');
const Renderer = require('./html-renderer');
const expect = chai.expect;
import $ from 'cheerio';
import { expect } from 'chai';
import fs from 'fs';
import { applyRegexList } from 'syntaxhighlighter-match';
import Renderer from '.';

const REGEX_LIST = [
{regex: /hello|world/g, css: 'greeting'},
Expand All @@ -13,12 +12,12 @@ const REGEX_LIST = [
const CODE = fs.readFileSync(`${__dirname}/fixture.js`, 'utf8');

function getHtml(code, opts = {}) {
const matches = match.applyRegexList(code, opts.regexList || REGEX_LIST);
const matches = applyRegexList(code, opts.regexList || REGEX_LIST);
const renderer = new Renderer(code, matches, opts);
return renderer.getHtml();
}

describe('html-renderer', function() {
describe('syntaxhighlighter-html-renderer', function() {
let element = null;

function itHasElements({gutter, lineCount, firstLine = 1, highlight = []} = {}) {
Expand Down

0 comments on commit 59e7678

Please sign in to comment.