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

Tell folks that examples show up on the pub site – if they are named correctly #413

Closed
kevmoo opened this issue Nov 1, 2017 · 7 comments
Assignees
Labels
co.beginner Community opportunity to make a small change to documentation co.help-wanted Community opportunity to help documentation d.enhancement Improves docs with specific ask t.cli-tools Relates to the dart command line tools

Comments

@kevmoo
Copy link
Member

kevmoo commented Nov 1, 2017

See https://www.dartlang.org/tools/pub/package-layout#examples

The pub site will show example code for a package – see here.

But only if you name the example file correctly.

The current implementation is here: https:/dart-lang/pub-dartlang-dart/blob/7431ab69e72283c11dbd9c03484b94d74e189a5d/app/lib/shared/utils.dart#L169

Includes:
example/lib/main.dart
example/main.dart
example/lib/$package.dart
example/$package.dart
example/${package}_example.dart
example/example.dart

@kevmoo kevmoo added d.enhancement Improves docs with specific ask t.cli-tools Relates to the dart command line tools labels Nov 1, 2017
@kwalrath kwalrath added co.beginner Community opportunity to make a small change to documentation co.help-wanted Community opportunity to help documentation labels Nov 6, 2017
@kwalrath
Copy link
Contributor

kwalrath commented Nov 6, 2017

I didn't know that! I'll happily add that info. (Or someone else can grab this.)

kevmoo added a commit to dart-archive/pub_server that referenced this issue Dec 20, 2017
kevmoo added a commit to dart-archive/pub_server that referenced this issue Dec 20, 2017
kevmoo added a commit to dart-lang/shelf that referenced this issue Jan 4, 2018
kevmoo added a commit to dart-lang/shelf that referenced this issue Jan 4, 2018
mkustermann pushed a commit to dart-archive/pub_server that referenced this issue Jan 4, 2018
* Use correct convention for example name

See dart-lang/site-www#413

* other readme cleanup

* More async cleanup

* example: Throw during upload if there is an existing file

* ShelfPubServer: cleaner handling of headers during upload

* ShelfPubServer: only log an error if there is an error

* Update minimum Dart SDK

* Cleanup and prepare for release 0.1.3
JKWA added a commit to JKWA/site-www that referenced this issue Feb 26, 2018
@bcko
Copy link
Contributor

bcko commented May 25, 2018

The current implementation is now moved to pana package. https:/dart-lang/pana/blob/fb06d872f31b2c38bc8e4e4a94056378065a0971/lib/src/maintenance.dart#L35

Includes:

      'example/lib/main.dart',
      'example/main.dart',
      'example/lib/$package.dart',
      'example/$package.dart',
      'example/lib/${package}_example.dart',
      'example/${package}_example.dart',
      'example/lib/example.dart',
      'example/example.dart',

@bcko
Copy link
Contributor

bcko commented May 26, 2018

in https://www.dartlang.org/tools/pub/package-layout#examples it says

If the examples are complex and use multiple files, consider making a directory for each example. Otherwise, you can place each one right inside example.

@kevmoo What does this exactly mean? Do we create multiple directories inside example directory? Thank you!

@kevmoo
Copy link
Member Author

kevmoo commented May 26, 2018

/example/foo /example/bar etc...

@srawlins
Copy link
Member

Tell folks that examples show up on the pub site

Can this also be accomplished by updating https://www.dartlang.org/tools/pub/package-layout#examples? I'd rather this issue not be the canonical source for what example files are respected at the pub page.

@kwalrath
Copy link
Contributor

kwalrath commented Jun 7, 2018

I was waiting for a volunteer, but if none shows up within a day or so, I'll take this myself.

@srawlins
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co.beginner Community opportunity to make a small change to documentation co.help-wanted Community opportunity to help documentation d.enhancement Improves docs with specific ask t.cli-tools Relates to the dart command line tools
Projects
None yet
Development

No branches or pull requests

4 participants