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

docs(toh): fix code-example format and Dart code excerpt #2907

Merged
merged 2 commits into from
Dec 1, 2016

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Nov 29, 2016

In the Dart toh-5: ensure HeroesComponent doc region renaming doesn't show a router.

@@ -26,7 +26,11 @@ class HeroesComponent implements OnInit {
Hero selectedHero;

// #docregion renaming
HeroesComponent(this._heroService, this._router);
HeroesComponent(this._heroService,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's OK to terminate an arg list with a ","? (Seems like it should be, but not sure whether all the SDKs the pubspec allows actually support this.)

Copy link
Contributor

@wardbell wardbell Nov 29, 2016

Choose a reason for hiding this comment

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

It's technically OK in TS although misleading. It would read like this:

 HeroesComponent(this._heroService,
                  );

That's pretty awful in all kinds of ways. There should be another way to convey the message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trade-off is to enable plaster /* ... */ in the code excerpt, or to leave it as is. IMHO, even if a particular SDK doesn't support it, readers should understand that the code excerpt is suggestive, given that the heading is "lib/heroes_component.dart (showing renamings only)". Use of plaster just makes it too cluttered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wardbell - btw, this is only for the Dart code excerpt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, I was trying to avoid having a heroes_component_1.dart file (which would be another way of solving this).

@kwalrath
Copy link
Contributor

kwalrath commented Nov 29, 2016

How does the second commit change the visible formatting? Also, does webdev handle this OK?

@chalin
Copy link
Contributor Author

chalin commented Nov 30, 2016

Yes, webdev can handle all these changes (and uses all those formatings already).

Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

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

Good enough for now.

@kwalrath kwalrath merged commit c7717b4 into angular:master Dec 1, 2016
@chalin chalin deleted the chalin-toh-code-example-fmt-1129 branch December 1, 2016 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants