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
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!