Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit dccfbae

Browse files
committed
Rename adjustExample{Path|Title} to adjustTsExample*4Dart
Preparation for further refactorings.
1 parent 2bc166c commit dccfbae

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

public/_includes/_util-fns.jade

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ mixin ifDocsFor(langPattern)
4848
block
4949

5050
//- Use to map inlined (prose) TS paths into, say, Dart paths via the
51-
//- adjustExamplePath transformer function.
51+
//- adjustTsExamplePath4Dart transformer function.
5252
mixin adjExPath(path)
53-
if adjustExamplePath
54-
| #{adjustExamplePath(path)}
53+
if adjustTsExamplePath4Dart
54+
| #{adjustTsExamplePath4Dart(path)}
5555
else
5656
| #{path}
5757

@@ -60,8 +60,8 @@ mixin includeShared(filePath, region)
6060
!=partial(newPath)
6161

6262
mixin makeExample(_filePath, region, _title, stylePatterns)
63-
- var filePath = adjustExamplePath ? adjustExamplePath(_filePath) : _filePath;
64-
- var title = adjustExampleTitle ? adjustExampleTitle(_title) : _title;
63+
- var filePath = adjustTsExamplePath4Dart ? adjustTsExamplePath4Dart(_filePath) : _filePath;
64+
- var title = adjustTsExampleTitle4Dart ? adjustTsExampleTitle4Dart(_title) : _title;
6565
- var language = attributes.language || getExtn(filePath);
6666
- var frag = getFrag(filePath, region);
6767
- var defaultFormat = frag.split('\n').length > 2 ? "linenums" : "";
@@ -116,10 +116,10 @@ mixin makeExcerpt(projRootRelativePath, region, title, stylePatterns)
116116

117117
mixin makeTabs(filePaths, regions, tabNames, stylePatterns)
118118
- filePaths = strSplit(filePaths);
119-
- if (adjustExamplePath) filePaths = filePaths.map(adjustExamplePath);
119+
- if (adjustTsExamplePath4Dart) filePaths = filePaths.map(adjustTsExamplePath4Dart);
120120
- regions = strSplit(regions, filePaths.length);
121121
- tabNames = strSplit(tabNames, filePaths.length);
122-
- if (adjustExampleTitle) tabNames = tabNames.map(adjustExampleTitle);
122+
- if (adjustTsExampleTitle4Dart) tabNames = tabNames.map(adjustTsExampleTitle4Dart);
123123

124124
code-tabs
125125
each filePath,index in filePaths

public/docs/dart/latest/_util-fns.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
2828
- var href = 'http://github.com/angular-examples/' + ex;
2929
span #[+liveExampleLink(linkText, ex)] (#[a(href='#{href}' target="_blank") #{srcText}])
3030

31-
- var adjustExamplePath = function(_path) {
31+
- var adjustTsExamplePath4Dart = function(_path) {
3232
- if(!_path) return _path;
3333
- var path = _path.trim();
3434
- var folder = getFolder(path);
@@ -48,15 +48,15 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
4848
- return (folder ? folder + '/' : '') + baseNameNoExt + (extn ? '.' + extn : '');
4949
- };
5050

51-
- var adjustExampleTitle = function(_title) {
52-
- if(!_title || !adjustExamplePath) return _title;
51+
- var adjustTsExampleTitle4Dart = function(_title) {
52+
- if(!_title || !adjustTsExamplePath4Dart) return _title;
5353
- var title = _title.trim();
5454
- // Assume title is a path if it ends with an extension like '.foo',
5555
- // optionally followed by some comment in parentheses.
5656
- var matches = title.match(/(.*\.\w+)($|\s*\([\w ]+\)$)/);
5757
- if(matches && matches.length == 3) {
5858
- // e.g. matches == ['abc.ts (excerpt)', 'abc.ts', ' (excerpt)']
59-
- var path = adjustExamplePath(matches[1]);
59+
- var path = adjustTsExamplePath4Dart(matches[1]);
6060
- title = path + matches[2];
6161
- }
6262
- return title;

0 commit comments

Comments
 (0)