mirror of
https://github.com/ethauvin/kobalt-doc.git
synced 2025-04-25 03:57:11 -07:00
Syntax highlighting.
This commit is contained in:
parent
c11be25ff8
commit
6b7427454a
105 changed files with 17571 additions and 91 deletions
52
sh/tests/commonjs_tests.js
Normal file
52
sh/tests/commonjs_tests.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* This is a CommonJS compatibility test. You can run this file with node.
|
||||
*/
|
||||
require.paths.unshift(__dirname + '/../scripts');
|
||||
|
||||
var sys = require('sys'),
|
||||
shSyntaxHighlighter = require('shCore').SyntaxHighlighter,
|
||||
code = 'test',
|
||||
brushes = [
|
||||
'AS3',
|
||||
'AppleScript',
|
||||
'Bash',
|
||||
'CSharp',
|
||||
'ColdFusion',
|
||||
'Cpp',
|
||||
'Css',
|
||||
'Delphi',
|
||||
'Diff',
|
||||
'Erlang',
|
||||
'Groovy',
|
||||
'JScript',
|
||||
'Java',
|
||||
'JavaFX',
|
||||
'Perl',
|
||||
'Php',
|
||||
'Plain',
|
||||
'PowerShell',
|
||||
'Python',
|
||||
'Ruby',
|
||||
'Sass',
|
||||
'Scala',
|
||||
'Sql',
|
||||
'Vb',
|
||||
'Xml'
|
||||
]
|
||||
;
|
||||
|
||||
brushes.sort();
|
||||
|
||||
for (var i = 0; i < brushes.length; i++)
|
||||
{
|
||||
var name = brushes[i],
|
||||
brush = require('shBrush' + name).Brush
|
||||
;
|
||||
|
||||
brush = new brush();
|
||||
brush.init({ toolbar: false });
|
||||
|
||||
var result = brush.getHtml(code);
|
||||
|
||||
sys.puts(name + (result != null ? ': ok' : ': NOT OK'));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue