Skip to content

build(aio) + docs: miscellaneous updates to the doc-gen - #24000

Closed
petebacondarwin wants to merge 21 commits into
angular:masterfrom
petebacondarwin:docs-fix-errors-core-2
Closed

petebacondarwin wants to merge 21 commits into
angular:masterfrom
petebacondarwin:docs-fix-errors-core-2

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

There are quite a lot of commits here but each is fairly self-contained and intuitive.

@googlebot

Copy link
Copy Markdown

☹️ Sorry, but only Googlers may change the label cla: yes.

@petebacondarwin petebacondarwin added target: patch This PR is targeted for the next patch release and removed cla: yes labels May 18, 2018
@googlebot

Copy link
Copy Markdown

☹️ Sorry, but only Googlers may change the label cla: yes.

@petebacondarwin petebacondarwin added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 18, 2018
@mary-poppins

Copy link
Copy Markdown

You can preview af721ca at https://pr24000-af721ca.ngbuilds.io/.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good stuff 💯
(Only some minor comments.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Inconsistent empty line 😁

Comment thread packages/core/src/metadata/di.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While you are at it: Missing period at the end 😁

Comment thread packages/core/src/metadata/di.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line right below an example sounds weird. Maybe move it above all examples (and change "an example" to "some examples")?

Comment thread packages/core/src/di/injection_token.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Having an empty section at the same level as the next one seems odd. Maybe remove this from here (and append "example" in the titles of the sections below)?

Comment thread packages/core/src/di/forward_ref.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ohh 😲
(There are files below - e.g. packages/core/src/metadata/di.ts - that use See. Just sayin'... 😛)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have updated the others to use @see as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Incorrect indentation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Incorrect indentation 😱

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indentation still incorrect 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have unindented the section tag which should now solve this problem.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the h3 needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The headings for the properties table also uses H3 here.
I guess we could avoid both and use appropriate changes to CSS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually thinking about this again, I think we should keep H3s here. Although wrapped in a table (for rendering) the semantic meaning is that the name of the option/property is the heading for this section, which describes this option/property.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't this needed any more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. It is not needed. We agreed that the options table was a better representation of decorator doc types.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this need the .no-anchor class (as in decorator.template.html)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you are right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually I think that Usage Notes here should perhaps be a H4 since the main heading for this table is the H3 property name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even further I decided that there should be no heading at all in this case!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And the same for the decorator case.

@petebacondarwin
petebacondarwin force-pushed the docs-fix-errors-core-2 branch from af721ca to 704ab82 Compare May 23, 2018 17:42
@petebacondarwin

petebacondarwin commented May 23, 2018 •

Copy link
Copy Markdown
Contributor Author

OK I fixed up commits based on all those lovely comments. Thanks @gkalpak
I have now noticed two new issues:

  • we are capturing the docs on the decorator const declaration, which is not really desirable
  • "Query" (e.g. ViewChild) decorator options are missing. I think this is because these are declared in a more complicated manner than most other decorators.

I suggest that we get this merged and fix those in subsequent PRs.

@mary-poppins

Copy link
Copy Markdown

You can preview 704ab82 at https://pr24000-704ab82.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview d6d73eb at https://pr24000-d6d73eb.ngbuilds.io/.

@IgorMinar

IgorMinar commented May 23, 2018 •

Copy link
Copy Markdown
Contributor
  • core/Directives (d7426c1)
  • breadcrumbs missing (1d21ff7)
  • edit & source code button for individual options (ideally this should also show up for class methods and anything similar to that, but it's ok if this is a separate PR) (9842371)

@petebacondarwin

Copy link
Copy Markdown
Contributor Author
  • fail doc-gen if invalid tag is found (requires change to dgeni-packages)

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

I have cleaned up this PR and added commits for the items that Igor requested above.

@mary-poppins

Copy link
Copy Markdown

You can preview 9842371 at https://pr24000-9842371.ngbuilds.io/.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excited to have the view/edit buttons on members \o/
Not thrilled about how they look (and adding red arrows didn't actually help) 😁 :

view-edit-members

Comment thread aio/src/styles/1-layouts/_api-page.scss Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are .api-section and .api-table used anywhere? I couldn't find any occurrences 😕

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

weird me neither...

@petebacondarwin petebacondarwin May 25, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm going to delete this and rename the file to styles/2-layout/_api-pages.scss file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. There is no test for this conditional 😱
  2. Under what circumstances can a doc have no corresponding moduleDoc? Do you have an example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

when it is a module? I'll add a test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indentation still incorrect 😁

@gkalpak gkalpak May 24, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

page-actions might not be a descriptive name any more 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed to github-links

@mary-poppins

Copy link
Copy Markdown

You can preview c065871 at https://pr24000-c065871.ngbuilds.io/.

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

@gkalpak do you have any suggestions for better styling of the GH links on methods and options?

@gkalpak

gkalpak commented May 25, 2018

Copy link
Copy Markdown
Member

I'm no designer 😛

But I would definitely start at centering them vertically:
member-gh-links-1

And I would try out different colors (a dark-ish gray maybe, to make them stand out less):
member-gh-links-2

@sjtrimble will definitely have more useful insights than me 😁

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

Sounds reasonable. I'll create a new PR after this has merged to try out those ideas.

@sjtrimble

Copy link
Copy Markdown
Contributor

Coming late to the party - is the thought that the main page source and edit would still be there in addition to the 'individual option' ones?

I like @gkalpak idea of having the buttons be more subtle. Would be nice if they turned blue on hover (but without the rounded box border of the current page icons).

Aligning the card header content vertically is as intended in the original design - so that's a go from my perspective :)

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

@sjtrimble:

is the thought that the main page source and edit would still be there in addition to the 'individual option' ones?

Yes that is correct. The "individual option" ones link to the source for those specific items (e.g. the method), whereas the top level on is for the export as a whole (e.g. the class).

I have centred and coloured the links as suggested.

PTAL

@petebacondarwin
petebacondarwin force-pushed the docs-fix-errors-core-2 branch from c065871 to 1b5959c Compare June 4, 2018 13:43
@mary-poppins

Copy link
Copy Markdown

You can preview 1b5959c at https://pr24000-1b5959c.ngbuilds.io/.

mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
* Code anchors should inherit the font size from their container
* Table headings should align with content

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
We should not include the package path in the inherited
from heading for decorator API docs

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This change adds Github edit and view links to methods
and decorator options.

It is possible to add these to properties also but the
UI is rather tight as these are displayed in a table.

PR Close #24000
@mhevery mhevery closed this in 5fb0b56 Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This would cause dangling links since the target, being internal,
would not exist in the docs.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
… processor (#24000)

We don't really care when this processor runs as long as it happens
after the tags have been extracted.
By not constraining its `runBefore` property we can ensure that other
processors can be run before it.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
…docs (#24000)

This commit also factors out `API_CONTAINED_DOC_TYPES` to be used by
both `filterContainedDocs` and `addAllowedPropertiesRules`.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This update allows us to autolink to methods and properties, which
means that we can change things like `{@link transition transition()}`
to just `transition()`.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This was erroneously committed into master, when it was really only
supposed to demo what the pages might look like.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This commit adds new link disambiguators that mean that more
code links can be generated automatically in a sensible way.

The best example is the use of properties within class, interface and
enum documentation.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
It is cleaner and simpler to use just a straightforward link.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
The overview of the decorator options is now a table.
The detailed description of each option is now a full section.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
…24000)

The sections such as methods and decorator options are already headed
by a H3 heading so we need to map the H3 headings in the API doc source
down to H4 headings.

This commit includes general heading mapping functionality accessible via
the `marked` Nunjucks filter.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This heading is too high for the section because the
method name is a H3 but it cannot be a H4 because
usage notes may contain H4 headings.

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
* Code anchors should inherit the font size from their container
* Table headings should align with content

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
We should not include the package path in the inherited
from heading for decorator API docs

PR Close #24000
mhevery pushed a commit that referenced this pull request Jun 13, 2018
mhevery pushed a commit that referenced this pull request Jun 13, 2018
This change adds Github edit and view links to methods
and decorator options.

It is possible to add these to properties also but the
UI is rather tight as these are displayed in a table.

PR Close #24000
@petebacondarwin
petebacondarwin deleted the docs-fix-errors-core-2 branch June 14, 2018 10:57
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants