Skip to content

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

Closed
eseidelGoogle opened this issue Jun 2, 2017 · 6 comments
Closed
Assignees
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@eseidelGoogle
Copy link
Contributor

eseidelGoogle commented Jun 2, 2017

Lots of reasons this could be useful, e.g.

  1. Pointing users to where the docs were generated from so they can edit them.
  2. Pointing users to the implementations of the classes in question so they can read them.

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

@jcollins-g
Copy link
Contributor

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.

@jcollins-g jcollins-g added type-enhancement A request for a change that isn't a bug P3 A lower priority bug or feature request labels Jun 2, 2017
@jcollins-g
Copy link
Contributor

Prioritizing as P3 since crossdart already implements some of this.

@jcollins-g
Copy link
Contributor

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.

@jcollins-g
Copy link
Contributor

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.

@jcollins-g jcollins-g added customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on and removed P2 A bug or feature request we're likely to work on P3 A lower priority bug or feature request labels Nov 27, 2017
@InMatrix
Copy link

Here is some evidence that lacking a link to the source code from the API doc is hindering contribution: flutter/flutter#21136 (comment)

@dnfield
Copy link

dnfield commented Sep 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants