• Stars
    star
    32,300
  • Rank 533 (Top 0.02 %)
  • Language
    Ruby
  • License
    Mozilla Public Li...
  • Created about 11 years ago
  • Updated about 1 year 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,733
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,921
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,117
star
7

LearnToCodeRPG

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

boilerplate-npm

A boilerplate for the freeCodeCamp curriculum.
JavaScript
649
star
9

learn

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

mobile

freeCodeCamp's open-source mobile app made with Flutter
Dart
424
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
331
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 1500+ questions on programming.
TypeScript
259
star
18

boilerplate-express

A boilerplate for the freeCodeCamp curriculum.
JavaScript
234
star
19

chinese

214
star
20

2016-new-coder-survey

R
196
star
21

boilerplate-mochachai

A boilerplate for the freeCodeCamp curriculum.
JavaScript
189
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
163
star
24

web3-curriculum

Half of the Web3 Curriculum
JavaScript
159
star
25

open-data

HTML
157
star
26

python-coding-challenges

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

classroom

JavaScript
143
star
28

demo-projects

Example certification projects for our programming curriculum
JavaScript
142
star
29

coderadio-client

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

solana-curriculum

freeCodeCamp Solana Curriculum
TypeScript
126
star
31

conference-for-good

An open source conference management tool
TypeScript
118
star
32

boilerplate-project-timestamp

A boilerplate for a freeCodeCamp project.
HTML
113
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
96
star
35

open-api

freeCodeCamp's open-api Intiative
JavaScript
88
star
36

curriculum

The freeCodeCamp curriculum and lesson editor
JavaScript
81
star
37

boilerplate-mongomongoose

A boilerplate for the freeCodeCamp curriculum.
JavaScript
80
star
38

cdn

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

Rust-In-Replit

The freeCodeCamp Rust In Replit course
JavaScript
71
star
40

100DaysOfCode-discord-bot

A Discord bot created for the 100 Days of Code challenge.
TypeScript
68
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
61
star
44

freeCodeCampOS

Test repo for external freeCodeCamp courses
JavaScript
59
star
45

news

freeCodeCamp's JAMstack Developer News publication. Built with 11ty, Ghost, and help from kind contributors like you.
TypeScript
57
star
46

infra

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

2017-new-coder-survey

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

boilerplate-project-exercisetracker

A boilerplate for a freeCodeCamp project.
HTML
50
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

learn-bash-by-building-a-boilerplate

Shell
42
star
52

massification

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

rdb-alpha

Dockerfile
42
star
54

contribute

> docs site for all things contributions. begin your contribution journey here.
MDX
42
star
55

boilerplate-project-headerparser

A boilerplate for a freeCodeCamp project.
HTML
41
star
56

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

Shell
39
star
57

boilerplate-advancednode

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

videos-translation

38
star
59

boilerplate-medical-data-visualizer

Python
37
star
60

scrapepark.org

Source for scrapepark.org
HTML
36
star
61

design-style-guide

Design Style Guide
HTML
35
star
62

FreeCodeCampTriviaQuiz

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

boilerplate-project-stockchecker

A boilerplate for a freeCodeCamp project.
JavaScript
34
star
64

news-theme

The Ghost theme for Developer News.
Handlebars
33
star
65

math-for-programmers-prototype

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

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

Shell
31
star
67

classroom-mode-archived

JavaScript
31
star
68

news-translation-tasks

JavaScript
31
star
69

boilerplate-project-filemetadata

A boilerplate for a freeCodeCamp project.
HTML
31
star
70

camperchan

Discord bot running in our freeCodeCamp Discord server
TypeScript
29
star
71

2018-new-coder-survey

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

2018-jamstack-hackathon

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

near-curriculum

JavaScript
26
star
74

rocketchat-bot

TypeScript
26
star
75

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

Shell
26
star
76

PhoneIDE

PhoneIDE freeCodeCamps Mobile Editor Made with Flutter
Dart
26
star
77

multiple-choice-questions

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

arcade-mode

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

boilerplate-arithmetic-formatter

Python
24
star
80

2018-online-jamstack-hackathon

freeCodeCamp JAMstack Online Hackathon November 3 - 4
23
star
81

boilerplate-budget-app

Python
23
star
82

boilerplate-project-messageboard

A boilerplate for a freeCodeCamp project.
HTML
21
star
83

boilerplate-project-issuetracker

A boilerplate for a freeCodeCamp project.
JavaScript
20
star
84

.github

> Our default community health files for all our repositories on GitHub.
20
star
85

sendgrid-email-blast

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

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

Shell
20
star
87

freecodecamp-dark-vscode-theme

19
star
88

boilerplate-project-metricimpconverter

A boilerplate for a freeCodeCamp project.
JavaScript
19
star
89

COM1000

freeCodeCamp's deprecated challenge editor
JavaScript
19
star
90

boilerplate-bcrypt

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

nginx-config

> Config for our NGINX instances that serve our platforms.
19
star
92

curriculum-helpers

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

JulyGameDev

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

2021-new-coder-survey

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

boilerplate-demographic-data-analyzer

Python
17
star
96

boilerplate-rock-paper-scissors

Python
17
star
97

learn-bash-and-sql-by-building-a-bike-rental-shop

Shell
16
star
98

chat

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

boilerplate-project-sudoku-solver

A boilerplate for a freeCodeCamp project.
JavaScript
16
star
100

search

A search engine for all things freeCodeCamp
JavaScript
15
star