Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for bower-specific folder changes and windows builds (covers things in issue 240) #245

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.DS_Store
build/output
/pkg/
compass/.sass-cache
site/output
site/content/pub

/node_modules/
/node_modules/
/bower_components/
32 changes: 32 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Building SyntaxHighlighter
==========================

1. Install dependencies with NPM.

`npm install`

2. Install bower

`npm install bower`

3. Install node-sass

`npm install node-sass`

*nb*: If you're using node v0.8, you'll have to use node-sass 0.3.0. In that case, you'll need to run `npm install node-sass@0.3.0`

4. Use bower to install bower.json dependencies

`./node_modules/.bin/bower install`

5. Run jake to build SyntaxHightighter

`./node_modules/.bin/jake`

Notes
-----
* You can install and run jake and/or bower globally and just run them like so
`bower install`
`jake install`

* bower requires node 0.8.0 +.
7 changes: 0 additions & 7 deletions build/README.txt

This file was deleted.

18 changes: 14 additions & 4 deletions build/build.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ isDir = (dir) ->

mkdir = (dirToMake) ->
return if fs.existsSync(dir)
dir = "/"


if isWin
dir = ""
else
dir = "/"

for part in dirToMake.split("/")
dir = path.join dir, part
fs.mkdirSync dir unless fs.existsSync(dir)
Expand Down Expand Up @@ -85,7 +89,7 @@ loadFilesIntoVariables = (dir) ->
baseDir = __dirname
sourceDir = path.join baseDir, '../src'
outputDir = path.join baseDir, '../pkg'
componentsDir = path.join baseDir, '../components'
componentsDir = path.join baseDir, '../bower_components'
includesDir = path.join baseDir, 'includes'
sourceJsDir = path.join sourceDir, 'js'
sourceSassDir = path.join sourceDir, 'sass'
Expand All @@ -95,7 +99,13 @@ outputCssDir = path.join outputDir, 'styles'
variables = loadFilesIntoVariables(includesDir)
variables.version = "3.0.83"
variables.date = new Date().toUTCString()
variables.about = variables.about.replace(/\n|\t/g, "").replace(/"/g, "\\\"")
variables.about = variables.about.replace(/\n|\r|\t/g, "").replace(/"/g, "\\\"")

###
Check to see if we're building on windows. Used in mkdir function.
http://stackoverflow.com/a/8684009/1410836
###
isWin = !!process.platform.match(/^win/)

desc "Builds SyntaxHighlighter"
task "default", ["build"]
Expand Down
2 changes: 1 addition & 1 deletion tests/brushes_tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SyntaxHighlighter Brushes Tests</title>
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/components/jquery/jquery.js"></script>

<!-- SyntaxHighlighter -->
<script type="text/javascript" src="/components/xregexp/xregexp-all.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions tests/syntaxhighlighter_tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<title>SyntaxHighlighter Highlight Tests</title>

<!-- jQuery & QUnit -->
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="js/qunit.js"></script>
<script type="text/javascript" src="/components/jquery/jquery.js"></script>
<script type="text/javascript" src="/components/xregexp/tests/qunit/qunit.js"></script>
<link type="text/css" rel="stylesheet" href="js/qunit.css"/>

<!-- SyntaxHighlighter -->
<script type="text/javascript" src="/sh/scripts/xregexp.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
<script type="text/javascript" src="/components/xregexp/xregexp-all.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
<script type="text/javascript" src="/sh/scripts/shCore.js"></script>
<script type="text/javascript" src="/sh/scripts/shLegacy.js"></script>
<script type="text/javascript" src="/sh/scripts/shBrushAppleScript.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task 'test', [ 'build' ], ->
app.use express.static __dirname + '/'
app.use express.directory __dirname + '/'
app.use '/sh', express.static __dirname + '/../pkg'
app.use '/components', express.static __dirname + '/../components'
app.use '/components', express.static __dirname + '/../bower_components'

app.listen 2010
jake.logger.log 'You can access tests on http://localhost:2010 (Ctrl+C to stop)'
jake.logger.log 'You can access tests on http://localhost:2010 (Ctrl+C to stop)'
2 changes: 1 addition & 1 deletion tests/theme_tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SyntaxHighlighter Theme Tests</title>
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/components/jquery/jquery.js"></script>
</head>

<body>
Expand Down