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

chore(docs): revise makeExcerpt mixin for DRYer ref to examples #1420

Merged
merged 1 commit into from
May 18, 2016

Conversation

chalin
Copy link
Contributor

@chalin chalin commented May 17, 2016

Avoiding ts in the file path will make it a bit easier to construct the path to the Dart version (by simply appending to the path rather than having to massage the path).

This update allows us to be more DRY when referencing examples and excerpts. E.g.,

+makeExample('quickstart/ts/app/app.component.ts', '', 'app/app.component.ts')
+makeExample('quickstart/ts/app/app.component.ts', 'import', 'app/app.component.ts (import)')(format='.')

can now be just

+makeProjExample('app/app.component.ts')        // NOTE the new mixin name
+makeExcerpt('app/app.component.ts', 'import')  // NOTE the new mixin name

With the resulting examples and their titles being rendered the same as before. The original makeExample has been left untouched.

Applied new mixins to quickstart.

@chalin chalin changed the title chore(docs): revise makeExcerpt mixin for DRYer ref to examples [review-pending] chore(docs): revise makeExcerpt mixin for DRYer ref to examples May 17, 2016
@chalin
Copy link
Contributor Author

chalin commented May 17, 2016

@kwalrath, @wardbell : can you have a look?

@kwalrath
Copy link
Contributor

kwalrath commented May 17, 2016

LGTM. @wardbell do you have an opinion? I wonder if the name makeExample1 could be clearer. makeExample2? makeSimpleExample?

@Foxandxss
Copy link
Member

Or perhaps makeLocalExample? I personally don't like example1, example2 kind of names because you can easily forget which is which.

@wardbell
Copy link
Contributor

I like but the name has to change. makeLocalExample isn't bad. Or makeProjectExample. Either works for me ... anything except example1.

Happy to accept after that change.

@chalin
Copy link
Contributor Author

chalin commented May 18, 2016

I agree about the name, but figured I run by the basic idea first.

I originally thought of: makeEg as a short name (to represent that is takes the short argument list).
Otherwise, makeProjExample? (I'm trying to keep the name reasonably short.)

Be more DRY when referencing examples and excerpts. E.g.,
```jade
+makeExcerpt('quickstart/ts/app/app.component.ts', 'import',
'app/app.component.ts (import)')
```
can now be just
```jade
+makeExcerpt('app/app.component.ts', 'import')
```
Defined new mixin for examples named `makeExample1` using this new
scheme.
The original `makeExample` has been left untouched.

Applied new mixins to quickstart.
@chalin chalin force-pushed the chalin-doc-quickstart-0517 branch from 6be9c40 to 9abec7c Compare May 18, 2016 14:33
@chalin
Copy link
Contributor Author

chalin commented May 18, 2016

Then makeProjExample it is.
@kwalrath @wardbell : ready to merge.

@chalin chalin changed the title [review-pending] chore(docs): revise makeExcerpt mixin for DRYer ref to examples chore(docs): revise makeExcerpt mixin for DRYer ref to examples May 18, 2016
@kwalrath
Copy link
Contributor

OK, I'll merge a little later this morning. Thanks, Patrice!

@kwalrath kwalrath merged commit 5b1a84b into angular:master May 18, 2016
@chalin chalin deleted the chalin-doc-quickstart-0517 branch May 19, 2016 12:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants