Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.4k
freeCodeCamp/devdocs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 byThibaut Courouble and is operated byfreeCodeCamp.
Please reach out to the community onDiscord if you would like to join the team!
Keep track of development news:
Table of Contents:Quick Start ·Vision ·App ·Scraper ·Commands ·Contributing ·Documentation ·Related Projects ·License ·Questions?
Unless you wish to contribute to the project, we recommend using the hosted version atdevdocs.io. It's up-to-date and works offline out-of-the-box.
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 atlocalhost:9292. We provide both regular and Alpine-based images:
ghcr.io/freecodecamp/devdocs:latest
- Standard imageghcr.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 devdocsdocker build -t devdocs.docker run --name devdocs -d -p 9292:9292 devdocs
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 3.4.1 (defined inGemfile
), libcurl, and a JavaScript runtime supported byExecJS (included in OS X and Windows;Node.js on Linux). Once you have these installed, run the following commands:
git clone https://github.com/freeCodeCamp/devdocs.git&&cd devdocsgem install bundlerbundle installbundleexec thor docs:download --defaultbundleexec rackup
Finally, point your browser atlocalhost:9292 (the first request will take a few seconds to compile the assets). You're all set.
Thethor 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 runningthor docs:list
. To update all downloaded documentations, runthor docs:download --installed
. To download and install all documentation this project has available, runthor docs:download --all
.
Note: there is currently no update mechanism other thangit pull origin main
to update the code andthor docs:download --installed
to download the latest version of the docs. To stay informed about new releases, be sure towatch this repository.
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.
The web app is all client-side JavaScript, powered by a smallSinatra/Sprockets application. It relies on files generated by thescraper.
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) andlocalStorage
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 11.1+
- Edge 17+
- iOS 11.3+
This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!
The scraper is responsible for generating the documentation and index files (metadata) used by theapp. It's written in Ruby under theDocs
module.
There are currently two kinds of scrapers:UrlScraper
which downloads files via HTTP andFileScraper
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 usingNokogiri.
Modifications made to each document include:
- removing content such as the document structure (
<html>
,<head>
, 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 usingPrism
These modifications are applied via a set of filters using theHTML::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 theapp 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 aboutscrapers andfilters is available in thedocs
folder.
The command-line interface usesThor. To see all commands and options, runthor list
from the project's root.
# Serverrackup# Start the server (ctrl+c to stop)rackup --help# List server options# Docsthor docs:list# List available documentationsthor docs:download# Download one or more documentationsthor docs:manifest# Create the manifest file used by the appthor docs:generate# Generate/scrape a documentationthor docs:page# Generate/scrape a documentation pagethor docs:package# Package a documentation for use with docs:downloadthor docs:clean# Delete documentation packages# Consolethor console# Start a REPLthor 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 teststhor test:docs# Run "Docs" teststhor test:app# Run "App" tests# Assetsthor assets:compile# Compile assets (not required in development mode)thor assets:clean# Clean old assets
If multiple versions of Ruby are installed on your system, commands must be run throughbundle exec
.
Contributions are welcome. Please read thecontributing guidelines.
Made something cool? Feel free to open a PR to add a new row to this table! You might want to discover new projects viahttps://github.com/topics/devdocs.
Project | Description | Last commit | Stars |
---|---|---|---|
yannickglt/alfred-devdocs | Alfred workflow | ||
Merith-TK/devdocs_webapp_kotlin | Android application | ||
gruehle/dev-docs-viewer | Brackets extension | ||
egoist/devdocs-desktop | Electron application | ||
skeeto/devdocs-lookup | Emacs function | ||
astoff/devdocs.el | Emacs viewer | ||
naquad/devdocs-shell | GTK shell with Vim integration | ||
hardpixel/devdocs-desktop | GTK application | ||
qwfy/doc-browser | Linux application | ||
dteoh/devdocs-macos | macOS application | ||
Sublime Text plugin | Sublime Text plugin | ||
mohamed3nan/DevDocs-Tab | VS Code extension (view as tab) | ||
deibit/vscode-devdocs | VS Code extension (open the browser) | ||
mdh34/quickDocs | Vala/Python based viewer | ||
girishji/devdocs.vim | Vim plugin & TUI (browse inside Vim) | ||
romainl/vim-devdocs | Vim plugin | ||
waiting-for-dev/vim-www | Vim plugin | ||
emmanueltouzery/apidocs.nvim | Neovim plugin | ||
toiletbril/dedoc | Terminal based viewer | ||
Raycast Devdocs | Raycast extension | Unavailable | Unavailable |
chrisgrieser/alfred-docs-searches | Alfred workflow |
Copyright 2013–2025 Thibaut Courouble andother contributors
This software is licensed under the terms of the Mozilla Public License v2.0. See theCOPYRIGHT andLICENSE files.
Please do not use the name DevDocs to endorse or promote products derived from this software without the maintainers' permission, except as may be necessary to comply with the notice/attribution requirements.
We also wish that any documentation file generated using this software be attributed to DevDocs. Let's be fair to all contributors by giving credit where credit's due. Thanks!
If you have any questions, please feel free to ask them on the contributor chat room onDiscord.
About
API Documentation Browser
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.