Skip to content

Add an Edit link to every generated page #1892

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
Hixie opened this issue Jan 9, 2019 · 1 comment
Closed

Add an Edit link to every generated page #1892

Hixie opened this issue Jan 9, 2019 · 1 comment
Assignees
Labels
customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@Hixie
Copy link
Contributor

Hixie commented Jan 9, 2019

It would be great if every generated page of dartdocs could link to the relevant line on GitHub so that someone could really easily edit the docs and submit a PR for proposed changes.

P2 (Enhancements considered important but without significant data indicating they are a big win)

(From flutter/flutter#10416)

@Hixie Hixie added P2 A bug or feature request we're likely to work on customer-flutter Issues originating from important to Flutter labels Jan 9, 2019
@jcollins-g jcollins-g added the type-enhancement A request for a change that isn't a bug label Jan 11, 2019
@jcollins-g
Copy link
Contributor

jcollins-g commented Jan 25, 2019

This is largely a duplicate of #1454. I now have an implementation on deck good enough for Flutter's use (at least for Flutter-owned packages). The implementation will be able to link to an arbitrary URL constructed via a template and controlled via flags or dartdoc_options.yaml. From dartdoc's --help:

    --link-to-source-excludes                     A list of directories to exclude from linking to a source code repository.
    --link-to-source-revision                     Revision number to insert into the URI.
    --link-to-source-root                         Path to a local directory that is the root of the repository we link to.  All source code files under this directory will be linked.
    --link-to-source-uri-template                 Substitute into this template to generate a uri for an element's source code.
                                                               Dartdoc dynamically substitutes the following fields into the template:
                                                                 %f%:  Relative path of file to the repository root
                                                                 %r%:  Revision number
                                                                 %l%:  Line number

...and will have that link visible on all element pages next to the title.

screenshot from 2019-01-25 15-22-47

The text <source code> will be replaced with an icon; checking with @kwalrath on what would be good for us to use there. Because the link is arbitrary, it could go to github's edit link as @Hixie suggest's, or simply view the source as requested in #1454.

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 P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants