This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Inkdrop API documentation website built with Next.js 14, providing comprehensive guides and API references for developers customizing the Inkdrop application. The site serves as the primary developer documentation for the Inkdrop note-taking app's extensibility features.
# Start development server (http://localhost:3000)
npm run dev
# Build for production
npm run build
# Run linting
npm run lint
# Start production server
npm start- Framework: Next.js 14 with App Router
- Content: MDX (Markdown + JSX) for documentation pages
- Styling: Tailwind CSS with custom typography
- Search: FlexSearch for client-side fuzzy search
- Syntax Highlighting: Shiki for code blocks
- State Management: Zustand
- UI Components: Headless UI, Framer Motion
- Build Process: MDX compilation with custom remark/rehype/recma plugins
/src/app/- Documentation content organized by category:/guides/- Tutorial-style documentation/data-access/- Database API reference/modules/- Core module documentation/states/- State management docs/actions/- Editor actions reference/components/- UI component documentation/appendix/- Additional reference material
/src/components/- React components for the site/src/mdx/- MDX processing plugins and search implementationsearch.mjs- Search indexing logicrehype.mjs- HTML processing (external links, etc.)remark.mjs- Markdown processingrecma.mjs- JavaScript/JSX processing
/public/images/- Documentation images and screenshots
The search implementation (/src/mdx/search.mjs) automatically indexes all MDX content:
- Extracts headings and paragraphs from all documentation
- Uses FlexSearch for fuzzy searching
- Triggered by ⌘K / Ctrl+K
- Special handling for the commands page (indexes h3 headings)
- Create an MDX file in the appropriate
/src/app/subdirectory - Add metadata export:
export const metadata = {
title: 'Page Title',
description: 'SEO description'
}- Add navigation entry in
/src/components/Navigation.jsx
export const metadata = {
title: 'Title',
description: 'Description'
}
# Page Title
Lead paragraph explaining the key concept.{{ className: 'lead' }}
## Section Title
Content...<Row>and<Col>- Two-column layouts for API docs<Properties>and<Property>- API property documentation<CodeGroup>- Multiple code examples with titles<Note>and<Warning>- Callout boxes
<Row>
<Col>Explanation text...</Col>
<Col sticky>```javascript // Code example ```</Col>
</Row>Store in /public/images/ and reference as:
Navigation structure is defined in /src/components/Navigation.jsx. Each section contains an array of pages with title and href.
The search index rebuilds automatically when MDX files change. The indexing logic is in /src/mdx/search.mjs.
External links automatically:
- Open in new tabs
- Display an external link icon
- Are handled by the rehype plugin in
/src/mdx/rehype.mjs
Code blocks support language-specific highlighting via Shiki. Common languages: javascript, jsx, json, bash, css.
The documentation site uses a sophisticated MDX processing pipeline:
- Build Time: MDX files in
/src/app/are processed through Next.js's MDX loader - Plugins Chain:
- Remark plugins handle Markdown transformations
- Rehype plugins process HTML (adding external link icons, etc.)
- Recma plugins handle JavaScript/JSX transformations
- Search Indexing: The
withSearchwrapper innext.config.mjsensures all MDX content is indexed for search - Section Extraction: Each MDX file exports a
sectionsarray used for in-page navigation
The navigation is centrally managed through several interconnected components:
- Navigation Data: Defined in
/src/components/Navigation.jsxas a static structure - Dynamic Sections: The
layout.jsxfile extracts sections from all MDX files at build time - Section Provider: Uses Zustand to manage active section state for smooth scrolling
- Mobile/Desktop Split: Separate navigation components for responsive design
Documentation follows a hierarchical structure:
- Categories: Top-level groupings (Guides, Data Access, Core Modules, etc.)
- Pages: Individual MDX files within categories
- Sections: Headings within pages that appear in the sidebar
- Anchors: Auto-generated from heading text for deep linking
- Create MDX file in appropriate category
- Use two-column layout with
<Row>and<Col> - Document properties with
<Properties>component - Include practical code examples
- Add to navigation in
/src/components/Navigation.jsx
- Edit the MDX file directly
- Test locally with
npm run dev - Verify search indexing works for new content
- Check that all links and images work correctly
- Search index is built from MDX content during build
- Check
/src/mdx/search.mjsfor indexing logic - Verify content appears in search results after building
- This is a documentation site without unit tests - focus on content accuracy
- The site uses static generation where possible for performance
- All documentation should follow the established MDX patterns for consistency
- Lead paragraphs (with
{{ className: 'lead' }}) should summarize key concepts - Keep code examples practical and directly runnable in Inkdrop
- The site is deployed at https://developers.inkdrop.app/
- All MDX files are automatically indexed for search during the build process
- Navigation is centrally managed in
/src/components/Navigation.jsx
You (the AI agent) have to report what you did in this project at each end of the task in my Inkdrop note. Create one in the "Journal" notebook with the title "Log: Updating the Inkdrop API docs". Update this note at each end of the task with the following format:
## Log: <task title>
- **Prompt**: <prompt you received>
- **Issue**: <issue description>
### What I did: <brief description of what you did>
...
### How I did it: <brief description of how you did it>
...
### What were challenging: <brief description of any challenges you faced>
...
### Future work (optional)
- <any future work or improvements you suggest>
- IMPORTANT: Do not forget to update the note at the end of each task!!!