devdocs README

README проекта с github.com/freeCodeCamp/devdocs. Одним файлом markdown: README.md.

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:

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.

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:

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.10 (defined in Gemfile), libcurl, webp, 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:

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:

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:

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  # Run coverage report for core tests

# Assets
thor 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 through bundle exec.

Contributing

Contributions are welcome. Please read the contributing guidelines.

Documentation

DevDocs Quick Usage Cheatsheet

Below are some helpful shortcuts and usage tips that are not immediately obvious to new users:

These shortcuts make DevDocs faster to navigate and more efficient for daily use.

Looking for desktop apps, editor integrations, or other tools built around DevDocs? Browse the devdocs topic on GitHub. Made something cool? Add the devdocs topic to your repository.

Copyright 2013–2026 Thibaut Courouble and other contributors

This software is licensed under the terms of the Mozilla Public License v2.0. See the COPYRIGHT and LICENSE 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!

Questions?

If you have any questions, please feel free to ask them on the #contributors chat room on Discord.

devdocs (freeCodeCamp/devdocs)

Ищем в базе…

Что это такое?DevDocs объединяет документацию многих языков программирования, фреймворков и инструментов в одном быстром веб-интерфейсе с поиском, поддержкой офлайн-режима, мобильной версией, тёмной темой и горячими клавишами.
Это онлайн-сайт или то, что я запускаю сам?И то, и другое: большинство просто пользуется бесплатной онлайн-версией на devdocs.io, но можно и развернуть её у себя через Docker или вручную с Ruby/Sinatra, если хотите участвовать в разработке или настроить её под себя.
Как запустить его самостоятельно?Проще всего через Docker: скачайте 'ghcr.io/freecodecamp/devdocs:latest' (или более компактный тег '-alpine') — приложение будет доступно по адресу localhost:9292. Для ручной установки сами установите приложение на Ruby/Sinatra и используйте CLI Thor (например, 'thor docs:download html css'), чтобы загрузить наборы документации.
Что нужно для ручной установки без Docker?Ruby 4.0.6, libcurl и JavaScript-среда выполнения, поддерживаемая ExecJS: она уже есть в macOS и Windows, а на Linux нужен Node.js.
Есть ли автоматическое обновление?Нет. Обновлять код нужно командой 'git pull origin main', а установленную документацию — командой 'thor docs:download --installed'. Встроенного автообновления нет.
Какие браузеры действительно поддерживаются?Поддерживаются только современные браузеры: свежие версии Firefox, Chrome или Opera, Safari 11.1+, Edge 17+ и iOS 11.3+, так как он использует новые API DOM и HTML5.
Действительно ли офлайн-режим работает без интернета?Да: service worker и переключатель Offline Mode позволяют загрузить выбранные наборы документации в localStorage, чтобы читать их без подключения.
Как загрузить только отдельные наборы документации, а не все?Используйте CLI Thor, например 'thor docs:download html css', чтобы загрузить конкретную документацию, или 'thor docs:download --all', чтобы установить все доступные наборы документации.
Почему в DevDocs нет учебников и руководств?Проект индексирует только справочные материалы и API, которые идентифицируются короткими уникальными строками, ведь поиск должен оставаться быстрым при более чем 100 000 записях. Полнотекстовые учебники и руководства намеренно не входят в задачи проекта.
Какие горячие клавиши полезны?Нажмите / или Ctrl+K, чтобы перейти к поиску, ? — чтобы открыть окно справки, клавиши-стрелки — для навигации по результатам, Enter — чтобы открыть результат, а Shift+S — чтобы переключить боковую панель.
Как скрапер на самом деле собирает документацию?Классы UrlScraper и FileScraper на Ruby загружают или читают исходные страницы, очищают и переписывают их с помощью фильтров Nokogiri и HTML::Pipeline, а затем выводят нормализованные HTML-фрагменты, а также файлы JSON-индекса и офлайн-данных.
Какие есть похожие проекты?zeal, jsdoc, VibeOffice, redoc, oxynote, PandaWiki, squoosh, docsify
Автор
freeCodeCamp
Размер
33 MB
Звёзды
39.7K
Обновлён
КоммитNov 17
Возраст
13 г
Коммиты · 90 дней