-
Notifications
You must be signed in to change notification settings - Fork 652
[api-documenter] Include namespaces in YAML output #1537
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've added a few other things to this PR:
|
|
The related DocFX PR can be found here: dotnet/docfx#5128 |
bd01fca to
282d13c
Compare
|
If I understand right, we can't accept this PR until the DocFX PR dotnet/docfx#5128 is merged and released. |
|
Clarification: "This" refers to dotnet/docfx#5128, not this PR. |
@AlexJerabek The Office Add-ins API has fairly extensive usage of TypeScript namespaces. |
|
@octogonz This seems to radically change our reference docs. (Internal Staging Site link here. It looks like most of the content is gone. I can dig deeper to learn what's happening and whether it's our internal tooling pipeline. I might need some guidance from @rbuckton. That said, this will be challenging timing with Ignite on the horizon. What is the timeline for this update's release? |
I don't have permissions to view that site. (Although it might be super helpful if I did... 😉)
Could you confirm whether you're using DocFX 2.46? My understanding: Prior to this PR, namespaces were faked by (1) flattening the nested objects to be top-level objects with dotted names, and (2) simulating the nesting in the table of contents. After this PR, nesting namespaces are now accurately represented in the .yml files. This required updating the DocFX template to render them properly. With the old template, the nested objects are not recognized and get ignored, which may be what caused them to disappear.
@rbuckton's PR has been open for a while, so we're eager to finally wrap it up. But we definitely would not merge this PR without sign-off from your group. |
|
@AlexJerabek I assume you're using customized DocFX templates? It could be a number of things, including:
|
|
If the sources are the ones at https://github.com/OfficeDev/office-js-docs-reference, I can look into the differences later this week. |
|
@rbuckton Correct, our docs are hosted on https://github.com/OfficeDev/office-js-docs-reference. I'm testing these changes on the AlexJ-RSTest branch. I'll send some time today figuring out if the issue is with our post-processing scripts. I don't want this to block your progress. |
FYI the Rush Stack table of contents has a similar design, using a "(members)" node. For example: The motivation was also for accessibility -- clicking on the container node should expand/collapse the children, rather than navigating to a page. |
|
@AlexJerabek any progress with this? According to microsoft/TypeScript-Website#80, the TypeScript compiler wants to adopt API Extractor for their docs (🎉yeah!), but they're blocked behind this PR. If you are busy with Ignite, is there a way we could get someone else to help with the validation? |
|
I was really hoping @rbuckton could lend some insight into the changes and help debug from our end. I'm not 100% what you need from us to help debug. We can always use an older version of the API Extractor/Documenter if need be. |
|
My apologies, I've been swamped with other work and haven't been able to look further into this just yet. I will look into it this weekend. |
|
I've packed up a version of api-documenter from PR into a tarball so I can more easily test it on the office docs build: microsoft-api-documenter-7.4.6.tar.gz |
|
Other related packs: |
|
What's the next step? Are we waiting for @AlexJerabek to do something here? |
|
I'm doing some additional investigation on my end right now. |
|
I've talked with @AlexJerabek offline and we've broken this down into three action items:
@octogonz: (1) is not related to this change, and (2) has been completed. If this seems like an acceptable solution, then it is possible this PR is ready to merge. |
# Conflicts: # apps/api-documenter/src/documenters/IConfigFile.ts # apps/api-documenter/src/schemas/api-documenter.schema.json # build-tests/api-documenter-test/config/api-documenter.json
|
That's really great! I'll look over the final changes asap. Hopefully we can get it merged over the weekend.
@rbuckton Once this new behavior has been rolled out and vetted, we will want to remove the old behavior and then remove this "opt-in" switch, right? What's the expected timeframe/criteria for that? |
I'd leave that up to you. If I needed to implement a phased rollout for this I might suggest the following:
It all depends on how long you want to phase in the behavior, or whether you want to phase it in at all. I will likely run with |
|
Hmm.. I assumed the new behavior was clearly superior to the old one. In what situation would someone prefer the old behavior? BTW DocFx's philosophy was "one best way" rather than giving documentation authors lots of control over how their API gets modeled. The idea being that APIs are all made from the same essential building blocks, whereas the website designers should be free to improve the presentation over time. |
I could always change the flag to be |
|
It would be preferable to make it "opt-in" for the current major version (i.e. while we validate that it works), and then completely remove the old behavior when we release the next major version (i.e. ship it with confidence). My main question: Is there any legitimate reason why someone would NOT want to adopt the new behavior? The old behavior seemed pretty hacky, so I'd really prefer to have a single solution for how we document namespaces. |
|
I finally got some time to review the PR. Overall it looks good. My only suggestion is that we should make the setting name consistent between the CLI and So I'm thinking we'll rename it to BTW do you think this would be relevant to the Markdown renderer? The way it renders right now actually looks okay to me, although I haven't used namespaces very much. |
…lear that this is an opt-in for an experimental DocFX-specific feature
|
@rbuckton Thanks again for doing this work! 😄 We published your change with API Documenter 7.7.0. |
[api-documenter] Include namespaces in YAML output




This builds on #1536 and adds support for including nested namespaces in the YAML output file.
NOTE: This is not a solution in and of itself, as it requires a separate change to the default DocFX templates to properly support namespaces.
That PR is forthcoming.The DocFX PR can be found here: dotnet/docfx#5128