-
Notifications
You must be signed in to change notification settings - Fork 114
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 #44 from rohit-gohri/server-side-rendering
- Loading branch information
Showing
25 changed files
with
1,361 additions
and
871 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,11 @@ | ||
--- | ||
slug: / | ||
title: Introduction | ||
author: Rohit Gohri | ||
author_title: Author of Redocusaurus | ||
author_url: https://rohit.page | ||
--- | ||
|
||
This is a test post. | ||
|
||
A whole bunch of other information. |
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,17 @@ | ||
--- | ||
slug: /schema | ||
title: Schema | ||
author: Rohit Gohri | ||
author_title: Author of Redocusaurus | ||
author_url: https://rohit.page | ||
tags: [hello, docusaurus] | ||
--- | ||
|
||
import ApiSchema from '@theme/ApiSchema'; | ||
|
||
# Test | ||
|
||
<ApiSchema | ||
specUrl="https://redocly.github.io/redoc/openapi.yaml" | ||
schemaRef="#/components/schemas/Pet" | ||
/> |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
slug: hello | ||
slug: /hello | ||
title: Hello | ||
author: Rohit Gohri | ||
author_title: Author of Redocusaurus | ||
|
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
File renamed without changes.
File renamed without changes.
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,104 @@ | ||
import React from 'react'; | ||
import Layout from '@theme/Layout'; | ||
import Link from '@docusaurus/Link'; | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
import clsx from 'clsx'; | ||
import styles from './styles.module.css'; | ||
|
||
const sections = [ | ||
{ | ||
title: <>Using ApiDoc Component</>, | ||
link: '/examples/custom-page/', | ||
description: ( | ||
<> | ||
A page using ApiDoc component in{' '} | ||
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc"> | ||
docusaurus-theme-redoc | ||
</a> | ||
</> | ||
), | ||
}, | ||
{ | ||
title: <>Using Redoc Component</>, | ||
link: '/examples/custom-layout/', | ||
description: ( | ||
<> | ||
A page with custom Layout using Redoc component in{' '} | ||
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc"> | ||
docusaurus-theme-redoc | ||
</a> | ||
</> | ||
), | ||
}, | ||
{ | ||
title: <>Using Spec URL</>, | ||
link: '/examples/using-spec-url/', | ||
description: ( | ||
<> | ||
A page made automatically with{' '} | ||
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-plugin-redoc"> | ||
docusaurus-plugin-redoc | ||
</a> | ||
</> | ||
), | ||
}, | ||
{ | ||
title: <>Using YAML Spec</>, | ||
link: '/examples/using-spec-yaml/', | ||
description: ( | ||
<> | ||
A page made automatically with{' '} | ||
<a href="https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-plugin-redoc"> | ||
docusaurus-plugin-redoc | ||
</a> | ||
</> | ||
), | ||
}, | ||
]; | ||
|
||
/** | ||
* | ||
* @param {{ | ||
* title: string | React.ReactNode; | ||
* description: string | React.ReactNode; | ||
* link?: string; | ||
* }} param0 | ||
*/ | ||
function Section({ title, description, link }) { | ||
const sectionComponent = <h3>{title}</h3>; | ||
const fullLink = useBaseUrl(link); | ||
return ( | ||
<div className={clsx('col col--6', styles.feature, styles.featuresCol)}> | ||
{link ? <Link to={fullLink}>{sectionComponent}</Link> : sectionComponent} | ||
<p>{description}</p> | ||
</div> | ||
); | ||
} | ||
|
||
function Docs() { | ||
return ( | ||
<Layout title="Redocusaurus Example" description="With different use-cases"> | ||
<header className={clsx('hero hero--primary', styles.heroBanner)}> | ||
<div className="container"> | ||
<h1 className="hero__title">Redocusaurus Example</h1> | ||
<p>Redoc for Docusaurus with Dark Mode Support</p> | ||
</div> | ||
</header> | ||
<main> | ||
{sections && sections.length > 0 && ( | ||
<section className={styles.features}> | ||
<div className="container"> | ||
<div className="row"> | ||
{sections.map((props, idx) => ( | ||
<Section key={idx} {...props} /> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
)} | ||
</main> | ||
</Layout> | ||
); | ||
} | ||
|
||
export default Docs; |
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,41 @@ | ||
/* stylelint-disable docusaurus/copyright-header */ | ||
|
||
/** | ||
* CSS files with the .module.css suffix will be treated as CSS modules | ||
* and scoped locally. | ||
*/ | ||
|
||
.heroBanner { | ||
padding: 4rem 0; | ||
text-align: center; | ||
position: relative; | ||
overflow: hidden; | ||
} | ||
|
||
@media screen and (max-width: 966px) { | ||
.heroBanner { | ||
padding: 2rem; | ||
} | ||
} | ||
|
||
.buttons { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.features { | ||
display: flex; | ||
align-items: center; | ||
padding: 2rem 0; | ||
width: 100%; | ||
} | ||
|
||
.featuresCol { | ||
padding-bottom: 25px; | ||
} | ||
|
||
.featureImage { | ||
height: 200px; | ||
width: 200px; | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
|
||
import ServerStyle from '@theme/ServerStyle'; | ||
|
||
function Root({ children }: { children: React.Component }): JSX.Element { | ||
return ( | ||
<> | ||
<ServerStyle from={children} /> | ||
{children} | ||
</> | ||
); | ||
} | ||
|
||
export default Root; |
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
Oops, something went wrong.