diff options
| author | Vojta Jina | 2011-05-18 11:13:46 +0200 | 
|---|---|---|
| committer | Igor Minar | 2011-06-06 22:51:59 -0700 | 
| commit | 8cb84eac6821f6c14f68936df1d7a6765ae96af5 (patch) | |
| tree | 84942e5a2b3c8a7447278fcb8b5ef6f0dceac4bb /docs/src/ngdoc.js | |
| parent | 2e0e732cadd86846b57b7b02b3303a2e0e3b842a (diff) | |
| download | angular.js-8cb84eac6821f6c14f68936df1d7a6765ae96af5.tar.bz2 | |
Log warning for every non existing link instead of throwing exception
Guess we don't want to stop doc generating process because of non-existing link, so just log warning and continue...
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index c2f5256a..c814c968 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -126,12 +126,16 @@ Doc.prototype = {          text = text.replace(/{@link\s+([^\s}]+)\s*([^}]*?)\s*}/g,            function(_all, url, title){              var isFullUrl = url.match(IS_URL), +                // FIXME(vojta) angular link could be api.angular now with sections                  isAngular = url.match(IS_ANGULAR); -            url = isFullUrl ? url : self.sectionHuristic(url); -            self.links.push(url); +            if (!isFullUrl) { +              // TODO(vojta) there could be relative link, but not angular +              // do we want to store all links (and check even the full links like http://github.com ? +              self.links.push(self.sectionHuristic(url)); +            } -            return '<a href="' + (isFullUrl ? '' + url : '#!' + url) + '">' +            return '<a href="' + (isFullUrl ? '' + url : '#!' + self.sectionHuristic(url)) + '">'                + (isAngular ? '<code>' : '')                + (title || url).replace(/\n/g, ' ')                + (isAngular ? '</code>' : '') @@ -680,11 +684,11 @@ function merge(docs){        i++;      }    } -   +    // check links    docs.forEach(function(doc) {      doc.links.forEach(function(link) { -      if (!byFullId[link]) throw 'Not existing link "' + link + '" in ' + doc.section + '/' + doc.id; +      if (!byFullId[link]) console.log('WARNING: Non existing link "' + link + '" in ' + doc.section + '/' + doc.id);      });    }); | 
