-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
build(docs-infra): improve directive API doc templates #25768
build(docs-infra): improve directive API doc templates #25768
Conversation
You can preview 3db2590 at https://pr25768-3db2590.ngbuilds.io/. |
notes from mtg 9/6:
|
3db2590
to
d5b4625
Compare
You can preview d5b4625 at https://pr25768-d5b4625.ngbuilds.io/. |
d5b4625
to
06bdf9b
Compare
You can preview 06bdf9b at https://pr25768-06bdf9b.ngbuilds.io/. |
You can preview 029962b at https://pr25768-029962b.ngbuilds.io/. |
You can preview 0763676 at https://pr25768-0763676.ngbuilds.io/. |
0763676
to
42fd7de
Compare
You can preview 42fd7de at https://pr25768-42fd7de.ngbuilds.io/. |
You can preview 876f92f at https://pr25768-876f92f.ngbuilds.io/. |
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.
Random issue:
When a member gets no link (due to disambiguation issues???), then it looks different than the rest (example):
@@ -28,12 +28,14 @@ | |||
{%- endmacro -%} | |||
|
|||
{%- macro renderMemberSyntax(member, truncateLines) -%} | |||
{%- if member.boundTo %}<span class="property-binding">@{$ member.boundTo.type $}({$ member.boundTo.bindingName $})</span> | |||
{% endif %} |
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.
Why the weird indentation?
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.
This is because we need a new line after the @Input(...)
text. But I think I can use <br>
to get the same effect...
@@ -6,5 +6,5 @@ | |||
{% if doc.isAbstract %}abstract {% endif%}class {$ doc.name $}{$ doc.typeParams | escape $}{$ memberHelper.renderHeritage(doc) $} {{$ memberHelper.renderMembers(doc) $} | |||
} | |||
</code-example> | |||
{$ descendants.renderDescendants(doc, 'class', 'Subclasses') $} | |||
{$ descendants.renderDescendants(doc, 'class', 'Subclasses', true, r/class|directive|pipe|decorator/) $} |
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.
What about component
?
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.
There are no components in the angular/angular repo.
@@ -6,5 +6,5 @@ | |||
} | |||
</code-example> | |||
{$ descendants.renderDescendants(doc, 'interface', 'Child interfaces') $} | |||
{$ descendants.renderDescendants(doc, 'class', 'Class implementations') $} | |||
{$ descendants.renderDescendants(doc, 'class', 'Class implementations', true, r/class|directive|pipe|decorator/) $} |
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.
What about component
?
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.
see #25768 (comment)
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endmacro -%} | ||
|
||
{%- macro renderDescendants(doc, docType, title='', recursed=true) %} | ||
{% set descendants = doc.descendants | filterByPropertyValue('docType', docType) %} | ||
{%- macro renderDescendants(doc, descendantType, title='', recursed=true, docTypeMatcher = descendantType) %} |
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.
Inconsistent whitespace around =
😁
const value = obj[propertySegments[index]]; | ||
return index < (propertySegments.length - 1) ? readProperty(value, propertySegments, index + 1) : value; | ||
} |
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.
It might be safer to support not having an intermediate object at all. E.g.: readProperty({a: {}}, ['a', 'b', 'c'], 0)
@@ -33,6 +33,7 @@ | |||
.method-table, .option-table, .list-table { | |||
td > code { | |||
background-color: inherit; | |||
white-space: pre; |
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.
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.
fixed in 8d644ee
<table class="is-full-width list-table property-table"> | ||
<thead> | ||
<tr> | ||
<th>{$ headings[0] or 'Property' $}</th> | ||
{% if hasTypes %}<th>{$ headings[1] or 'Type' $}</th>{% endif %} |
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.
Now that headings[1]
is not used, it should be "removed" (i.e. remove it from all call-sites that specify it and get the description heading from headings[1]
(instead of headings[2]
)).
|
`:not(...)` blocks are now rendered as italic, while the rest of the selector is bold. PR Close #25768
If there is additional (non-short) description then add in a link to the short description to take the reader there. PR Close #25768
Now that `list-table` cells are `pre` formatterd we must be careful of what whitespace appears in text nodes. PR Close #25768
If the documentation contains a `@selectors` tag then the content of that is used to describe the selectors of a directive. Otherwise the selector string is split and each selector is listed as a list item in an unordered list. PR Close angular#25768
`:not(...)` blocks are now rendered as italic, while the rest of the selector is bold. PR Close angular#25768
If there is additional (non-short) description then add in a link to the short description to take the reader there. PR Close angular#25768
…r#25768) Now that `list-table` cells are `pre` formatterd we must be careful of what whitespace appears in text nodes. PR Close angular#25768
…ular#25768) (This was added in 405d974 but it is not clear the reasoning. It looks better to remove it now.) PR Close angular#25768
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #22790
Closes #25530