@@ -4,18 +4,21 @@ include ../../../_includes/_util-fns
44- var _docsFor = ' dart' ;
55- var _decorator = ' annotation' ;
66- var _array = ' list' ;
7- - var _an_array = ' a list' ;
7+ - var _an_array = ' a list' ; // - Deprecate now that we have the articles
8+ - var _a = ' an' ;
9+ - var _an = ' a' ;
810- var _priv = ' _' ;
11+ - var _Lang = ' Dart' ;
912- var _Promise = ' Future' ;
1013- var _Observable = ' Stream' ;
1114
1215mixin liveExampleLink(linkText, exampleUrlPartName )
13- a( href ='https://angular-examples.github.io/#{exampleUrlPartName} ' ) = linkText
16+ a( href ='https://angular-examples.github.io/#{exampleUrlPartName} ' target = "_blank" ) = linkText
1417
1518mixin liveExampleLink2(linkText, exampleUrlPartName )
1619 - var liveExampleSourceLinkText = attributes .srcLinkText || ' view source'
1720 | #[ + liveExampleLink(linkText, exampleUrlPartName)]
18- | (#[ a( href ='https://github.com/angular-examples/#{exampleUrlPartName} ' ) #{liveExampleSourceLinkText}] )
21+ | (#[ a( href ='https://github.com/angular-examples/#{exampleUrlPartName} ' target = "_blank" ) #{liveExampleSourceLinkText}] )
1922
2023- var adjustExamplePath = function (_path ) {
2124- if (! _path) return _path;
@@ -25,9 +28,11 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
2528- // if(extn == 'dart') return path;
2629- var baseName = getBaseFileName (path) || path; // TODO: have getBaseFileName() return path
2730- var baseNameNoExt = baseName .substr (0 ,baseName .length - (extn .length + 1 ));
28- - var inWebFolder = baseNameNoExt .match (/ ^ (main| index)$ / );
31+ - var inWebFolder = baseNameNoExt .match (/ ^ (main| index( \. \d ) ? )$ / );
2932- // Adjust the folder path, e.g., ts -> dart
30- - folder = folder .replace (/ (^ | \/ )ts\/ / , ' $1dart/' ).replace (/ (^ | \/ )app($ | \/ )/ , inWebFolder ? ' $1web$2' : ' $1lib$2' );
33+ - folder = folder .replace (/ (^ | \/ )ts($ | \/ )/ , ' $1dart$2' ).replace (/ (^ | \/ )app($ | \/ )/ , inWebFolder ? ' $1web$2' : ' $1lib$2' );
34+ - // Special case not handled above: e.g., index.html -> web/index.html
35+ - if (baseNameNoExt .match (/ ^ (index| styles)(\. \d )? $ / )) folder = (folder ? folder + ' /' : ' ' ) + ' web' ;
3136- // In file name, replace special characters with underscore
3237- baseNameNoExt = baseNameNoExt .replace (/ [\-\. ] / g , ' _' );
3338- // Adjust the file extension
@@ -40,7 +45,7 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
4045- var title = _title .trim ();
4146- // Assume title is a path if it ends with an extension like '.foo',
4247- // optionally followed by some comment in parentheses.
43- - var matches = title .match (/ (. * \. \w + )($ | \s * \( [\w ] + \) ? $ )/ );
48+ - var matches = title .match (/ (. * \. \w + )($ | \s * \( [\w ] + \) $ )/ );
4449- if (matches && matches .length == 3 ) {
4550- // e.g. matches == ['abc.ts (excerpt)', 'abc.ts', ' (excerpt)']
4651- var path = adjustExamplePath (matches[1 ]);
0 commit comments