diff options
Diffstat (limited to 'docs/src')
| -rwxr-xr-x | docs/src/gen-docs.js | 12 | ||||
| -rw-r--r-- | docs/src/ngdoc.js | 2 | ||||
| -rw-r--r-- | docs/src/reader.js | 5 | ||||
| -rw-r--r-- | docs/src/templates/.htaccess | 2 | ||||
| -rw-r--r-- | docs/src/writer.js | 9 |
5 files changed, 13 insertions, 17 deletions
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 62d22b17..992c4527 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -5,10 +5,6 @@ var reader = require('./reader.js'), appCache = require('./appCache.js').appCache, Q = require('qq'); -process.on('uncaughtException', function(err) { - console.error(err.stack || err); -}); - var start = now(); var docs; @@ -42,10 +38,10 @@ writer.makeDir('build/docs/', true).then(function() { function writeTheRest(writesFuture) { var metadata = ngdoc.metadata(docs); - writesFuture.push(writer.symlinkTemplate('css')); - writesFuture.push(writer.symlinkTemplate('font')); - writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img')); - writesFuture.push(writer.symlinkTemplate('js')); + writesFuture.push(writer.symlinkTemplate('css', 'dir')); + writesFuture.push(writer.symlinkTemplate('font', 'dir')); + writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img', 'dir')); + writesFuture.push(writer.symlinkTemplate('js', 'dir')); var manifest = 'manifest="/build/docs/appcache.manifest"'; diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 253f5411..37e90a15 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -203,7 +203,7 @@ Doc.prototype = { flush(); this.shortName = this.name.split(/[\.:#]/).pop().trim(); this.id = this.id || // if we have an id just use it - (((this.file||'').match(/.*\/([^\/]*)\.ngdoc/)||{})[1]) || // try to extract it from file name + (((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name this.name; // default to name this.description = this.markdown(this.description); this.example = this.markdown(this.example); diff --git a/docs/src/reader.js b/docs/src/reader.js index ded573c1..a021c05f 100644 --- a/docs/src/reader.js +++ b/docs/src/reader.js @@ -7,7 +7,8 @@ exports.collect = collect; var ngdoc = require('./ngdoc.js'), Q = require('qq'), - qfs = require('q-fs'); + qfs = require('q-fs'), + PATH = require('path'); var NEW_LINE = /\n\r?/; @@ -43,7 +44,7 @@ function collect() { var work2; if (file.match(/\.ngdoc$/)) { work2 = Q.when(qfs.read(file, 'b'), function(content){ - var section = '@section ' + file.split('/')[2] + '\n'; + var section = '@section ' + file.split(PATH.sep)[2] + '\n'; allDocs.push(new ngdoc.Doc(section + content.toString(),file, 1).parse()); }); } diff --git a/docs/src/templates/.htaccess b/docs/src/templates/.htaccess index 98c7b795..e5a74cc4 100644 --- a/docs/src/templates/.htaccess +++ b/docs/src/templates/.htaccess @@ -4,7 +4,7 @@ # current angular version. If this rule matches the appcache-offline.manifest will be served for # requests to appcache.manifest # -# This file must be processed by Rake in order to replace %ANGULAR_VERSION% with the actual version. +# This file must be processed by Grunt in order to replace %ANGULAR_VERSION% with the actual version. Options -Indexes RewriteEngine on diff --git a/docs/src/writer.js b/docs/src/writer.js index 450f7cb5..b6403e34 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -61,22 +61,21 @@ exports.copy = function(from, to, transform) { exports.symlink = symlink; -function symlink(from, to) { +function symlink(from, to, type) { return qfs.exists(to).then(function(exists) { if (!exists) { - return qfs.symbolicLink(to, from); + return qfs.symbolicLink(to, from, type); } }); } exports.symlinkTemplate = symlinkTemplate; -function symlinkTemplate(filename) { +function symlinkTemplate(filename, type) { var dest = OUTPUT_DIR + filename, dirDepth = dest.split('/').length, src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename; - - return symlink(src, dest); + return symlink(src, dest, type); } |
