• Stars
    star
    32,300
  • Rank 491 (Top 0.01 %)
  • Language
    Ruby
  • License
    Mozilla Public Li...
  • Created over 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

API Documentation Browser

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.

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.2.1, libcurl, and a JavaScript runtime supported by ExecJS (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 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.

Alternatively, DevDocs may be started as a Docker container:

# First, build the image
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
docker build -t thibaut/devdocs .

# Finally, start a DevDocs container (access http://localhost:9292)
docker run --name devdocs -d -p 9292:9292 thibaut/devdocs

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, written in CoffeeScript, and 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 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!

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 (<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 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

# 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

# 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

Related Projects

Made something cool? Feel free to open a PR to add a new row to this table! You might want to discover new projects via https://github.com/topics/devdocs.

Project Description Last commit Stars
yannickglt/alfred-devdocs Alfred workflow Latest GitHub commit GitHub stars
Merith-TK/devdocs_webapp_kotlin Android application Latest GitHub commit GitHub stars
gruehle/dev-docs-viewer Brackets extension Latest GitHub commit GitHub stars
egoist/devdocs-desktop Electron application Latest GitHub commit GitHub stars
skeeto/devdocs-lookup Emacs function Latest GitHub commit GitHub stars
astoff/devdocs.el Emacs viewer Latest GitHub commit GitHub stars
naquad/devdocs-shell GTK shell with Vim integration Latest GitHub commit GitHub stars
hardpixel/devdocs-desktop GTK application Latest GitHub commit GitHub stars
qwfy/doc-browser Linux application Latest GitHub commit GitHub stars
dteoh/devdocs-macos macOS application Latest GitHub commit GitHub stars
Sublime Text plugin Sublime Text plugin Latest GitHub commit GitHub stars
mohamed3nan/DevDocs-Tab VS Code extension (view as tab) Latest GitHub commit GitHub stars
deibit/vscode-devdocs VS Code extension (open the browser) Latest GitHub commit GitHub stars
mdh34/quickDocs Vala/Python based viewer Latest GitHub commit GitHub stars
romainl/vim-devdocs Vim plugin Latest GitHub commit GitHub stars
waiting-for-dev/vim-www Vim plugin Latest GitHub commit GitHub stars

Copyright / License

Copyright 2013–2023 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 contributor chat room on Discord.

More Repositories

1

freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
TypeScript
374,440
star
2

how-to-contribute-to-open-source

A guide to contributing to open source
Ruby
8,503
star
3

mail-for-good

An open source email campaign management tool for nonprofits
JavaScript
3,833
star
4

guide

A collection of easy-to-understand guides to programming tools
2,130
star
5

chapter

A self-hosted event management tool for nonprofits
TypeScript
1,916
star
6

awesome-quincy-larson-emails

This repository is an archive of emails that are sent by the awesome Quincy Larson every week.
Python
1,080
star
7

LearnToCodeRPG

A visual novel video game where you learn to code and get a dev job 🎯
Ren'Py
1,024
star
8

boilerplate-npm

A boilerplate for the freeCodeCamp curriculum.
JavaScript
595
star
9

learn

freeCodeCamp's learning platform with 2,000 interactive coding challenges
JavaScript
441
star
10

mobile

freeCodeCamp's open-source mobile app made with Flutter
Dart
403
star
11

pantry-for-good

An open source food bank logistics and inventory management tool
JavaScript
381
star
12

meeting-for-good

A meeting coordination app for your team
JavaScript
338
star
13

boilerplate-infosec

A boilerplate for the freeCodeCamp curriculum.
JavaScript
303
star
14

CurriculumExpansion

JavaScript
294
star
15

wiki

freeCodeCamp's deprecated wiki articles
JavaScript
280
star
16

100DaysOfCode-twitter-bot

Twitter bot for #100DaysOfCode
JavaScript
277
star
17

Developer_Quiz_Site

This is a quiz site filled with over 1200+ questions on programming.
TypeScript
229
star
18

boilerplate-express

A boilerplate for the freeCodeCamp curriculum.
JavaScript
218
star
19

chinese

201
star
20

2016-new-coder-survey

R
194
star
21

boilerplate-mochachai

A boilerplate for the freeCodeCamp curriculum.
JavaScript
175
star
22

testable-projects-fcc

Test suite for freeCodeCamp's legacy Codepen-based Curriculum
JavaScript
170
star
23

league-for-good

An open source sports league management tool
JavaScript
162
star
24

open-data

HTML
152
star
25

classroom

JavaScript
146
star
26

web3-curriculum

Half of the Web3 Curriculum
JavaScript
145
star
27

python-coding-challenges

freeCodeCamp's stand-alone Python coding challenges
Python
144
star
28

demo-projects

Example certification projects for our programming curriculum
JavaScript
139
star
29

coderadio-client

24/7 music designed for coding - https://coderadio.freecodecamp.org
JavaScript
128
star
30

conference-for-good

An open source conference management tool
TypeScript
118
star
31

solana-curriculum

freeCodeCamp Solana Curriculum
TypeScript
116
star
32

boilerplate-project-timestamp

A boilerplate for a freeCodeCamp project.
HTML
103
star
33

assets

A collection of https://www.freeCodeCamp.org logos and other assets
100
star
34

camper-gitter-bot

Finally, robotic beings rule the world.
JavaScript
94
star
35

open-api

freeCodeCamp's open-api Intiative
JavaScript
88
star
36

curriculum

The freeCodeCamp curriculum and lesson editor
JavaScript
83
star
37

boilerplate-mongomongoose

A boilerplate for the freeCodeCamp curriculum.
JavaScript
75
star
38

cdn

static assets for use with projects, curriculum and other places on internet
Python
74
star
39

100DaysOfCode-discord-bot

A Discord bot created for the 100 Days of Code challenge.
TypeScript
68
star
40

Rust-In-Replit

The freeCodeCamp Rust In Replit course
JavaScript
66
star
41

open-source-for-good-directory

A directory for freeCodeCamp's Open Source for Good apps - solutions for nonprofits
JavaScript
65
star
42

euler-rust

Local config for running the freeCodeCamp Project Euler lessons in Rust
JavaScript
62
star
43

boilerplate-project-urlshortener

A boilerplate for a freeCodeCamp project.
HTML
60
star
44

freeCodeCampOS

Test repo for external freeCodeCamp courses
JavaScript
56
star
45

2017-new-coder-survey

Open Dataset from freeCodeCamp's 2017 survey of more than 20,000 developers
R
55
star
46

infra

> freeCodeCamp.org's infrastructure-as-code
HCL
53
star
47

news

freeCodeCamp's JAMstack Developer News publication. Built with 11ty, Ghost, and help from kind contributors like you.
JavaScript
53
star
48

boilerplate-project-exercisetracker

A boilerplate for a freeCodeCamp project.
HTML
46
star
49

courses-vscode-extension

freeCodeCamp VSCode extension to help run and develop courses
TypeScript
46
star
50

study-group-directory

CSS
45
star
51

massification

An emailing service built on Amazon SES and Node
JavaScript
42
star
52

rdb-alpha

Dockerfile
41
star
53

boilerplate-project-headerparser

A boilerplate for a freeCodeCamp project.
HTML
40
star
54

videos-translation

39
star
55

boilerplate-advancednode

A boilerplate for the freeCodeCamp curriculum referenced in 'Advanced Node/Express Introduction'.
JavaScript
39
star
56

scrapepark.org

Source for scrapepark.org
HTML
37
star
57

design-style-guide

Design Style Guide
HTML
35
star
58

news-theme

The Ghost theme for Developer News.
Handlebars
34
star
59

boilerplate-medical-data-visualizer

Python
34
star
60

FreeCodeCampTriviaQuiz

Take developer quizzes using your Amazon Echo with this freeCodeCamp.org Alexa skill
JavaScript
33
star
61

math-for-programmers-prototype

An interactive browser-based curriculum where you learn math through LaTeX
JavaScript
32
star
62

boilerplate-project-stockchecker

A boilerplate for a freeCodeCamp project.
JavaScript
32
star
63

classroom-mode-archived

JavaScript
31
star
64

boilerplate-project-filemetadata

A boilerplate for a freeCodeCamp project.
HTML
31
star
65

learn-bash-by-building-a-boilerplate

Shell
30
star
66

camperchan

Discord bot running in our freeCodeCamp Discord server
TypeScript
28
star
67

2018-new-coder-survey

The results of the 2018 New Coder Survey
R
28
star
68

2018-jamstack-hackathon

IN PERSON freeCodeCamp JAMstack Hackathon on November 3 - 4 at GitHub
28
star
69

learn-relational-databases-by-building-a-mario-database

Shell
27
star
70

learn-bash-scripting-by-building-five-programs

Shell
26
star
71

multiple-choice-questions

Multiple choice questions for our interview preparation section
JavaScript
26
star
72

near-curriculum

JavaScript
25
star
73

rocketchat-bot

TypeScript
25
star
74

arcade-mode

A repo for algorithm and data structures interview practice app
JavaScript
24
star
75

boilerplate-arithmetic-formatter

Python
24
star
76

PhoneIDE

PhoneIDE freeCodeCamps Mobile Editor Made with Flutter
Dart
24
star
77

learn-sql-by-building-a-student-database-part-1

Shell
23
star
78

2018-online-jamstack-hackathon

freeCodeCamp JAMstack Online Hackathon November 3 - 4
23
star
79

boilerplate-budget-app

Python
23
star
80

boilerplate-project-messageboard

A boilerplate for a freeCodeCamp project.
HTML
21
star
81

.github

> Our default community health files for all our repositories on GitHub.
21
star
82

boilerplate-project-issuetracker

A boilerplate for a freeCodeCamp project.
JavaScript
20
star
83

sendgrid-email-blast

A CLI tool for sending emails via the SendGrid API.
TypeScript
20
star
84

nginx-config

> Config for our NGINX instances that serve our platforms.
20
star
85

COM1000

freeCodeCamp's deprecated challenge editor
JavaScript
19
star
86

JulyGameDev

Read more about this here: http://blog.freecodecamp.com/2015/07/watch-us-code-games-live-all-weekend.html
JavaScript
19
star
87

freecodecamp-dark-vscode-theme

18
star
88

learn-git-by-building-an-sql-reference-object

Shell
18
star
89

2021-new-coder-survey

The results of freeCodeCamp's 2021 New Coder Survey
18
star
90

boilerplate-bcrypt

A boilerplate for the freeCodeCamp curriculum referenced in 'Data Protection with BCrypt'.
JavaScript
18
star
91

boilerplate-project-metricimpconverter

A boilerplate for a freeCodeCamp project.
JavaScript
17
star
92

boilerplate-project-sudoku-solver

A boilerplate for a freeCodeCamp project.
JavaScript
17
star
93

curriculum-helpers

An internal package that allows thorough testing of challenges between multiple freeCodeCamp platforms.
Python
17
star
94

chat

freeCodeCamp.org's official community chat rooms
HTML
16
star
95

event-calendar

TypeScript
16
star
96

search

A search engine for all things freeCodeCamp
JavaScript
15
star
97

boilerplate-demographic-data-analyzer

Python
15
star
98

terraform-github-runners

Our Terraform module to provision GitHub self-hosted runners on AWS.
HCL
15
star
99

boilerplate-project-library

A boilerplate for a freeCodeCamp project.
JavaScript
15
star
100

forum-theme

Themes that we use on our forums
SCSS
14
star