An open API service indexing awesome lists of open source software.

https://github.com/tomw1808/mkdocs-shadcn

MkDocs in NextJs
https://github.com/tomw1808/mkdocs-shadcn

Last synced: 7 months ago
JSON representation

MkDocs in NextJs

Awesome Lists containing this project

README

          

# Next.js MkDocs Material Alternative

This project is a drop-in replacement for MkDocs Material, built with Next.js 14+, Tailwind CSS, and shadcn/ui. It aims to provide a modern, fast, and customizable documentation site generator that maintains compatibility with existing MkDocs projects while adding modern features and improvements.

## Features

### Core Features
- πŸ“± Fully responsive design with mobile-first approach
- πŸŒ“ Dark mode support with system preference detection
- ⚑ Fast page loads with Next.js 14+ and App Router
- 🎨 Customizable with Tailwind CSS
- πŸ“Š Beautiful UI components from shadcn/ui
- πŸ” Full-text search with Pagefind integration
- πŸ“‘ GitHub Flavored Markdown support with tables

### Navigation
- πŸ“š Dynamic sidebar navigation with collapsible sections
- πŸ—ΊοΈ Automatic navigation structure from mkdocs.yml
- πŸ”— Previous/Next page navigation
- πŸ“± Mobile-friendly navigation drawer with keyboard shortcuts (⌘K / Ctrl+K)
- 🏷️ Section headers and improved navigation highlighting
- πŸ”„ Version switching support (in development)

### Image Handling
- πŸ–ΌοΈ Advanced image optimization with Next.js Image component
- πŸ“Έ Lightbox gallery support using double exclamation syntax (!![])
- 🎯 Automatic image processing and path handling
- πŸ”„ Support for both local and remote images
- πŸ“ Automatic public directory management for assets

### Code Features
- 🎨 Syntax highlighting with rehype-pretty-code
- πŸ“ Line highlighting and automatic line numbers
- πŸ“‹ Copy-to-clipboard button on all code blocks
- 🎭 Code block titles and language detection
- 🎯 GitHub-themed light and dark syntax themes

### Documentation Features
- ⚠️ Admonitions with 12+ types (note, warning, danger, etc.)
- πŸ“‘ Collapsible admonition blocks using ???
- πŸ”² Custom titles for admonition blocks
- πŸ“ Rich markdown support
- 🎯 Drop-In compatible with existing MkDocs content

## Project Structure

```
your-project/
β”œβ”€β”€ mkdocs/ # Your documentation root
β”‚ β”œβ”€β”€ mkdocs.yml # MkDocs configuration file
β”‚ └── docs/ # Documentation markdown files
β”‚ └── **/*.md # Markdown files in any subdirectory
β”œβ”€β”€ components/ # React components
β”œβ”€β”€ lib/ # Utility functions
└── public/ # Public assets
```

## Getting Started

1. Install dependencies:

```bash
npm install
# or
yarn install
# or
pnpm install
```

2. Place your `mkdocs.yml` file in the `mkdocs` directory.

3. Place your markdown files in the `mkdocs` directory, maintaining your desired structure.

4. Run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

5. Open [http://localhost:3000](http://localhost:3000) to see your documentation site.

## MkDocs Compatibility

This project maintains full compatibility with MkDocs Material features while providing modern enhancements:

### Fully Compatible Features
- βœ… Basic markdown rendering with enhanced styling
- βœ… Navigation structure from mkdocs.yml
- βœ… Advanced image handling and optimization
- βœ… Previous/Next navigation
- βœ… Dark mode with system preference
- βœ… Admonitions with all standard types
- βœ… Code blocks with syntax highlighting
- βœ… Content tabs
- βœ… Collapsible navigation sections
- βœ… Tables with column alignment support

### Enhanced Features
- ✨ Improved image galleries with lightbox
- ✨ Better code block interaction
- ✨ Modern UI components
- ✨ Faster page loads
- ✨ Better mobile experience
- ✨ TypeScript support
- ✨ Modern development experience

### Coming Soon
- πŸ”„ Table of contents
- πŸ”„ More MkDocs Material extensions

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Check our contribution guidelines for more information.

## License

This project is available under a custom license that allows free use for both personal and commercial purposes, but explicitly prohibits using the software to create commercial hosting services based on this project. See the [LICENSE](LICENSE.md) file for details.