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

Commit d4f9219

Browse files
committed
Rename adjustExample{Path|Title} to adjustTsExample*4Dart
Preparation for further refactorings.
1 parent 301aadd commit d4f9219

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
@@ -53,10 +53,10 @@ mixin ifDocsFor(langPattern)
5353
block
5454

5555
//- Use to map inlined (prose) TS paths into, say, Dart paths via the
56-
//- adjustExamplePath transformer function.
56+
//- adjustTsExamplePath4Dart transformer function.
5757
mixin adjExPath(path)
58-
if adjustExamplePath
59-
| #{adjustExamplePath(path)}
58+
if adjustTsExamplePath4Dart
59+
| #{adjustTsExamplePath4Dart(path)}
6060
else
6161
| #{path}
6262

@@ -65,8 +65,8 @@ mixin includeShared(filePath, region)
6565
!=partial(newPath)
6666

6767
mixin makeExample(_filePath, region, _title, stylePatterns)
68-
- var filePath = adjustExamplePath ? adjustExamplePath(_filePath) : _filePath;
69-
- var title = adjustExampleTitle ? adjustExampleTitle(_title) : _title;
68+
- var filePath = adjustTsExamplePath4Dart ? adjustTsExamplePath4Dart(_filePath) : _filePath;
69+
- var title = adjustTsExampleTitle4Dart ? adjustTsExampleTitle4Dart(_title) : _title;
7070
- var language = attributes.language || getExtn(filePath);
7171
- var frag = getFrag(filePath, region);
7272
- var defaultFormat = frag.split('\n').length > 2 ? "linenums" : "";
@@ -121,10 +121,10 @@ mixin makeExcerpt(projRootRelativePath, region, title, stylePatterns)
121121

122122
mixin makeTabs(filePaths, regions, tabNames, stylePatterns)
123123
- filePaths = strSplit(filePaths);
124-
- if (adjustExamplePath) filePaths = filePaths.map(adjustExamplePath);
124+
- if (adjustTsExamplePath4Dart) filePaths = filePaths.map(adjustTsExamplePath4Dart);
125125
- regions = strSplit(regions, filePaths.length);
126126
- tabNames = strSplit(tabNames, filePaths.length);
127-
- if (adjustExampleTitle) tabNames = tabNames.map(adjustExampleTitle);
127+
- if (adjustTsExampleTitle4Dart) tabNames = tabNames.map(adjustTsExampleTitle4Dart);
128128

129129
code-tabs
130130
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
@@ -32,7 +32,7 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
3232
- var href = 'http://github.com/angular-examples/' + ex;
3333
span #[+liveExampleLink(linkText, ex)] (#[a(href='#{href}' target="_blank") #{srcText}])
3434

35-
- var adjustExamplePath = function(_path) {
35+
- var adjustTsExamplePath4Dart = function(_path) {
3636
- if(!_path) return _path;
3737
- var path = _path.trim();
3838
- var folder = getFolder(path);
@@ -52,15 +52,15 @@ mixin liveExampleLink2(linkText, exampleUrlPartName)
5252
- return (folder ? folder + '/' : '') + baseNameNoExt + (extn ? '.' + extn : '');
5353
- };
5454

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

0 commit comments

Comments
 (0)