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

Commit b0e0d94

Browse files
chalinwardbell
authored andcommitted
docs: revert Jade to markdown
closes #1818 Previously, the markdown of some chapters was converted to Jade markup to support the conditional exclusion of TS prose parts in Dart chapters. This commit reverts some of that back to clean markdown, thanks to a few custom directives.
1 parent e2cd8ff commit b0e0d94

33 files changed

+366
-170
lines changed

public/_includes/_scripts-include.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ script(src="https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular
2121

2222
<!-- Angular.io Site JS -->
2323
script(src="/resources/js/site.js")
24+
script(src="/resources/js/util.js")
2425
script(src="/resources/js/controllers/app-controller.js")
2526
script(src="/resources/js/controllers/resources-controller.js")
2627
script(src="/resources/js/directives/cheatsheet.js")
@@ -32,6 +33,9 @@ script(src="/resources/js/directives/copy.js")
3233
script(src="/resources/js/directives/code-tabs.js")
3334
script(src="/resources/js/directives/code-pane.js")
3435
script(src="/resources/js/directives/code-example.js")
36+
script(src="/resources/js/directives/if-docs.js")
37+
script(src="/resources/js/directives/live-example.js")
38+
script(src="/resources/js/directives/ngio-ex-path.js")
3539
script(src="/resources/js/directives/scroll-y-offset-element.js")
3640

3741
<!-- GA -->

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ include ../../../_includes/_util-fns
2020
- var _indexHtmlDir = 'web';
2121
- var _mainDir = 'web';
2222

23+
//- Deprecated
2324
mixin liveExampleLink(linkText, exampleUrlPartName)
2425
- var text = linkText || 'live example';
2526
- var ex = exampleUrlPartName || getExampleName();
2627
- var href = 'http://angular-examples.github.io/' + ex;
2728
a(href='#{href}' target="_blank")= text
2829

30+
//- Deprecated
2931
mixin liveExampleLink2(linkText, exampleUrlPartName)
3032
- var srcText = attributes.srcText || 'view source';
3133
- var ex = exampleUrlPartName || attributes.example || getExampleName();

public/docs/dart/latest/guide/dependency-injection.jade

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@ block ctor-syntax
1010
We also leveraged Dart's constructor syntax for declaring parameters and
1111
initializing properties simultaneously.
1212

13-
block service-in-its-own-file
14-
//- N/A
15-
16-
block one-class-per-file-ts-tradeoffs
17-
//- N/A
18-
1913
block injectable-not-always-needed-in-ts
2014
//- The [Angular 2 Dart Transformer](https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer)
2115
//- generates static code to replace the use of dart:mirrors. It requires that types be
2216
//- identified as targets for static code generation. Generally this is achieved
2317
//- by marking the class as @Injectable (though there are other mechanisms).
2418
25-
block ts-any-decorator-will-do
26-
//- N/A
27-
2819
block always-include-paren
2920
:marked
3021
Always write `@Injectable()`, not just `@Injectable`.
@@ -43,11 +34,6 @@ block real-logger
4334
A real implementation would probably use the
4435
[logging package](https://pub.dartlang.org/packages/logging).
4536

46-
block canonical-provider-expr
47-
| &nbsp;that creates a new instance of the&nbsp;
48-
a(href="../api/core/Provider-class.html") Provider
49-
| &nbsp;class:
50-
5137
block provider-ctor-args
5238
- var _secondParam = 'named parameter, such as <code>useClass</code>'
5339
:marked

public/docs/dart/latest/guide/server-communication.jade

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,9 @@ block includes
88
- var _Angular_http_library = 'Dart <a href="' + _httpUrl + '"><b>http</b></a> library'
99

1010
block demos-list
11-
li #[a(href="#http-client") HTTP client: Tour of Heroes]
12-
li #[a(href="#cors") JSONP client: Wikipedia to fetch data from a service that does not support CORS] #[b (under development)]
13-
14-
block rxjs-import
15-
//- N/A
16-
17-
block http-client
18-
19-
block system-config-of-http
20-
//- N/A
11+
:marked
12+
- [HTTP client: Tour of Heroes](#http-client)
13+
- [JSONP client: Wikipedia to fetch data from a service that does not support CORS (**under development**)](#cors)
2114

2215
block http-providers
2316
:marked
@@ -50,9 +43,6 @@ block getheroes-and-addhero
5043
programming in Dart, or the tutorial on
5144
[_Asynchronous Programming: Futures_](https://www.dartlang.org/docs/tutorials/futures/).
5245

53-
block rxjs
54-
//- N/A
55-
5646
block parse-json
5747
:marked
5848
The response data are in JSON string form.
@@ -65,7 +55,7 @@ block error-handling
6555
block hlc-error-handling
6656
:marked
6757
Back in the `HeroListComponent`, we wrapped our call to
68-
`#{_priv}heroService.getHeroes()` in a `try` clause. When an exception is
58+
`!{_priv}heroService.getHeroes()` in a `try` clause. When an exception is
6959
caught, the `errorMessage` variable &mdash; which we've bound conditionally in the
7060
template &mdash; gets assigned to.
7161

@@ -75,9 +65,6 @@ block hero-list-comp-add-hero
7565
awaits for the *service's* asynchronous `addHero()` to return, and when it does,
7666
the new hero is added to the `heroes` list for presentation to the user.
7767

78-
block promises
79-
//- N/A
80-
8168
block wikipedia-jsonp+
8269
:marked
8370
Wikipedia offers a modern `CORS` API and a legacy `JSONP` search API.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
include ../_util-fns
22

33
+includeShared('{ts}', 'intro')
4-
5-
p Run the #[+liveExampleLink2('', 'toh-5')].
6-
74
+includeShared('{ts}', 'main')
85

public/docs/dart/latest/tutorial/toh-pt1.jade

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ include ../_util-fns
3333

3434
.callout.is-helpful
3535
header Source code
36-
p Run the #[+liveExampleLink2('', 'toh-1')] for this part.
36+
:marked
37+
Run the <live-example></live-example> for this part.
3738

3839
:marked
3940
## Keep the app compiling and running

public/docs/dart/latest/tutorial/toh-pt2.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ include ../_util-fns
66
We’ll expand our Tour of Heroes app to display a list of heroes,
77
allow the user to select a hero, and display the hero’s details.
88

9-
p Run the #[+liveExampleLink2('', 'toh-2')] for this part.
10-
:marked
9+
Run the <live-example></live-example> for this part.
10+
1111
Let’s take stock of what we’ll need to display a list of heroes.
1212
First, we need a list of heroes. We want to display those heroes in the view’s template,
1313
so we’ll need a way to do that.
@@ -294,8 +294,8 @@ code-example(language="bash").
294294
* We added the ability to select a hero and show the hero’s details
295295
* We learned how to use the built-in directives `ngIf` and `ngFor` in a component’s template
296296

297-
p Run the #[+liveExampleLink2('', 'toh-2')] for this part.
298-
:marked
297+
Run the <live-example></live-example> for this part.
298+
299299
### The Road Ahead
300300
Our Tour of Heroes has grown, but it’s far from complete.
301301
We can't put the entire app into a single component.

public/docs/dart/latest/tutorial/toh-pt3.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include ../_util-fns
44
Our app is growing.
55
Use cases are flowing in for reusing components, passing data to components, and creating more reusable assets. Let's separate the heroes list from the hero details and make the details component reusable.
66

7-
p Run the #[+liveExampleLink2('', 'toh-3')] for this part.
7+
Run the <live-example></live-example> for this part.
88

99
.l-main-section
1010
:marked
@@ -240,7 +240,7 @@ code-example(format=".")
240240
* We learned to bind a parent component to a child component.
241241
* We learned to declare the application directives we need in a `directives` list.
242242

243-
p Run the #[+liveExampleLink2('', 'toh-3')] for this part.
243+
Run the <live-example></live-example> for this part.
244244

245245
.l-main-section
246246
:marked

public/docs/dart/latest/tutorial/toh-pt4.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include ../_util-fns
1515
Because data services are invariably asynchronous,
1616
we'll finish the chapter with a **!{_Promise}**-based version of the data service.
1717

18-
p Run the #[+liveExampleLink2('', 'toh-4')] for this part.
18+
Run the <live-example></live-example> for this part.
1919

2020
.l-main-section
2121
:marked

public/docs/dart/latest/tutorial/toh-pt5.jade

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ figure.image-display
1818
The [Routing and Navigation](../guide/router.html) chapter covers the router in more detail
1919
than we will in this tutorial.
2020

21-
p Run the #[+liveExampleLink2('', 'toh-5')] for this part.
21+
Run the <live-example></live-example> for this part.
2222

2323
.l-main-section
2424
:marked
@@ -653,11 +653,10 @@ figure.image-display
653653
.l-main-section
654654
:marked
655655
## Application structure and code
656-
p.
657-
Review the sample source code in the #[+liveExampleLink2('', 'toh-5')] for this chapter.
656+
657+
Review the sample source code in the <live-example></live-example> for this chapter.
658658
Verify that we have the following structure:
659659

660-
:marked
661660
.filetree
662661
.file angular2_tour_of_heroes
663662
.children

0 commit comments

Comments
 (0)