-
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
build(docs): Update api-markdown-documenter and utilize new hierarchy options #23504
Changes from all commits
db9d9f1
f80e4a6
ec1242f
410049c
9d3ecb2
b8c8f83
a67cf98
964e4bf
600591a
571c170
63f253d
824c7f0
cf91dc5
3019028
dad5814
81994f4
214ae3b
9786a34
8bce322
fda21fa
3071431
60f6e74
3e67819
e58de30
ef12ea3
7206e37
289c9eb
e4f184c
25162b5
92ecd59
7e2dbd5
1c6e34a
2dc2447
77f96c8
56b58e8
5c7d60a
21b1ea9
ba59e5a
0381258
f711e86
42c752b
338e12a
181c0c8
9771f71
e6b39dc
1db0399
8119e7f
ff8de15
46364b1
0b316fb
05e70b6
f840b8e
91e289d
02bc600
480fe29
cf59b6f
fc48322
38376ee
79dddbf
a73d734
663a9e2
a217ac1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,13 @@ sidebar_position: 10 | |
|
||
{/* Note: these contents are new and should be reviewed. The current website's API docs landing page has no description about what the packages do / when to use them. It's not very useful. */} | ||
|
||
To get started with the Fluid Framework, you'll want to take a dependency on our client library, [fluid-framework](./fluid-framework.md). | ||
To get started with the Fluid Framework, you'll want to take a dependency on our client library, [fluid-framework](./fluid-framework/index.md). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to specify |
||
|
||
You'll then want to pair that with the appropriate service client implementation based on your service. | ||
These include: | ||
|
||
- [@fluidframework/azure-client](./azure-client.md) (for use with [Azure Fluid Relay](../deployment/azure-fluid-relay.mdx)) | ||
- [@fluidframework/odsp-client](./odsp-client.md) (for use with [SharePoint Embedded](../deployment/sharepoint-embedded.mdx)) | ||
- [@fluidframework/tinylicious-client](./tinylicious-client.md) (for testing with [Tinylicious](../testing/tinylicious.mdx)) | ||
- [@fluidframework/azure-client](./azure-client/index.md) (for use with [Azure Fluid Relay](../deployment/azure-fluid-relay.mdx)) | ||
- [@fluidframework/odsp-client](./odsp-client/index.md) (for use with [SharePoint Embedded](../deployment/sharepoint-embedded.mdx)) | ||
- [@fluidframework/tinylicious-client](./tinylicious-client/index.md) (for testing with [Tinylicious](../testing/tinylicious.mdx)) | ||
|
||
For more information on our service client implementations, see [Fluid Services](../deployment/service-options.mdx). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { | |
ApiItemUtilities, | ||
DocumentationNodeType, | ||
getApiItemTransformationConfigurationWithDefaults, | ||
HierarchyKind, | ||
loadModel, | ||
MarkdownRenderer, | ||
ReleaseTag, | ||
|
@@ -78,13 +79,42 @@ export async function renderApiDocumentation(inputDir, outputDir, uriRootDir, ap | |
|
||
const config = getApiItemTransformationConfigurationWithDefaults({ | ||
apiModel, | ||
documentBoundaries: [ | ||
ApiItemKind.Class, | ||
ApiItemKind.Enum, | ||
ApiItemKind.Interface, | ||
ApiItemKind.Namespace, | ||
ApiItemKind.TypeAlias, | ||
], | ||
hierarchy: { | ||
alexvy86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[ApiItemKind.Model]: HierarchyKind.Document, | ||
[ApiItemKind.Namespace]: HierarchyKind.Folder, | ||
[ApiItemKind.Package]: HierarchyKind.Folder, | ||
Comment on lines
+83
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values are the defaults for their respective types, but since we override document naming policy for them, seems reasonable to add them here explicitly to make the relationship clear. |
||
getDocumentName: (apiItem, hierarchyConfig) => { | ||
switch (apiItem.kind) { | ||
case ApiItemKind.Model: | ||
// We inject a custom landing page ("index.mdx") for a curated package reference. | ||
// So we will give the auto-generated / complete model page its own separate document. | ||
return "package-reference"; | ||
|
||
case ApiItemKind.Namespace: | ||
case ApiItemKind.Package: | ||
// Namespace and package items generate documents within their own folder. | ||
return "index"; | ||
default: | ||
let documentName = ApiItemUtilities.createQualifiedDocumentNameForApiItem( | ||
apiItem, | ||
hierarchyConfig, | ||
); | ||
|
||
// Docusaurus treats any document name starting with "_" as a "partial" document, which | ||
// will not be included in the site output. | ||
// See: <https://docusaurus.io/docs/create-doc> | ||
// To work around this, while (hopefully) preventing name collisions, we will prefix | ||
// The filename with "u". E.g. `_foo.md` -> `u_foo.md`. | ||
// This doesn't affect displayed contents, strictly changes the resulting filenames and any | ||
// links to them. | ||
if (documentName.startsWith("_")) { | ||
documentName = `u${documentName}`; | ||
} | ||
|
||
return documentName; | ||
} | ||
}, | ||
}, | ||
newlineKind: "lf", | ||
uriRoot: uriRootDir, | ||
includeBreadcrumb: false, // Docusaurus includes this by default based on file hierarchy | ||
|
@@ -111,33 +141,6 @@ export async function renderApiDocumentation(inputDir, outputDir, uriRootDir, ap | |
} | ||
return alerts; | ||
}, | ||
getFileNameForItem: (apiItem) => { | ||
switch (apiItem.kind) { | ||
case ApiItemKind.Model: { | ||
return "package-reference"; | ||
} | ||
case ApiItemKind.Package: { | ||
return ApiItemUtilities.getUnscopedPackageName(apiItem); | ||
} | ||
default: { | ||
const qualifiedName = ApiItemUtilities.getQualifiedApiItemName(apiItem); | ||
let fileName = qualifiedName; | ||
|
||
// Docusaurus treats any document name starting with "_" as a "partial" document, which | ||
// will not be included in the site output. | ||
// See: <https://docusaurus.io/docs/create-doc> | ||
// To work around this, while (hopefully) preventing name collisions, we will prefix | ||
// The filename with "u". E.g. `_foo.md` -> `u_foo.md`. | ||
// This doesn't affect displayed contents, strictly changes the resulting filenames and any | ||
// links to them. | ||
if (qualifiedName.startsWith("_")) { | ||
fileName = `u${qualifiedName}`; | ||
} | ||
|
||
return fileName; | ||
} | ||
} | ||
}, | ||
skipPackage: (apiPackage) => { | ||
const packageName = apiPackage.displayName; | ||
const packageScope = PackageName.getScope(packageName); | ||
|
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.
Opted to exclude specific files, rather than blanket-excluding
mdx
files. This will let us (theoretically) move our API docs tomdx
in the future.