Skip to content

thebjorn/fastapi-docs

Repository files navigation

CI codecov pypi downloads Socket Badge

fastapi-docs

A markdown documentation renderer for FastAPI applications.

Features

  • 📁 Directory-based navigation from your markdown file structure
  • 🔍 Full-text search across all documents
  • 🎨 Syntax highlighting for Python, JavaScript, bash, C#, HTML
  • 🌙 Automatic dark mode based on system preference
  • 📱 Responsive design for mobile and desktop
  • ⚡ Hot-reload during development
  • 📑 Table of contents for each page
  • 🔗 Previous/next navigation

Installation

pip install -e .

Quick Start

from fastapi import FastAPI
from fastapi_docs import create_docs_router, DocsConfig

app = FastAPI()

# Simple usage
app.include_router(create_docs_router("./userdocs"), prefix="/userdocs")

# Or with configuration
config = DocsConfig(
    docs_dir="./userdocs",
    title="My API Docs",
    auto_refresh=True,
)
app.include_router(create_docs_router(config), prefix="/userdocs")

Markdown Frontmatter

Each markdown file can include YAML frontmatter:

---
title: Getting Started
order: 1
description: Learn how to get started
tags:
  - quickstart
hidden: false
---

# Getting Started

Your content here...

Running the Example

pip install -e ".[dev]"
uvicorn example_app:app --reload

Then visit http://localhost:8000/userdocs

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors