-
Notifications
You must be signed in to change notification settings - Fork 535
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
refactor(api-markdown-documenter): Allow deeper customization of output folder structure #23366
base: main
Are you sure you want to change the base?
refactor(api-markdown-documenter): Allow deeper customization of output folder structure #23366
Conversation
a9d189d
to
3071431
Compare
tools/api-markdown-documenter/src/utilities/ApiItemUtilities.ts
Outdated
Show resolved
Hide resolved
tools/api-markdown-documenter/src/utilities/ApiItemUtilities.ts
Outdated
Show resolved
Hide resolved
tools/api-markdown-documenter/api-report/api-markdown-documenter.alpha.api.md
Outdated
Show resolved
Hide resolved
tools/api-markdown-documenter/api-report/api-markdown-documenter.beta.api.md
Outdated
Show resolved
Hide resolved
[ApiItemKind.Variable]: HierarchyKind.Document, | ||
}; | ||
|
||
// TODO |
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.
Future PR
…thub.com/Josmithr/FluidFramework into api-markdown-documenter/hierarchy-config
@@ -6,7 +6,7 @@ | |||
import type { Logger } from "./Logging.js"; | |||
|
|||
/** | |||
* Common base interface for configuration interfaces. | |||
* Common base interface for configurations that take a logger. |
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.
Should have gone in with the previous PR that renamed this type.
tools/api-markdown-documenter/src/api-item-transforms/configuration/DocumentationSuite.ts
Outdated
Show resolved
Hide resolved
testConfigs, | ||
], | ||
|
||
// TODO |
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.
Future PR
testConfigs, | ||
], | ||
|
||
// TODO |
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.
Future PR
tools/api-markdown-documenter/src/api-item-transforms/Utilities.ts
Outdated
Show resolved
Hide resolved
@@ -393,23 +391,32 @@ export function createBreadcrumbParagraph( | |||
apiItem: ApiItem, | |||
config: ApiItemTransformationConfiguration, | |||
): ParagraphNode { | |||
// Get ordered ancestry of document items | |||
const ancestry = getAncestralHierarchy(apiItem, (hierarchyItem) => |
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 helper was a bit too general and only used in 2 places. I removed it and inlined the logic in the appropriate places.
tools/api-markdown-documenter/src/api-item-transforms/helpers/Helpers.ts
Outdated
Show resolved
Hide resolved
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Previously, users could control certain aspects of the output documentation suite's file-system hierarchy via the
documentBoundaries
andhierarchyBoundaries
properties of the transformation configuration.One particular limitation of this setup was that items yielding folder-wise hierarchy (
hierarchyBoundaries
) could never place their own document inside of their own hierarchy.This naturally lent itself to a pattern where output would commonly be formatted as:
This pattern works fine for many site generation systems - a link to
/foo
will end up pointingfoo.md
and a link to/foo/bar
will end up pointing tofoo/bar.md
.But some systems (e.g.
Docusaurus
) don't handle this well, and instead prefer setups like the following:With the previous configuration options, this pattern was not possible, but now is.
Additionally, this pattern is more commonly accepted, so lack of support for this was a real detriment.
Such patterns can now be produced via the consolidated
hierarchy
property, while still allowing full file-naming flexibility.Notes for reviewers
I would recommend starting with
Hierarchy.ts
- it contains the new configuration options related to hierarchy. The rest of the PR is predominantly respecting that new configuration setup.To keep things relatively simple, system defaults and test configurations have been intentionally made to preserve existing system default behaviors. As a result, you'll notice that none of the end-to-end tests have updated collateral. However, the intention is to update default behaviors, and to add more end-to-end test configurations. For now, I have left a handful of TODOs in configuration defaults and test configurations - I will address those in a follow-up PR.