Skip to content
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

Separate documentation parsing and rendering #2081

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

jdkoren
Copy link
Contributor

@jdkoren jdkoren commented Nov 25, 2019

  • Move Documentation out of markdown_processor and into model package

  • Create a renderer class for Documentation

- Move Documentation out of markdown_processor and into model package

- Create a renderer class for Documentation
@googlebot googlebot added the cla: yes Google CLA check succeeded. label Nov 25, 2019

class DocumentationRendererHtml extends DocumentationRenderer {
@override
Tuple2<String, String> render(List<md.Node> nodes, bool processFullDocs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The old code had an optimization that avoided calculating links for parts of the documentation that would never be rendered (if it is only used in a oneLineDoc). This used to make a very noticeable difference on dartdoc's performance. It looks as though that optimization has been removed.

If it doesn't matter anymore we can probably drop the flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understand correctly, I think we are still honoring that flag in MarkdownDocument.parseMarkdownText, it stops collecting markdown nodes if the flag is false. It's just a little harder to follow now because half the code path is there and the other half moved to the renderer. Documentation._renderDocumentation calls both methods in succession, passing the same value for the flag, so it should still be doing this optimization.

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.

You are correct, this does retain the optimization, I just missed it. LGTM.

@jdkoren jdkoren merged commit 7b87236 into dart-lang:master Dec 2, 2019
@jdkoren jdkoren deleted the documentation branch January 7, 2020 21:00
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.

None yet

3 participants