Docs 2 LLM Logo

Effortlessly generate Svelte-style documentation for your projects with doc-2-llm - the NPM package that bridges your code to LLM-friendly formats!

See the code

Why doc-2-llm?

Inspired by Svelte's own documentation format (like llms-small.txt), doc-2-llm ensures your project's documentation is not only human-readable but also optimized for language models. This makes it easier to integrate with AI tools, maintain consistency with Svelte's standards, and future-proof your documentation for advanced development workflows.

Features

  • Generates project_documentation.md with a table of contents: Navigate your project's structure with ease, complete with code blocks for clarity.
  • Creates [project-name]-llm.txt in the "llms-small.txt" format: Ensures compatibility with Svelte's trusted documentation style, perfect for LLM processing.
  • Preserves code whitespace for readability: Your code looks as intended, even in documentation, making it easier to review and maintain.
  • Supports multiple file types: Works seamlessly with Svelte, JS, TS, JSON, CSS, HTML, and more.
  • Easy to install and use: Global or local installation with simple commands, and run it in any project directory.

Why LLM-Friendly Documentation?

LLM-friendly documentation allows your project to be easily processed and understood by language models, enabling features like automated summaries, code analysis, and integration with AI-driven development tools. With doc-2-llm, your documentation is future-proof and ready for the next generation of development tools.

How to Use

Install globally with npm:

npm install -g doc-2-llm

Run in your project directory:

doc-2-llm

Or

From anydirectory:

doc-2-llm 'path/to/project'

After running, you'll find:
project_documentation.md
(a comprehensive markdown file with a table of contents and code blocks)

And


[project-name]-llm.txt
(a text file with each file's content prefixed by /// file: [path], preserving whitespace and formatted like Svelte's llms-small.txt).