diff --git a/.gitignore b/.gitignore index b6d52bd9b9..679af37907 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,12 @@ _.* **/resources/zips public/docs/xref-*.* _zip-output -www +www* npm-debug*.log* *.plnkr.html plnkr.html +*.eplnkr.html +eplnkr.html *plnkr.no-link.html public/docs/*/latest/guide/cheatsheet.json protractor-results.txt diff --git a/.travis.yml b/.travis.yml index bf6b8894aa..7a87796437 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,18 +12,17 @@ env: - CHROME_BIN=chromium-browser - LATEST_RELEASE=2.0.0-rc.5 - TASK_FLAGS="--dgeni-log=warn" - # - TASK_FLAGS="" matrix: - TASK=lint - TASK="run-e2e-tests --fast" SCRIPT=examples-install.sh - TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh - - TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50" - - TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" + - TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" + - TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" matrix: fast_finish: true allow_failures: - env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh - - env: TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" + - env: TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" before_install: - source ./scripts/env-set.sh - ./scripts/before-install.sh @@ -34,3 +33,4 @@ before_script: - sh -e /etc/init.d/xvfb start script: - $WAIT gulp $TASK $TASK_FLAGS + - if [[ -n "$POST_SCRIPT" ]]; then ./scripts/$POST_SCRIPT; fi diff --git a/gulpfile.js b/gulpfile.js index 33a555d09e..366310ec49 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,7 +45,8 @@ var STYLES_SOURCE_PATH = path.join(TOOLS_PATH, 'styles-builder/less'); var docShredder = require(path.resolve(TOOLS_PATH, 'doc-shredder/doc-shredder')); var exampleZipper = require(path.resolve(TOOLS_PATH, '_example-zipper/exampleZipper')); -var plunkerBuilder = require(path.resolve(TOOLS_PATH, 'plunker-builder/plunkerBuilder')); +var regularPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/regularPlunker')); +var embeddedPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/embeddedPlunker')); var fsUtils = require(path.resolve(TOOLS_PATH, 'fs-utils/fsUtils')); const isSilent = !!argv.silent; @@ -72,9 +73,10 @@ var _apiShredOptions = { logLevel: _dgeniLogLevel }; +const relDartDocApiDir = path.join('doc', 'api'); var _apiShredOptionsForDart = { lang: 'dart', - examplesDir: path.resolve(ngPathFor('dart'), 'examples'), + examplesDir: path.resolve(ngPathFor('dart'), 'example'), fragmentsDir: path.join(DOCS_PATH, '_fragments/_api'), zipDir: path.join(RESOURCES_PATH, 'zips/api'), logLevel: _dgeniLogLevel @@ -118,22 +120,35 @@ var _styleLessName = 'a2docs.less'; // or a regex pattern to match any one of 'ts', 'js', or 'dart'. // Default: 'ts|js' except for the "full site build" tasks (see below), // for which it is 'all'. -// -var lang, langs, buildDartApiDocs = false; + +// langs and skipLangs partition ['ts', 'js', 'dart']. +var lang, langs, skipLangs, buildDartApiDocs = false; function configLangs(langOption) { - const fullSiteBuildTasks = ['build-compile', 'check-serve', 'check-deploy']; + const fullSiteBuildTasks = ['build-compile', 'check-deploy', 'harp-compile']; const buildAllDocs = argv['_'] && fullSiteBuildTasks.some((task) => argv['_'].indexOf(task) >= 0); const langDefault = buildAllDocs ? 'all' : 'ts|js'; - lang = (langOption || langDefault).toLowerCase(); - if (lang === 'all') lang = 'ts|js|dart'; - langs = lang.match(/\w+/g); // the languages in `lang` as an array - gutil.log('Building docs for: ' + lang); + if (langOption === '') { + lang = ''; + langs = []; + } else { + lang = (langOption || langDefault).toLowerCase(); + if (lang === 'all') lang = 'ts|js|dart'; + langs = lang.match(/\w+/g); // the languages in `lang` as an array + } + gutil.log(`Building docs for: [${langs}]`); if (langs.indexOf('dart') >= 0) { buildDartApiDocs = true; // For Dart, be proactive about checking for the repo checkAngularProjectPath(ngPathFor('dart')); + } else { + argv.pub = false; } + skipLangs = []; + ['ts', 'js', 'dart'].forEach(lang => { + if (langs.indexOf(lang) < 0) skipLangs.push(lang); + }); + gutil.log(`Skipped languages: [${skipLangs}]`); } configLangs(argv.lang); @@ -346,6 +361,7 @@ function runE2eDartTests(appDir, outputFile) { } if (argv.pub === false) { var prepPromise = Promise.resolve(true); + gutil.log('Skipping pub upgrade and pub build (--no-pub flag present)'); } else { var pubUpgradeSpawnInfo = spawnExt('pub', ['upgrade'], { cwd: appDir }); var prepPromise = pubUpgradeSpawnInfo.promise.then(function (data) { @@ -508,23 +524,42 @@ gulp.task('remove-example-boilerplate', function() { // either release or current build packages // Examples: // gulp install-example-angular --build // use current build packages +// gulp install-example-angular --build=2.0.0-b43f954 // use tagged packages // gulp install-example-angular // restore release packages +// +// Find the tags here: https://github.com/angular/core-builds/releases gulp.task('install-example-angular', installExampleAngular); function installExampleAngular() { var sources; var template; var libs = [ - 'core', 'common', 'compiler', + 'core', 'common', 'compiler', 'compiler-cli', 'platform-browser', 'platform-browser-dynamic', 'forms', 'http', 'router', 'upgrade']; + var build = argv.build; + if (build) { + if (typeof build === 'string') { + build = (build[0]==='#' ? '' : '#') + build; + } else { + build = ''; + } + } else{ + build = 'npm'; + } // Like: "angular/core-builds" or "@angular/core" - sources = libs.map( lib => argv.build ? `angular/${lib}-builds` : `@angular/${lib}`); + sources = libs.map( lib => { + return build === 'npm' + ? `@angular/${lib}` + : `git+https://github.com/angular/${lib}-builds${build}`; + }); + + if (argv.build) { sources.push('@angular/tsc-wrapped');} // tsc-wrapped needed for builds sources.push('@angular/router-deprecated'); - gutil.log(`Installing Angular npm packages from ${argv.build ? 'BUILD' : 'RELEASE'}`); + gutil.log(`Installing Angular packages from ${build === 'npm' ? 'NPM' : 'BUILD ' + build}`); var spawnInfo = spawnExt('rm', ['-rf', 'node_modules/@angular'], { cwd: EXAMPLES_PATH}); return spawnInfo.promise @@ -598,8 +633,10 @@ gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function() return buildApiDocsForDart(); }); +// Using the --build flag will use systemjs.config.plunker.build.js (for preview builds) gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() { - return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); + regularPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); + return embeddedPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); }); gulp.task('build-dart-cheatsheet', [], function() { @@ -608,8 +645,8 @@ gulp.task('build-dart-cheatsheet', [], function() { gulp.task('dartdoc', ['pub upgrade'], function() { const ngRepoPath = ngPathFor('dart'); - if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, 'docs', 'api'))) { - gutil.log('Skipping dartdoc: --fast flag enabled and "docs/api" dir exists'); + if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, relDartDocApiDir))) { + gutil.log(`Skipping dartdoc: --fast flag enabled and api dir exists (${relDartDocApiDir})`); return true; } checkAngularProjectPath(ngRepoPath); @@ -618,7 +655,7 @@ gulp.task('dartdoc', ['pub upgrade'], function() { renameIfExistsSync(topLevelLibFilePath, tmpPath); gutil.log(`Hiding top-level angular2 library: ${topLevelLibFilePath}`); // Remove dartdoc '--add-crossdart' flag while we are fixing links to API pages. - const dartdoc = spawnExt('dartdoc', ['--output', 'docs/api'], { cwd: ngRepoPath}); + const dartdoc = spawnExt('dartdoc', ['--output', relDartDocApiDir], { cwd: ngRepoPath}); return dartdoc.promise.finally(() => { gutil.log(`Restoring top-level angular2 library: ${topLevelLibFilePath}`); renameIfExistsSync(tmpPath, topLevelLibFilePath); @@ -682,12 +719,12 @@ gulp.task('git-changed-examples', ['_shred-devguide-examples'], function(){ }); }); -gulp.task('harp-compile', [], function() { +gulp.task('harp-compile', () => { return harpCompile() }); -gulp.task('serve', [], function() { - // Harp will serve files from workspace. +gulp.task('harp-serve', () => { + // Harp will watch and serve workspace files. const cmd = 'npm run harp -- server .'; gutil.log('Launching harp server (over project files)'); gutil.log(` > ${cmd}`); @@ -695,7 +732,7 @@ gulp.task('serve', [], function() { return execPromise(cmd); }); -gulp.task('serve-www', [], function() { +gulp.task('serve-www', () => { // Serve generated site. return execPromise('npm run live-server ./www'); }); @@ -704,13 +741,6 @@ gulp.task('build-compile', ['build-docs'], function() { return harpCompile(); }); -gulp.task('check-serve', ['build-docs'], function() { - return harpCompile().then(function() { - gutil.log('Launching live-server over ./www'); - return execPromise('npm run live-server ./www'); - }); -}); - gulp.task('check-deploy', ['build-docs'], function() { return harpCompile().then(function() { gutil.log('compile ok'); @@ -806,7 +836,7 @@ gulp.task('_shred-clean-devguide', function(cb) { gulp.task('_shred-api-examples', ['_shred-clean-api'], function() { const promises = []; gutil.log('Shredding API examples for languages: ' + langs.join(', ')); - langs.forEach((lang) => { + langs.forEach(lang => { if (lang === 'js') return; // JS is handled via TS. checkAngularProjectPath(ngPathFor(lang)); const options = lang == 'dart' ? _apiShredOptionsForDart : _apiShredOptions; @@ -856,26 +886,40 @@ gulp.task('lint', function() { function harpCompile() { // Supposedly running in production makes harp faster // and less likely to drown in node_modules. - env({ - vars: { NODE_ENV: "production" } - }); + env({ vars: { NODE_ENV: "production" } }); gutil.log("NODE_ENV: " + process.env.NODE_ENV); + if(skipLangs && fs.existsSync('www') && backupApiHtmlFilesExist('www')) { + gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`); + gutil.log(`API docs will be copied from existing www folder.`) + del.sync('www-backup'); // remove existing backup if it exists + renameIfExistsSync('www', 'www-backup'); + } else { + gutil.log(`Harp full site compile, including API docs for all languages.`); + if (skipLangs) + gutil.log(`Ignoring API docs skip set (${skipLangs}) because full ` + + `site has not been built yet or some API HTML files are missing.`); + } + var deferred = Q.defer(); gutil.log('running harp compile...'); showHideExampleNodeModules('hide'); + showHideApiDir('hide'); var spawnInfo = spawnExt('npm',['run','harp', '--', 'compile', '.', './www' ]); spawnInfo.promise.then(function(x) { gutil.log("NODE_ENV: " + process.env.NODE_ENV); showHideExampleNodeModules('show'); + showHideApiDir('show'); if (x !== 0) { deferred.reject(x) } else { + restoreApiHtml(); deferred.resolve(x); } }).catch(function(e) { gutil.log("NODE_ENV: " + process.env.NODE_ENV); showHideExampleNodeModules('show'); + showHideApiDir('show'); deferred.reject(e); }); return deferred.promise; @@ -974,6 +1018,52 @@ function showHideExampleNodeModules(showOrHide) { } } +// Show/hide the API docs harp source folder for every lang in skipLangs. +function showHideApiDir(showOrHide) { + skipLangs.forEach(lang => { + _showHideApiDir(lang, showOrHide); + }); +} + +// Rename the API docs harp source folder for lang to/from 'api' to '_api-tmp-foo'. +function _showHideApiDir(lang, showOrHide) { + const vers = 'latest'; + const basePath = path.join(DOCS_PATH, lang, vers); + const apiDirPath = path.join(basePath, 'api'); + const disabledApiDirPath = path.join(basePath, '_api-tmp-hide-from-jade'); + const args = showOrHide == 'hide' + ? [apiDirPath, disabledApiDirPath] + : [disabledApiDirPath, apiDirPath]; + renameIfExistsSync(...args); +} + +// For each lang in skipLangs, copy the API dir from www-backup to www. +function restoreApiHtml() { + const vers = 'latest'; + skipLangs.forEach(lang => { + const relApiDir = path.join('docs', lang, vers, 'api'); + const wwwApiSubdir = path.join('www', relApiDir); + const backupApiSubdir = path.join('www-backup', relApiDir); + gutil.log(`cp ${backupApiSubdir} ${wwwApiSubdir}`) + fs.copySync(backupApiSubdir, wwwApiSubdir); + }); +} + +// For each lang in skipLangs, ensure API dir exists in www-backup +function backupApiHtmlFilesExist(folderName) { + const vers = 'latest'; + var result = 1; + skipLangs.forEach(lang => { + const relApiDir = path.join('docs', lang, vers, 'api'); + const backupApiSubdir = path.join(folderName, relApiDir); + if (!fs.existsSync(backupApiSubdir)) { + gutil.log(`WARNING: API docs HTML folder doesn't exist: ${backupApiSubdir}`); + result = 0; + } + }); + return result; +} + // Copies fileNames into destPaths, setting the mode of the // files at the destination as optional_destFileMode if given. // returns a promise @@ -1073,11 +1163,16 @@ function watchAndSync(options, cb) { var browserSync = require('browser-sync').create(); browserSync.init({proxy: 'localhost:9000'}); + // When using the --focus=name flag, only **/name/**/*.* example files and + // **/name.jade files are watched. This is useful for performance reasons. + // Example: gulp serve-and-sync --focus=architecture + var focus = argv.focus; + if (options.devGuide) { - devGuideExamplesWatch(_devguideShredOptions, browserSync.reload); + devGuideExamplesWatch(_devguideShredOptions, browserSync.reload, focus); } if (options.devGuideJade) { - devGuideSharedJadeWatch( { jadeDir: DOCS_PATH}, browserSync.reload); + devGuideSharedJadeWatch( { jadeDir: DOCS_PATH}, browserSync.reload, focus); } if (options.apiDocs) { apiSourceWatch(browserSync.reload); @@ -1092,11 +1187,10 @@ function watchAndSync(options, cb) { // returns a promise; function askDeploy() { - prompt.start(); var schema = { name: 'shouldDeploy', - description: 'Deploy to Firebase? (y/n): ', + description: 'Deploy to Firebase? (y/n)', type: 'string', pattern: /Y|N|y|n/, message: "Respond with either a 'y' or 'n'", @@ -1145,8 +1239,9 @@ function apiExamplesWatch(postShredAction) { }); } -function devGuideExamplesWatch(shredOptions, postShredAction) { - var includePattern = path.join(shredOptions.examplesDir, '**/*.*'); +function devGuideExamplesWatch(shredOptions, postShredAction, focus) { + var watchPattern = focus ? '**/' + focus + '/**/*.*' : '**/*.*'; + var includePattern = path.join(shredOptions.examplesDir, watchPattern); // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { @@ -1162,8 +1257,9 @@ function devGuideExamplesWatch(shredOptions, postShredAction) { }); } -function devGuideSharedJadeWatch(shredOptions, postShredAction) { - var includePattern = path.join(DOCS_PATH, '**/*.jade'); +function devGuideSharedJadeWatch(shredOptions, postShredAction, focus) { + var watchPattern = focus ? '**/' + focus + '.jade' : '**/*.jade'; + var includePattern = path.join(DOCS_PATH, watchPattern); // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.jadeDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { @@ -1246,7 +1342,7 @@ function buildApiDocsForDart() { log.level = _dgeniLogLevel; const dabInfo = dab.dartPkgConfigInfo; dabInfo.ngIoDartApiDocPath = path.join(DOCS_PATH, 'dart', vers, 'api'); - dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), 'docs', 'api'); + dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), relDartDocApiDir); // Exclude API entries for developer/internal libraries. Also exclude entries for // the top-level catch all "angular2" library (otherwise every entry appears twice). dabInfo.excludeLibRegExp = new RegExp(/^(?!angular2)|\.testing|_|codegen|^angular2$/); @@ -1461,8 +1557,9 @@ function checkAngularProjectPath(_ngPath) { function renameIfExistsSync(oldPath, newPath) { if (fs.existsSync(oldPath)) { - fs.renameSync(oldPath, newPath); + gutil.log(`Rename: mv ${oldPath} ${newPath}`); + fs.renameSync(oldPath, newPath); } else { - gutil.log(`renameIfExistsSync cannot find file to rename: ${oldPath}`); + gutil.log(`renameIfExistsSync cannot rename, path not found: ${oldPath}`); } } diff --git a/package.json b/package.json index 2e848d239c..f13d2126c1 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "protractor": "^3.0.0", "q": "^1.4.1", "tree-kill": "^1.0.0", - "tslint": "^3.2.2", + "tslint": "^3.15.1", "yargs": "^4.7.1" }, "dependencies": { diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade index d2ce8d2639..f7e9a27ae3 100644 --- a/public/_includes/_hero.jade +++ b/public/_includes/_hero.jade @@ -35,5 +35,8 @@ header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "") else if current.path[3] == 'api' && current.path[1] == 'dart' block breadcrumbs + //- Show cross-language menu for top-level API page (but not entry pages) + if ! public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]] + != partial("_version-dropdown") else if current.path[0] == "docs" != partial("_version-dropdown") diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade index 946f82d2f4..3e580095c3 100644 --- a/public/_includes/_util-fns.jade +++ b/public/_includes/_util-fns.jade @@ -155,64 +155,66 @@ mixin makeJson( filePath, jsonConfig, title, stylePatterns) else != styleString(jsonExtract, stylePatterns) -- // Open (and close) an explanation
. See QuickStart -script. - function why(id, backTo) { - var id = "#"+id; - var el = document.querySelector(id); - el.hidden=el.hidden=!el.hidden; +if !jade2ng + //- Open (and close) an explanation
. See QuickStart + script. + function why(id, backTo) { + var id = "#"+id; + var el = document.querySelector(id); + el.hidden=el.hidden=!el.hidden; - if (el.hidden && backTo){ - // the next line is required to work around a bug in WebKit (Chrome / Safari) - location.href = "#"; - location.href = "#" + backTo; + if (el.hidden && backTo){ + // the next line is required to work around a bug in WebKit (Chrome / Safari) + location.href = "#"; + location.href = "#" + backTo; + } } - } -script. - function verbose(isVerbose) { - isVerbose = !! isVerbose; - var el = document.querySelector('button.verbose.off'); - el.style.display = isVerbose ? 'block' : 'none'; - var el = document.querySelector('button.verbose.on'); - el.style.display = isVerbose ? 'none' : 'block'; + script. + function verbose(isVerbose) { + isVerbose = !! isVerbose; + var el = document.querySelector('button.verbose.off'); + el.style.display = isVerbose ? 'block' : 'none'; + var el = document.querySelector('button.verbose.on'); + el.style.display = isVerbose ? 'none' : 'block'; - CCSStylesheetRuleStyle('main','.l-verbose-section', 'display', - isVerbose ? 'block' : 'none'); - } + CCSStylesheetRuleStyle('main','.l-verbose-section', 'display', + isVerbose ? 'block' : 'none'); + } -script. - function CCSStylesheetRuleStyle(stylesheet, selectorText, style, value){ - /* returns the value of the element style of the rule in the stylesheet - * If no value is given, reads the value - * If value is given, the value is changed and returned - * If '' (empty string) is given, erases the value. - * The browser will apply the default one - * - * string stylesheet: part of the .css name to be recognized, e.g. 'default' - * string selectorText: css selector, e.g. '#myId', '.myClass', 'thead td' - * string style: camelCase element style, e.g. 'fontSize' - * string value optional : the new value - */ - var CCSstyle = undefined, rules, sheet; - for(var m in document.styleSheets){ - sheet = document.styleSheets[m]; - if(sheet.href && sheet.href.indexOf(stylesheet) != -1){ - rules = sheet[document.all ? 'rules' : 'cssRules']; - for(var n in rules){ - console.log(rules[n].selectorText); - if(rules[n].selectorText == selectorText){ - CCSstyle = rules[n].style; - break; + script. + function CCSStylesheetRuleStyle(stylesheet, selectorText, style, value){ + /* returns the value of the element style of the rule in the stylesheet + * If no value is given, reads the value + * If value is given, the value is changed and returned + * If '' (empty string) is given, erases the value. + * The browser will apply the default one + * + * string stylesheet: part of the .css name to be recognized, e.g. 'default' + * string selectorText: css selector, e.g. '#myId', '.myClass', 'thead td' + * string style: camelCase element style, e.g. 'fontSize' + * string value optional : the new value + */ + var CCSstyle = undefined, rules, sheet; + for(var m in document.styleSheets){ + sheet = document.styleSheets[m]; + if(sheet.href && sheet.href.indexOf(stylesheet) != -1){ + rules = sheet[document.all ? 'rules' : 'cssRules']; + for(var n in rules){ + console.log(rules[n].selectorText); + if(rules[n].selectorText == selectorText){ + CCSstyle = rules[n].style; + break; + } + } + break; } } - break; - } + if(value == undefined) + return CCSstyle[style] + else + return CCSstyle[style] = value } - if(value == undefined) - return CCSstyle[style] - else - return CCSstyle[style] = value - } + //--------------------------------------------------------------------------------------------------------- //- Converts the given project-relative path (like 'app/main.ts') //- to a doc folder relative path (like 'quickstart/ts/app/main.ts') @@ -299,7 +301,7 @@ script. - } else { - // ``` gets translated to
.....
and we need - // to remove this from the fragment prefix is 11 long and suffix is 13 long -- frag = frag.substring(11, frag.length-13); +- frag = jade2ng ? frag : frag.substring(11, frag.length-13); - // Uncomment next line for debugging. - // frag = "FileName: " + fullFileName + " Current path: " + current.path + " PathToDocs: " + getPathToDocs() + "\n" + frag; - return frag; diff --git a/public/_includes/_version-dropdown.jade b/public/_includes/_version-dropdown.jade index 0525aa4fee..91db1cc9b9 100644 --- a/public/_includes/_version-dropdown.jade +++ b/public/_includes/_version-dropdown.jade @@ -5,7 +5,7 @@ - var version = '' - var page = '' - +//- Replace _ underscores with . dots if current.path[2] - var version = current.path[2].replace(/\_+/gm, ".") @@ -33,7 +33,7 @@ else if current.path[3] else - var page = current.path[3] + '.html' - +//- VERSION TREE CREATOR MIXIN mixin tree(directory, urlPrefix, name, latest) ul for val, semvar in directory @@ -42,7 +42,7 @@ mixin tree(directory, urlPrefix, name, latest) li #{name} #{libVersion} - +//- BUTTON TITLE GENERATION if language == 'ts' if version == "latest" - var title = 'Angular 2 for TypeScript' @@ -72,4 +72,6 @@ nav.dropdown div(class="dropdown-menu" ng-class="appCtrl.showMenu ? 'is-visible' : ''") mixin tree(public.docs.ts, "/docs/ts", "Angular 2 for TypeScript") mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript") - mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart") + //- Disable cross-language link for API entry pages (but keep for top API search page): + if ! (current.path[3] === 'api' && public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]) + mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart") diff --git a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts index 621d144a1f..39d69f2c91 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts @@ -17,7 +17,7 @@ import { Heroes } from './hero.service'; template: ` diff --git a/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts b/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts index 4bd42e1616..c74ef90b8b 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts @@ -27,7 +27,7 @@ import { Heroes } from './hero.service'; template: `