gitmyhub

laradocs

PHP ★ 70 updated 3h ago

Maintain beautiful, version-controlled documentation alongside your Laravel codebase. Markdown in, a polished docs site out.

A Laravel package that turns Markdown files in your codebase into a full documentation website with sidebar navigation, dark mode, syntax highlighting, SEO tags, and a sitemap, set up in two commands.

PHPLaravelMarkdownComposersetup: easycomplexity 2/5

Laradocs is a package for Laravel, a popular PHP web framework, that lets you keep your project's documentation as Markdown files right inside the codebase. Instead of maintaining docs on a separate platform or wiki, you write Markdown files, commit them alongside the code they describe, and the package automatically serves a documentation website at a URL like /docs within your app.

The setup takes two commands: install the package with Composer and run an Artisan command. From there you create new pages with another Artisan command, which scaffolds a Markdown file with a header block for metadata including title, description, and sort order. The folder structure you use for your Markdown files becomes the sidebar navigation in the generated site.

The generated site includes a responsive layout with a sidebar, breadcrumbs, a table of contents for each page, and previous/next links. Dark mode is included. You can customize or replace the views and assets by publishing them, so the appearance can be adjusted to match your project's style.

Beyond basic Markdown, the package supports callout boxes (for tips, notes, and warnings), syntax-highlighted code blocks with copy buttons, image captions, and video embeds from local files or YouTube or Vimeo. You can define shared variables and reusable content blocks that get injected into your docs at render time. Pages are cached for performance and the cache clears automatically when a file changes.

SEO features are built in: every page gets a proper title tag, meta description, Open Graph and Twitter card tags, a canonical URL, and structured data markup. An auto-generated sitemap is available at a predictable path. All of this works out of the box. The package is MIT-licensed and the project's own documentation site is itself built with Laradocs.

Where it fits