Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend filenames for package examples #911

Merged
merged 3 commits into from
Jun 11, 2018
Merged

Recommend filenames for package examples #911

merged 3 commits into from
Jun 11, 2018

Conversation

kwalrath
Copy link
Contributor

@kwalrath kwalrath commented Jun 8, 2018

@kwalrath kwalrath requested a review from kevmoo June 8, 2018 23:56
@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Jun 8, 2018
Copy link
Member

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

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

I'd be great to put a comment somewhere there saying that the list is driven by the items here:

https:/dart-lang/pana/blob/ce8c0c812f0df8810bc71191e41f07b1c5c621bd/lib/src/maintenance.dart#L34-L44

* <code>example/lib/<em>package_name</em>.dart</code>
* <code>example/<em>package_name</em>.dart</code>
* <code>example/<em>package_name</em>_example.dart</code>
* <code>example/example.dart</code>
Copy link
Member

Choose a reason for hiding this comment

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

also missed lib/example.dart

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, and another one.

@kwalrath
Copy link
Contributor Author

kwalrath commented Jun 9, 2018

I'm a little leery of linking to the implementation, but I guess it's better than letting the docs possibly rot. However, just linking to where the files are listed isn't enough — you really need to look at where it's used. I put in the search I used, but maybe we could do something better?

@kwalrath
Copy link
Contributor Author

kwalrath commented Jun 9, 2018

@kevmoo PTAL

@chalin
Copy link
Contributor

chalin commented Jun 9, 2018

I'm a little leery of linking to the implementation

FYI, the new code_excerpter can extract the exampleFileCandidates list of strings. (I haven't setup the new code_excerpter in this repo yet, but doing so is towards the top of my list of things to do for next week.)

@kwalrath
Copy link
Contributor Author

I'm going to commit this. We can update the code/link later.

@kwalrath kwalrath merged commit ed557f1 into master Jun 11, 2018
@kwalrath kwalrath deleted the kw-examples branch June 11, 2018 19:49
For example, the json_serializable package contains a file named
`example/example.dart`, which appears in the
[json_serializable Example tab.](https://pub.dartlang.org/packages/json_serializable#pub-pkg-tab-example)
To see exactly how the example file is chosen, look at the
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the late response. I just meant add a code comment here so any future maintainer of this page knows where the data comes from!

Then it isn't weird to point to a specific file at a specific commit, etc.

@kwalrath
Copy link
Contributor Author

Ah, OK, much better. :) I'll make that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants