Skip to content

Add class annotation to HTML templates for different kinds of entities #1929

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 3 commits into from
Feb 11, 2019

Conversation

gspencergoog
Copy link
Collaborator

@gspencergoog gspencergoog commented Feb 7, 2019

Tools like Dashing (used to create offline docs for Dash/Zeal) use CSS descriptors to index the different entities so that they can search for them and display them in a menu. Since the library and class types now use the same CSS in dartdoc, that made it impossible to differentiate between libraries and classes.

This PR adds some (empty) CSS classes in spans around the names of the entities, so that it's easy to explicitly find the name of the entity for each type in the HTML output.

I didn't use the {{kind}} template parameter because it sometimes contains spaces.

Addresses flutter/flutter#27654

…s so that tools like Dashing can search for them.
@googlebot googlebot added the cla: yes Google CLA check succeeded. label Feb 7, 2019
@gspencergoog
Copy link
Collaborator Author

See dashing.json for an example configuration file for Dashing to see what I mean.

Copy link

@xster xster left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -8,7 +8,7 @@ <h5>{{parent.name}} {{parent.kind}}</h5>

<div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
{{#self}}
<div>{{>source_link}}<h1>{{{nameWithGenerics}}} {{kind}} {{>categorization}}</h1></div>
<div>{{>source_link}}<h1><span class="kind-typedef">{{{nameWithGenerics}}}</span> {{kind}} {{>categorization}}</h1></div>
Copy link

Choose a reason for hiding this comment

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

extra space

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was making it match the other templates... I'll make them all match: I think they need the indent because the {{#self}} wraps it with tags.

@jcollins-g
Copy link
Contributor

LGTM. #1932 should address the test failure.

@gspencergoog gspencergoog merged commit 9e5a57d into dart-lang:master Feb 11, 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.

4 participants