-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from pulsate-dev/add-api-reference
feat: Add API Reference
- Loading branch information
Showing
7 changed files
with
2,824 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ApiReferenceReact } from '@scalar/api-reference-react'; | ||
import '@scalar/api-reference-react/style.css'; | ||
|
||
/** | ||
* This is a React component that renders the Pulsate API reference. | ||
* It uses the `ApiReferenceReact` component from the `@scalar/api-reference-react` package. | ||
* | ||
* Nextra cannot properly read TSX files configured as pages, so what should be used as pages are component and imported into MDX. | ||
* A warning message by autoprefixer is displayed, but since it is not an error, it is ignored here. | ||
* | ||
* @return The API reference component. | ||
*/ | ||
export default function ScalarAPIReference() { | ||
// https://github.com/scalar/scalar/blob/main/documentation/configuration.md | ||
return ( | ||
<ApiReferenceReact | ||
configuration={{ | ||
isEditable: false, | ||
darkMode: true, | ||
hideDarkModeToggle: true, | ||
searchHotKey: 's', | ||
theme: 'bluePlanet', | ||
// TODO: Support testing the API reference with a staring server | ||
spec: { | ||
url: 'https://raw.githubusercontent.com/pulsate-dev/pulsate/main/resources/schema.json', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ScalarAPIReference from "../components/ScalarAPIReference"; | ||
|
||
<ScalarAPIReference /> |
Oops, something went wrong.