-
Notifications
You must be signed in to change notification settings - Fork 125
Add manually-specified source code links to code #1913
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
Conversation
Updated icon based on feedback from @kwalrath. The rest of Dart/Flutter does not yet use material, but until then, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
specified by the user in a dartdoc_options.yaml file or on the command line
Perhaps add a section in the readme.md w/ instructions for how to ensure generated docs link to their github source?
lib/src/model.dart
Outdated
@@ -3215,6 +3216,15 @@ abstract class ModelElement extends Canonicalization | |||
return _documentationFrom; | |||
} | |||
|
|||
bool get hasSourceHref => sourceHref != ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.isNotEmpty
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/src/model.dart
Outdated
bool get hasSourceHref => sourceHref != ''; | ||
String _sourceHref; | ||
String get sourceHref { | ||
if (_sourceHref == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_sourceHref ??= new SourceLinker.fromElement(this).href();
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Added an example and set it up to work for dartdoc itself when it gets published. |
Fixes #1454 and #1892. This adds a material icon for a source code link and calculates relative paths to insert into a link template specified by the user in a dartdoc_options.yaml file or on the command line. Verified the alignment in mobile and normal usage.