-
Notifications
You must be signed in to change notification settings - Fork 124
Determine file extensions on a per-package basis #2134
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
I just realized something -- that with --link-to-remote we're making an implicit assumption about how other packages are rendered and that it is the same as what we're rendering locally. That should be possible to fix by adding some data to the table that knows how to link to remote packages. That might influence how we decide to determine the extension -- perhaps, it should be owned by the |
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.
Filename rendering needs to take into account --link-to-remote and whether or not remote repositories are rendered with HTML.
e1d689d
to
8ae0871
Compare
Changed so that Also rebased. |
lib/src/model/package.dart
Outdated
if (package.documentedWhere == DocumentLocation.remote) { | ||
return 'html'; | ||
} | ||
return packageGraph.rendererFactory.fileTypeRenderer.fileType; |
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.
I'm contemplating using the config
member to lookup the format
instead of using a renderer here. That requires moving format
out of GeneratorContext
and into DartdocOptionContext
.
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.
Hmm. It's not immediately clear to me which is preferable, but a config member would be the most direct way to get this information. I'm OK with either choice.
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.
Switched to using the config member as it's a bit more direct.
We need a way to change extensions for generated files. Some considerations:
Generators can emit additional files, so having the generator apply/change file extensions for everything isn't ideal. We can store something in the
PackageGraph
and look it up in our models, but polluting that class is a bit of a code smell--however, we do that already for the RendererFactory, so I opted to use that existing pattern for this purpose. Happy to explore alternatives.