Skip to content

Decouple href and from a model's filename #2096

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

Merged
merged 4 commits into from
Dec 17, 2019

Conversation

jdkoren
Copy link
Contributor

@jdkoren jdkoren commented Dec 16, 2019

Currently a model's href is also used to determine the filename where Dartdoc generates documentation. This change separates the two usages so that hrefs could be relative and include parts that should not be in a file path, such a ...

See #2090

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Dec 16, 2019
@jdkoren jdkoren changed the title Decouple href and from a model Decouple href and from a model's filename Dec 16, 2019
@@ -201,6 +201,16 @@ class Class extends Container
@override
String get fileName => "${name}-class.html";

@override
String get filePath {
if (!identical(canonicalModelElement, this)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically copied href's implementation in all these files and removed the ${package.baseHref}, but I'm not sure this is the right approach.

Copy link
Contributor

@jcollins-g jcollins-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I might suggest computing href based on filePath (it looks like filePath is always a substring of href) just to be sure we don't introduce bugs later, otherwise LGTM

@jdkoren jdkoren merged commit 11af0bd into dart-lang:master Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants