Use MDX for interactive documentation
MDX allows you to write documentation using standard Markdown syntax while directly embedding React components. This enables the creation of rich, interactive content without leaving the Markdown file.
website·Indexed 29 days ago
https://nextra-mu-seven.vercel.appDocumentation for Nextra, featuring guides on MDX usage for embedding React components, schema-driven development, and integration with Algolia Docsearch.
When using Python (FastAPI) with Oracle Autonomous Database, the following toolchain is recommended for schema-driven development:
cx_Oracle driver for Oracle DB support. Use Alembic for migration management. For existing databases, sqlacodegen can be used to automatically generate SQLAlchemy models from the DB.graphene-oracle for direct Oracle support). Note that automatic generation from DB schema to GraphQL types is limited in Python; manual mapping from ORM models to GraphQL types is common.graphql-to-proto for converting GraphQL schemas to .proto files.# Example: Generate SQLAlchemy models from an existing Oracle DB
pip install sqlacodegen
sqlacodegen oracle+cx_oracle://user:pass@host:port/service_name > models.pySchema-driven development allows developers to generate downstream artifacts from a single source of truth. Common automation paths include:
graphql-to-proto or custom scripts (requires careful mapping of type constraints).typescript-resolvers plugin.typescript, typescript-operations, and typescript-react-apollo plugins to generate types, hooks, and SDKs.* Bulleted lists
* **Bold** and _Italic_
* `Inline code`
```js
function greet() {
console.log("Hello, MDX!");
}# Example plugins for GraphQL Code Generator
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
- "typescript-resolvers"search prop of the Layout component in app/layout.tsx.// app/layout.tsx
import { Footer, Layout, Navbar } from 'nextra-theme-docs'
import { Banner, Head } from 'nextra/components'
import { getPageMap } from 'nextra/page-map'
import 'nextra-theme-docs/style.css'
import Algolia from './components/Docsearch'
const banner = <Banner storageKey="some-key">Nextra 4.0 is released 🎉</Banner>
const navbar = (
<Navbar
logo={<b>Nextra</b>}
/>
)
const footer = <Footer>MIT {new Date().getFullYear()} © Nextra.</Footer>
export default async function RootLayout({ children }) {
return (
<html lang="ja" dir="ltr" suppressHydrationWarning>
<Head>
{/* Additional tags here */}
</Head>
<body>
<Layout
banner={banner}
navbar={navbar}
search={<Algolia />} // Add the Algolia component here
pageMap={await getPageMap()}
docsRepositoryBase="https://github.com/shuding/nextra/tree/main/docs"
footer={footer}
>
{children}
</Layout>
</body>
</html>
)
}