nextra
БесплатноБез исполняемых скриптовНе проверенBuilds documentation and content sites with Nextra, the Next.js-based static site generator. Use when a user asks to create docs sites, configure Nextra…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Nextra — Next.js Documentation Framework
Overview
Nextra is a content framework on top of Next.js: it renders Markdown and MDX files as a documentation site or blog with a generated sidebar, table of contents, syntax highlighting, dark mode, i18n, and static full-text search. Nextra 4 (current: 4.6.1) works only with the App Router. The pages/ directory, theme.config.tsx, _meta.json and the FlexSearch index of Nextra 2–3 no longer exist — tutorials and templates written for those versions do not apply.
Instructions
Setup
There is no working one-command starter for v4 (the old nextra-docs-template repository still targets Next.js 13), so install by hand:
mkdir ledgerline-docs && cd ledgerline-docs
npm init -y
# ESM package, and a zod version the docs theme works with (see Guidelines)
npm pkg set type=module overrides.zod=4.3.6
npm install next react react-dom nextra nextra-theme-docs
npm install -D pagefind
npm pkg set scripts.dev="next" scripts.build="next build" scripts.start="next start" \
scripts.postbuild="pagefind --site .next/server/app --output-path public/_pagefind"
In an existing Next.js App Router project, only nextra, nextra-theme-docs and pagefind are new. Add _pagefind/ to .gitignore: the search index is generated after every build.
Configuration
Four files replace the old theme.config.tsx:
// next.config.mjs
import nextra from "nextra";
const withNextra = nextra({
defaultShowCopyCode: true, // Copy button on every code block
search: { codeblocks: false }, // Keep code blocks out of the search index
});
export default withNextra({
reactStrictMode: true,
});
// mdx-components.js — required; exposes the theme's components to MDX
import { useMDXComponents as getThemeComponents } from "nextra-theme-docs";
export function useMDXComponents(components) {
return { ...getThemeComponents(), ...components };
}
// app/layout.jsx — theme options are props of Layout, Navbar and Footer
import { Footer, Layout, Navbar } from "nextra-theme-docs";
import { Head } from "nextra/components";
import { getPageMap } from "nextra/page-map";
import "nextra-theme-docs/style.css";
export const metadata = {
title: { default: "Ledgerline SDK", template: "%s — Ledgerline SDK Docs" },
};
export default async function RootLayout({ children }) {
return (
<html lang="en" dir="ltr" suppressHydrationWarning>
<Head />
<body>
<Layout
navbar={<Navbar logo={<b>Ledgerline SDK</b>} projectLink="https://github.com/ledgerline/sdk" />}
footer={<Footer>MIT {new Date().getFullYear()} © Ledgerline</Footer>}
pageMap={await getPageMap()}
docsRepositoryBase="https://github.com/ledgerline/sdk/tree/main/docs"
sidebar={{ defaultMenuCollapseLevel: 1 }}
>
{children}
</Layout>
</body>
</html>
);
}
// app/...mdxPath/page.jsx — one catch-all route that serves everything in content/
import { generateStaticParamsFor, importPage } from "nextra/pages";
import { useMDXComponents as getMDXComponents } from "../../mdx-components";
export const generateStaticParams = generateStaticParamsFor("mdxPath");
export async function generateMetadata(props) {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;
}
const Wrapper = getMDXComponents().wrapper;
export default async function Page(props) {
const params = await props.params;
const { default: MDXContent, toc, metadata, sourceCode } = await importPage(params.mdxPath);
return (
<Wrapper toc={toc} metadata={metadata} sourceCode={sourceCode}>
<MDXContent {...props} params={params} />
</Wrapper>
);
}
Other Layout props: banner, editLink, feedback, toc, navigation, darkMode, i18n, nextThemes. Navbar also takes chatLink and logoLink.
MDX Pages
---
title: Getting Started
description: Install the Ledgerline SDK and create your first invoice
---
import { Callout, Cards, FileTree, Steps, Tabs } from 'nextra/components'
# Getting Started
<Callout type="info">
This guide assumes Node.js 20 or newer.
</Callout>
> [!WARNING]
>
> Test-mode keys start with `ll_test_`. Never ship them to the browser.
<Tabs items={['npm', 'pnpm']}>
<Tabs.Tab>
```bash
npm install @ledgerline/sdk
```
</Tabs.Tab>
<Tabs.Tab>
```bash
pnpm add @ledgerline/sdk
```
</Tabs.Tab>
</Tabs>
<Steps>
### Create the client
```ts filename="src/ledgerline.ts" {3}
import { Ledgerline } from "@ledgerline/sdk";
export const ledgerline = new Ledgerline({ apiKey: process.env.LEDGERLINE_API_KEY });
```
### Create an invoice
```ts
const invoice = await ledgerline.invoices.create({ customer: "cus_8Qw2", amount: 4900 });
```
</Steps>
<FileTree>
<FileTree.Folder name="src" defaultOpen>
<FileTree.File name="ledgerline.ts" />
</FileTree.Fold
Установить nextra в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nextra?
Builds documentation and content sites with Nextra, the Next.js-based static site generator. Use when a user asks to create docs sites, configure Nextra themes, add MDX content, set up search, or deploy Nextra projects.
Как установить скилл nextra?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nextra запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic