You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated link to a library has the form <a href="ascii/">ascii</a>.
That makes it hard to examine the generated docs locally, because the browser will open the local .../ascii/ directory, not the .../ascii/index.html file that a web server would (presumably) redirect to or send instead when you ask for the URI .../ascii/.
If the link had been <a href="ascii/index.html">ascii</a>, you could browser generated docs directly from disk.
The current behavior is deliberate. From lib/src/model/library.dart:
// The file name for a library is 'index.html', so we just link to the// directory name. This keeps the URL looking short, _without_ the// 'index.html' in the URL.return'${package.baseHref}$dirName/';
That works when generating HTML for a web server. If the URL being short in that case is more important than making it easily locally readable, then the current behavior is what we want.
(Unless we can have a flag to choose? As a package author, I want to check how my docs look before publishing. That's less convenient with the current behavior. Or we could have a dart doc server command which generates the docs, then serves them as a HTTP server on a local port.)
A generation option is preferable to changing hosted canonical URLs globally: keep clean directory links for web output, but allow file-browsable links that include index.html. The option must apply consistently to libraries, classes, search results, breadcrumbs, and relative links at different nesting depths. An alternative dart doc --serve command is useful for preview, but it does not help archives or offline documentation bundles opened directly from disk.
Activity
hiSandog commentedon Jul 11, 2026
A generation option is preferable to changing hosted canonical URLs globally: keep clean directory links for web output, but allow file-browsable links that include
index.html. The option must apply consistently to libraries, classes, search results, breadcrumbs, and relative links at different nesting depths. An alternativedart doc --servecommand is useful for preview, but it does not help archives or offline documentation bundles opened directly from disk.