From 8b8db8546760a1a96bd8e618d7a936490cb9aac0 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 17:19:34 -0700 Subject: [PATCH 1/2] docs(toh-3/dart): copyedits and new snake_case glossary entry Copyedits made to glossary as well. Note that "Scoped Package" has been removed from the Dart glossary. --- .../toh-3/dart/lib/app_component.dart | 18 +++++----- .../docs/_examples/toh-3/dart/lib/hero.dart | 1 - .../toh-3/dart/lib/hero_detail_component.dart | 33 +++++++++---------- public/docs/dart/latest/glossary.jade | 14 +++++++- public/docs/dart/latest/tutorial/toh-pt3.jade | 23 ++++++++----- public/docs/ts/latest/glossary.jade | 19 ++++++----- 6 files changed, 61 insertions(+), 47 deletions(-) diff --git a/public/docs/_examples/toh-3/dart/lib/app_component.dart b/public/docs/_examples/toh-3/dart/lib/app_component.dart index 774f8e68f6..d2ed99d75b 100644 --- a/public/docs/_examples/toh-3/dart/lib/app_component.dart +++ b/public/docs/_examples/toh-3/dart/lib/app_component.dart @@ -10,7 +10,7 @@ import 'hero_detail_component.dart'; @Component( selector: 'my-app', -// #docregion hero-detail-template + // #docregion hero-detail-template template: '''

{{title}}

My Heroes

@@ -23,8 +23,9 @@ import 'hero_detail_component.dart'; ''', -// #enddocregion hero-detail-template - styles: const [''' + // #enddocregion hero-detail-template + styles: const [ + ''' .selected { background-color: #CFD8DC !important; color: white; @@ -73,17 +74,16 @@ import 'hero_detail_component.dart'; } ''' ], -// #docregion directives - directives: const [ - HeroDetailComponent - ]) -// #enddocregion directives + // #docregion directives + directives: const [HeroDetailComponent] + // #enddocregion directives + ) class AppComponent { final String title = 'Tour of Heroes'; final List heroes = mockHeroes; Hero selectedHero; - onSelect(Hero hero) { + void onSelect(Hero hero) { selectedHero = hero; } } diff --git a/public/docs/_examples/toh-3/dart/lib/hero.dart b/public/docs/_examples/toh-3/dart/lib/hero.dart index 71eb336b9c..ea51fc9bc2 100644 --- a/public/docs/_examples/toh-3/dart/lib/hero.dart +++ b/public/docs/_examples/toh-3/dart/lib/hero.dart @@ -5,4 +5,3 @@ class Hero { Hero(this.id, this.name); } -// #enddocregion diff --git a/public/docs/_examples/toh-3/dart/lib/hero_detail_component.dart b/public/docs/_examples/toh-3/dart/lib/hero_detail_component.dart index e8481c5261..9b85d21965 100644 --- a/public/docs/_examples/toh-3/dart/lib/hero_detail_component.dart +++ b/public/docs/_examples/toh-3/dart/lib/hero_detail_component.dart @@ -11,29 +11,26 @@ import 'hero.dart'; // #docregion v1 @Component( selector: 'my-hero-detail', -// #enddocregion v1 + // #enddocregion v1 // #docregion template template: ''' -
-

{{hero.name}} details!

-
{{hero.id}}
-
- - -
-
- ''' +
+

{{hero.name}} details!

+
{{hero.id}}
+
+ + +
+
''' // #enddocregion template -// #docregion v1 + // #docregion v1 ) class HeroDetailComponent { -// #enddocregion v1 -// #docregion inputs + // #enddocregion v1 + // #docregion inputs @Input() -// #docregion hero + // #docregion hero Hero hero; -// #enddocregion hero -// #enddocregion inputs -// #docregion v1 + // #enddocregion hero, inputs + // #docregion v1 } -// #enddocregion v1 diff --git a/public/docs/dart/latest/glossary.jade b/public/docs/dart/latest/glossary.jade index ec8bdf04f3..4dad0d501e 100644 --- a/public/docs/dart/latest/glossary.jade +++ b/public/docs/dart/latest/glossary.jade @@ -12,7 +12,19 @@ include _util-fns !=partial('../../ts/latest/_fragments/glossary-f-l') !=partial('../../ts/latest/_fragments/glossary-m1') //!=partial('../../ts/latest/_fragments/glossary-m2') not needed in dart -!=partial('../../ts/latest/_fragments/glossary-n-s') +!=partial('../../ts/latest/_fragments/glossary-n-s-1') + +:marked + ## snake_case +.l-sub-section + :marked + The practice of writing compound words or phrases such that each word is separated by an underscore (`_`). + + Library and file names are often spelled in snake_case. Examples include: `angular2_tour_of_heroes` and `app_component.dart`. + + This form is also known as **underscore case**. + +!=partial('../../ts/latest/_fragments/glossary-n-s-2') !=partial('../../ts/latest/_fragments/glossary-t1') //!=partial('../../ts/latest/_fragments/glossary-t2') notneeded in dart !=partial('../../ts/latest/_fragments/glossary-u-z') diff --git a/public/docs/dart/latest/tutorial/toh-pt3.jade b/public/docs/dart/latest/tutorial/toh-pt3.jade index 3c4a961b77..25653aff27 100644 --- a/public/docs/dart/latest/tutorial/toh-pt3.jade +++ b/public/docs/dart/latest/tutorial/toh-pt3.jade @@ -21,12 +21,13 @@ p Run the #[+liveExampleLink2('', 'toh-3')] for this part. .children .file index.html .file main.dart + .file styles.css .file pubspec.yaml :marked ### Keep the app compiling and running We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing -code-example(format="." language="bash"). +code-example(language="bash"). pub serve :marked @@ -50,7 +51,7 @@ code-example(format="." language="bash"). ### Separating the Hero Detail Component Add a new file named `hero_detail_component.dart` to the `lib` folder and create `HeroDetailComponent` as follows. -+makeExample('toh-3/dart/lib/hero_detail_component.dart', 'v1', 'hero_detail_component.dart (initial version)')(format=".") ++makeExample('toh-3/dart/lib/hero_detail_component.dart', 'v1', 'lib/hero_detail_component.dart (initial version)')(format=".") .l-sub-section :marked ### Naming conventions @@ -61,7 +62,8 @@ code-example(format="." language="bash"). All of our component names end in "Component". All of our component file names end in "_component". - We spell our filenames in lower underscore case (AKA "snake_case") so we don't worry about + We spell our filenames in lower **underscore case** + (AKA **[snake_case](../guide/glossary.html#!#snake_case)**) so we don't worry about case sensitivity on the server or in source control.