Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

chore(website): Add async-await.md and typescript.md to website #4081

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ Protractor Tests
Reference
- [Config File](/lib/config.ts)
- [Protractor API](/docs/api.md)
- [Style Guide](style-guide.md)
- [Protractor Syntax vs WebDriverJS Syntax](webdriver-vs-protractor.md)
- [Browser Support](/docs/browser-support.md)
- [Plugins](plugins.md)
- [Timeouts](/docs/timeouts.md)
- [The WebDriver Control Flow](/docs/control-flow.md)
- [Using TypeScript](typescript.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should link to the examples directly, since the TypeScript docs just say "please see our examples"? Unless the plan is to expand that later. Same for the async/await link...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They might get expanded, I donno. This feels more consistent.

- [Using `async`/`await`](async-await.md)
- [How It Works](/docs/infrastructure.md)
- [Upgrading to Jasmine 2.x](/docs/jasmine-upgrade.md)
- [Mobile Setup](/docs/mobile-setup.md)
Expand Down
22 changes: 14 additions & 8 deletions website/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var path = require('path');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
var del = require('del');
Expand Down Expand Up @@ -93,22 +94,27 @@ gulp.task('watch', function() {

// Transform md files to html.
gulp.task('markdown', function() {
var version = require('../package.json').version
gulp.src(['../docs/*.md', '!../docs/api.md'])
// Parse markdown.
.pipe(markdown())
// Fix urls which reference files only on github.
.pipe(replace(
/"(?:\/([\-\.\w\/]+)\/)?(\w+\.\w+(?:#.*)?)"/g,
function(match, path, file) {
var ext = file.match(/\w+\.(\w+)(?:#.*)?/)[1];
/(href|src)="(?:([\-\.\w\/]+)\/)?(\w+\.\w+(?:#.*)?)?"/g,
function(match, attr, folder, file) {
var ext = file ? file.match(/\w+\.(\w+)(?:#.*)?/)[1] : null;
// Don't process .md and .png files which are on the website
if (((ext == 'md') || (ext == 'png')) &&
!(path && ((path.substr(0,2) == '..') || (path[0] == '/')))) {
if (((ext == 'md') || (ext == 'png')) && (!folder ||
(path.resolve('/docs', folder).split('/')[1] == 'docs'))) {
return match;
}
path = path || 'docs';
return '"https://github.com/angular/protractor/blob/master/' +
path + '/' + file + '"';
if (!folder) {
folder = 'docs';
} else if (folder[0] == '/') {
folder = folder.slice(1);
}
return attr + '="https://github.com/angular/protractor/blob/' +
version + '/' + folder + '/' + (file || '') + '"';
}
))
// Fix in-page hash paths.
Expand Down
2 changes: 2 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
<li><a tabindex="-1" href="#/plugins">Plugins</a></li>
<li><a tabindex="-1" href="#/timeouts">Timeouts</a></li>
<li><a tabindex="-1" href="#/control-flow">The WebDriver Control Flow</a></li>
<li><a tabindex="-1" href="#/typescript">Using TypeScript</a></li>
<li><a tabindex="-1" href="#/async-await">Using async/await</a></li>
<li><a tabindex="-1" href="#/infrastructure">How It Works</a></li>
<li><a tabindex="-1" href="#/jasmine-upgrade">Upgrading to Jasmine 2.x</a></li>
<li><a tabindex="-1" href="#/mobile-setup">Mobile Setup</a></li>
Expand Down
8 changes: 8 additions & 0 deletions website/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ angular.module('protractorApp').config(function($routeProvider) {
templateUrl: 'partials/mobile-setup.html',
controller: 'MarkdownCtrl'
}).
when('/typescript', {
templateUrl: 'partials/typescript.html',
controller: 'MarkdownCtrl'
}).
when('/async-await', {
templateUrl: 'partials/async-await.html',
controller: 'MarkdownCtrl'
}).
otherwise({
redirectTo: '/'
});
Expand Down
2 changes: 2 additions & 0 deletions website/test/e2e/navigation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ describe('Navigation', function() {
'Plugins',
'Timeouts',
'The WebDriver Control Flow',
'Using TypeScript',
'Using async/await',
'How It Works',
'Upgrading to Jasmine 2.x',
'Mobile Setup',
Expand Down