-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f8509a
commit a6f936b
Showing
9 changed files
with
76 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 21 additions & 7 deletions
28
packages/fern-docs/bundle/src/app/(docs)/~/api-explorer/[...slug]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/fern-docs/bundle/src/components/playground/utils/explorer-route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { FernNavigation } from "@fern-api/fdr-sdk"; | ||
import { addLeadingSlash } from "@fern-docs/utils"; | ||
import escapeStringRegexp from "escape-string-regexp"; | ||
|
||
/** | ||
* Conforms the slug to the explorer route. | ||
* | ||
* For example, if the original slug is "docs/foo/bar" and the root slug is "docs", | ||
* the explorer route is "/docs/~/api-explorer/foo/bar". | ||
*/ | ||
export function conformExplorerRoute( | ||
slug: FernNavigation.Slug, | ||
rootslug: FernNavigation.Slug | ||
): string { | ||
return addLeadingSlash( | ||
FernNavigation.slugjoin( | ||
rootslug, | ||
"~/api-explorer", | ||
slug.replace(new RegExp(`^${escapeStringRegexp(rootslug)}/`), "") | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.