Site-www: Tell folks that examples show up on the pub site 鈥撀爄f they are named correctly

Created on 1 Nov 2017  路  7Comments  路  Source: dart-lang/site-www

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

The pub site will show example code for a package 鈥撀爏ee here.

But only if you name the example file correctly.

The current implementation is here: https://github.com/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

beginner enhancement help wanted tools

All 7 comments

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

The current implementation is now moved to pana package. https://github.com/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',

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!

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

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.

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

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

feinstein picture feinstein  路  4Comments

kwalrath picture kwalrath  路  3Comments

kwalrath picture kwalrath  路  4Comments

tehsphinx picture tehsphinx  路  3Comments

dev-aentgs picture dev-aentgs  路  3Comments