Skip to content

Commit

Permalink
prefixing all css classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jan 30, 2013
1 parent f134e00 commit 76ea4ca
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions component.json
@@ -1,10 +1,10 @@
{
"name":"json-markup",
"repo":"mafintosh/json-markup",
"version":"0.1.2",
"version":"0.1.3",
"description":"a json to html syntax highlighter",
"keywords": ["json", "html", "syntax", "highlight"],
"author": "Mathias Buus Madsen <mathiasbuus@gmail.com>",
"scripts": ["index.js"],
"styles": ["style.css"]
}
}
12 changes: 6 additions & 6 deletions index.js
Expand Up @@ -34,19 +34,19 @@ module.exports = function(doc) {

switch (type(obj)) {
case 'boolean':
return '<span class="bool">'+obj+'</span>';
return '<span class="json-markup-bool">'+obj+'</span>';

case 'number':
return '<span class="number">'+obj+'</span>';
return '<span class="json-markup-number">'+obj+'</span>';

case 'null':
return '<span class="null">null</span>\n';
return '<span class="json-markup-null">null</span>\n';

case 'string':
return '<span class="string">"'+escape(obj)+'"</span>';
return '<span class="json-markup-string">"'+escape(obj)+'"</span>';

case 'link':
return '<span class="string">"<a href="'+escape(obj)+'">'+escape(obj)+'</a>"</span>';
return '<span class="json-markup-string">"<a href="'+escape(obj)+'">'+escape(obj)+'</a>"</span>';

case 'array':
return forEach(obj, '[', ']', visit);
Expand All @@ -57,7 +57,7 @@ module.exports = function(doc) {
});

return forEach(keys, '{', '}', function(key) {
return '<span class="key">'+key + ':</span> '+visit(obj[key]);
return '<span class="json-markup-key">'+key + ':</span> '+visit(obj[key]);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name":"json-markup",
"version":"0.1.2",
"version":"0.1.3",
"repository": "git://github.com/mafintosh/json-markup",
"description":"a json to html syntax highlighter",
"keywords": ["json", "html", "syntax", "highlight"],
Expand Down
10 changes: 5 additions & 5 deletions style.css
Expand Up @@ -4,18 +4,18 @@
font-family: monospace;
white-space: pre;
}
.json-markup .key {
.json-markup-key {
font-weight: bold;
}
.json-markup .bool {
.json-markup-bool {
color: firebrick;
}
.json-markup .string {
.json-markup-string {
color: green;
}
.json-markup .null {
.json-markup-null {
color: gray;
}
.json-markup .number {
.json-markup-number {
color: blue;
}

0 comments on commit 76ea4ca

Please sign in to comment.