devdocs is a free, open source documentation & knowledge base project written in Ruby and released under MPL-2.0. It has 39,461 GitHub stars, 2,643 forks and 196 open issues, and was last pushed 2 days ago. On this registry it ranks #3 of 40 tracked projects in Documentation & Knowledge Base, with 5 head-to-head comparisons available. It gained 10 stars over the last 3 tracked days.

What is devdocs?

DevDocs is an API documentation browser that combines multiple developer documentations into a single, clean and organized web UI with instant search, offline support, a mobile version, a dark theme and keyboard shortcuts, and it is aimed at developers who need to read and search API and reference documentation quickly.

What it is

DevDocs is an open-source documentation browser written primarily in Ruby and licensed under MPL-2.0. The project is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript application powered by a small Sinatra app. It was created by Thibaut Courouble and is operated by freeCodeCamp, with a hosted instance at devdocs.io. The repository is tagged with topics including api-documentation, devdocs, docs, documentation-tool, offline and pwa.

The concrete problem it solves is fragmentation: reference documentation for each API or language normally lives on its own website, with its own layout and its own search. DevDocs pulls many developer documentations into one indexed interface, focuses deliberately on the API and reference category of content, and uses consistent typography and design across every documentation to reduce context switching. Its stated goals are short load times, better quality and ordering of search results, maximum use of caching, a clean readable interface, full offline functionality and complete keyboard navigation.

Key capabilities

  • Instant search across every downloaded documentation, plus offline support, a mobile version, a dark theme and keyboard shortcuts, with the whole interface usable through full keyboard navigation.
  • A Thor command line for managing documentation sets: thor docs:list, thor docs:download --default, thor docs:download html css, thor docs:download --installed and thor docs:download --all.
  • Prebuilt containers published as ghcr.io/freecodecamp/devdocs:latest and the smaller ghcr.io/freecodecamp/devdocs:latest-alpine, serving the app on port 9292 and rebuilt monthly with the latest documentation.
  • A Ruby scraper that generates documentation and metadata, paired with a JavaScript front end served by a Sinatra app.
  • A hosted instance at devdocs.io that stays up to date and works offline out of the box.
  • Documented runtime requirements of Ruby 4.0.6 as defined in the Gemfile, libcurl, bsdtar (the libarchive-tools package on Debian and Alpine) and a JavaScript runtime supported by ExecJS, which means Node.js on Linux.

Who uses it and how

  • Individual developers use the hosted devdocs.io instance, which is the recommended route for anyone who is not contributing to the project and which works offline without extra setup.
  • Self-hosters run the Docker image locally or on internal infrastructure, exposing port 9292, and rely on the monthly image rebuilds for refreshed content.
  • Contributors work on the two-part codebase directly, running the scraper and the Sinatra app locally, and coordinating in the #contributors chat room on Discord; the project is actively searching for maintainers.
  • Readers who need documentation without network access use the offline mode, the mobile version and the PWA behaviour indicated by the topic list.
  • Operators who want the latest documentation run thor docs:download --installed, while code updates come from git pull origin main.

Getting started

Unless contributing, the hosted version at devdocs.io is recommended. For local use the quickest route is docker run --name devdocs -d -p 9292:9292 ghcr.io/freecodecamp/devdocs:latest; manual installation follows gem install bundler, bundle install, bundle exec thor docs:download --default and bundle exec rackup, then browsing to localhost:9292.

How it compares

The facts provided list no paid products that DevDocs replaces, and no comparable tools are named anywhere in this registry. On the material available here, DevDocs stands alone in this registry.

When to use it — and when not to

A self-hoster must supply a Ruby 4.0.6 runtime along with libcurl, bsdtar and an ExecJS-compatible JavaScript runtime, or accept the Docker image as the easier path. There is no update mechanism other than git pull origin main for the code and thor docs:download --installed for the documentation, so anyone wanting always-current documentation should not self-host and should use devdocs.io instead. The project is also openly recruiting maintainers, which is worth weighing alongside the 196 open issues on the repository.

project readme (upstream, from github) — read inline

DevDocs — API Documentation Browser

DevDocs combines multiple developer documentations in a clean and organized web UI with instant search, offline support, mobile version, dark theme, keyboard shortcuts, and more.

DevDocs was created by Thibaut Courouble and is operated by freeCodeCamp.

We are currently searching for maintainers

Please reach out to the community on Discord if you would like to join the team!

Keep track of development news:

  • Join the #contributors chat room on Discord
  • Watch the repository on GitHub

Table of Contents: Quick Start · Vision · App · Scraper · Commands · Contributing · Documentation · Related Projects · License · Questions?

Quick Start

Unless you wish to contribute to the project, we recommend using the hosted version at devdocs.io. It's up-to-date and works offline out-of-the-box.

Using Docker (Recommended)

The easiest way to run DevDocs locally is using Docker:

docker run --name devdocs -d -p 9292:9292 ghcr.io/freecodecamp/devdocs:latest

This will start DevDocs at localhost:9292. We provide both regular and Alpine-based images:

  • ghcr.io/freecodecamp/devdocs:latest - Standard image
  • ghcr.io/freecodecamp/devdocs:latest-alpine - Alpine-based (smaller size)

Images are automatically built and updated monthly with the latest documentation.

Alternatively, you can build the image yourself:

git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
docker build -t devdocs .
docker run --name devdocs -d -p 9292:9292 devdocs

Manual Installation

DevDocs is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript app powered by a small Sinatra app.

DevDocs requires Ruby 4.0.6 (defined in Gemfile), libcurl, bsdtar (included in macOS, the libarchive-tools package on Debian and Alpine), and a JavaScript runtime supported by ExecJS (included in OS X and Windows; Node.js on Linux). On Arch Linux run pacman -S ruby ruby-bundler ruby-erb ruby-irb.

Once you have these installed, run the following commands:

git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
gem install bundler
bundle install
bundle exec thor docs:download --default
bundle exec rackup

Finally, point your browser at localhost:9292 (the first request will take a few seconds to compile the assets). You're all set.

The thor docs:download command is used to download pre-generated documentations from DevDocs's servers (e.g. thor docs:download html css). You can see the list of available documentations and versions by running thor docs:list. To update all downloaded documentations, run thor docs:download --installed. To download and install all documentation this project has available, run thor docs:download --all.

Note: there is currently no update mechanism other than git pull origin main to update the code and thor docs:download --installed to download the latest version of the docs. To stay informed about new releases, be sure to watch this repository.

Vision

DevDocs aims to make reading and searching reference documentation fast, easy and enjoyable.

The app's main goals are to:

  • Keep load times as short as possible
  • Improve the quality, speed, and order of search results
  • Maximize the use of caching and other performance optimizations
  • Maintain a clean and readable user interface
  • Be fully functional offline
  • Support full keyboard navigation
  • Reduce “context switch” by using a consistent typography and design across all documentations
  • Reduce clutter by focusing on a specific category of content (API/reference) and indexing only the minimum useful to most developers.

Note: DevDocs is neither a programming guide nor a search engine. All our content is pulled from third-party sources and the project doesn't intend to compete with full-text search engines. Its backbone is metadata; each piece of content is identified by a unique, "obvious" and short string. Tutorials, guides and other content that don't meet this requirement are outside the scope of the project.

App

The web app is all client-side JavaScript, powered by a small Sinatra/Sprockets application. It relies on files generated by the scraper.

Many of the code's design decisions were driven by the fact that the app uses XHR to load content directly into the main frame. This includes stripping the original documents of most of their HTML markup (e.g. scripts and stylesheets) to avoid polluting the main frame, and prefixing all CSS class names with an underscore to prevent conflicts.

Another driving factor is performance and the fact that everything happens in the browser. A service worker (which comes with its own set of constraints) and localStorage are used to speed up the boot time, while memory consumption is kept in check by allowing the user to pick his/her own set of documentations. The search algorithm is kept simple because it needs to be fast even searching through 100,000 strings.

DevDocs being a developer tool, the browser requirements are high:

  • Recent versions of Firefox, Chrome, or Opera
  • Safari 16.4+
  • Edge 89+
  • iOS 16.4+

The app is served as ES modules resolved through an import map, which is the newest thing it relies on and what sets the versions above. This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!

Scraper

The scraper is responsible for generating the documentation and index files (metadata) used by the app. It's written in Ruby under the Docs module.

There are currently two kinds of scrapers: UrlScraper which downloads files via HTTP and FileScraper which reads them from the local filesystem. They both make copies of HTML documents, recursively following links that match a set of rules and applying all sorts of modifications along the way, in addition to building an index of the files and their metadata. Documents are parsed using Nokogiri.

Modifications made to each document include:

  • removing content such as the document structure (, , etc.), comments, empty nodes, etc.
  • fixing links (e.g. to remove duplicates)
  • replacing all external (not scraped) URLs with their fully qualified counterpart
  • replacing all internal (scraped) URLs with their unqualified and relative counterpart
  • adding content, such as a title and link to the original document
  • ensuring correct syntax highlighting using Prism

These modifications are applied via a set of filters using the HTML::Pipeline library. Each scraper includes filters specific to itself, one of which is tasked with figuring out the pages' metadata.

The end result is a set of normalized HTML partials and two JSON files (index + offline data). Because the index files are loaded separately by the app following the user's preferences, the scraper also creates a JSON manifest file containing information about the documentations currently available on the system (such as their name, version, update date, etc.).

More information about scrapers and filters is available in the docs folder.

Available Commands

The command-line interface uses Thor. To see all commands and options, run thor list from the project's root.

## Server
rackup              # Start the server (ctrl+c to stop)
rackup --help       # List server options

## Docs
thor docs:list      # List available documentations
thor docs:download  # Download one or more documentations
thor docs:manifest  # Create the manifest file used by the app
thor docs:generate  # Generate/scrape a documentation
thor docs:page      # Generate/scrape a documentation page
thor docs:package   # Package a documentation for use with docs:download
thor docs:clean     # Delete documentation packages and cached responses

## Console
thor console        # Start a REPL
thor console:docs   # Start a REPL in the "Docs" module

## Tests can be run quickly from within the console using the "test" command.
## Run "help test" for usage instructions.
thor test:all       # Run all tests
thor test:docs      # Run "Docs" tests
thor test:app       # Run "App" tests
thor test:coverage  

readme truncated — read the full docs on github

Frequently asked questions

Is devdocs free to use?

devdocs is open source under the MPL-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does devdocs do?

API Documentation Browser

What is devdocs written in?

devdocs is primarily written in Ruby. Its source is publicly available at https://github.com/freeCodeCamp/devdocs, and it has 39,461 GitHub stars.