-
Notifications
You must be signed in to change notification settings - Fork 125
Would like to be able to link from DartDocs back to source files. #1454
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
Comments
Crossdart does do something like this, but I don't know much about it. Dartdoc does know internally what lines and files inside a package each symbol comes from, it's at least theoretically possible to add that information to external links. I'm a little worried about correctness issues though. If I had the opportunity to design it from scratch, I might have a dartdoc config file in the package indicate the repository where the package comes from, and use git commit IDs from the local repo (or tags) to link to the exact version of the source dartdoc is documenting on github, directly. |
Prioritizing as P3 since crossdart already implements some of this. |
If what we want is links to github, crossdart doesn't do that. It links to copies of the code based on published packages, probably to get around some of the correctness and other issues that make this problem harder to solve. |
A discussion in Flutter suggests that this could be used for a "edit source" link to github. This is coming up more often in discussions -- increasing priority. |
Here is some evidence that lacking a link to the source code from the API doc is hindering contribution: flutter/flutter#21136 (comment) |
One thing to add here - This would be more critical IMO on class pages (such as https://docs.flutter.io/flutter/widgets/PreferredSize-class.html), where no code is shown. I'd love to be able to visit that page and click through to the actual source implementation file on GitHub for it. If I go to some of the method/property subpages, I can see the implementation, but even then it would still be nice to get to the file it's implemented in for full context. |
Lots of reasons this could be useful, e.g.
a. came up from @InMatrix wanting to be able to encourage our users to improve our docs.
b. Occurred to me this morning when wanting to get to the source of "TabBar" but not wanting to go have to search github when I had already found the docs:
https://docs.flutter.io/flutter/material/TabBar-class.html
Maybe the --cross-dart option already does something like this? FYI @Hixie
The text was updated successfully, but these errors were encountered: