dart-lang / dartdoc

API documentation tool for Dart.
https://pub.dev/packages/dartdoc
BSD 3-Clause "New" or "Revised" License
473 stars 119 forks source link

Support default document (index.html) for cleaner URLs #1346

Closed eseidelGoogle closed 1 week ago

eseidelGoogle commented 7 years ago

Right now to actually get to a library root page you need to know dartdocs pattern of doing name-library.html: https://docs.flutter.io/flutter/dart-async/dart-async-library.html

https://docs.flutter.io/flutter/dart-async/ would just get you a 404.

Obviously we could fix this in Flutter's doc generation script as well, but seems like something maybe all dartdoc users might want?

sethladd commented 7 years ago

Presumably this means there is an index.html under dart-async/. Could there be a thing called "index" inside of a Dart library? If so, what kind of structure would we need to put all the things into sub-directories so that they don't collide with a name called "index" ?

We might be able to teach Firebase what the "index.html" file is actually called. But, that would be a solution specific to Flutter's docs. I think assuming an "index.html" is a safe assumption, so many web servers will look for that file.

Just need to be careful here with collisions... but yeah, +1 for anything we can do for more beautiful URLs

kevmoo commented 6 years ago

https://api.dartlang.org/stable/1.24.3/dart-core/

Is soooo much nicer than

https://api.dartlang.org/stable/1.24.3/dart-core/dart-core-library.html

kevmoo commented 8 months ago

CC @athomas

srawlins commented 2 weeks ago

CC @kevmoo @gspencergoog would you say this is still very desirable? I have a PR out.

Re collisions, @sethladd, good catch! Most pages are suffixed with a 'kind', like Ticker-class.html, but enums (AppLifecycleState), properties (channelBuffers), functions (clampDouble), typedefs (ChannelCallback) are not suffixed, so any named index would collide with this. With that lower-case, this would particularly be a top-level property or top-level function that could cause a collision. I should probably use new paths for those like clampDouble-function.html, and write redirecting files.

kevmoo commented 2 weeks ago

I think this is still VERY desirable.

gspencergoog commented 2 weeks ago

Yes, I agree.