diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 5261407799ecd580793f3418016ea0c2d4686b0b..728ca8f3f1bb32a774bc205bc066d74294d81502 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -81,7 +81,7 @@ GEM octokit (~> 4.0) public_suffix (~> 3.0) typhoeus (~> 1.3) - html-pipeline (2.13.0) + html-pipeline (2.14.0) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.6.0) @@ -94,7 +94,7 @@ GEM i18n (~> 0.7) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 2.0) - kramdown (>= 2.30, < 3) + kramdown (>= 1.17, < 3) liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) @@ -215,7 +215,7 @@ GEM jekyll-include-cache (~> 0.1) jekyll-paginate (~> 1.1) jekyll-sitemap (~> 1.3) - minitest (5.14.1) + minitest (5.14.2) multipart-post (2.1.1) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) diff --git a/docs/README.md b/docs/README.md index c0095845b625d7c6a2dc21f780983b0b944de6d8..be535b3ab8a281e23ca5b8fd79290a2fe740cb88 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,15 +1,41 @@ # DeepSpeed Documentation -This directory includes the documentation of DeepSpeed. There are three ways to read it: +This directory includes the source code for the website and documentation of DeepSpeed. The `code-docs/` directory is used to build [deepspeed.readthedocs.io](https://deepspeed.readthedocs.io/en/latest/). -## 1. Access [deepspeed.ai](https://www.deepspeed.ai/) +[deepspeed.ai](https://www.deepspeed.ai/) is the recommended way to read all DeepSpeed documentation. Directly viewing the Markdown files in this directory will not include images and other features. -This is the most recommended way to read the documentation. +## Building the documentation locally +You can serve the DeepSpeed website locally. This is especially useful for development. -## 2. Directly read files in this directory +### Prerequisites +The DeepSpeed website relies on [Jekyll](https://jekyllrb.com/). There are several [guides for installation](https://jekyllrb.com/docs/installation/). The instructions below assume you are in an Ubuntu environment and have been tested on WSL. -We do not recommend this way because this directory is organized to build the [deepspeed.ai](https://www.deepspeed.ai/) website using Jekyll. Thus some of the files actually are not DeepSpeed documentation. In addition, some of the url links in the documentation only work through the webpages generated by Jekyll. +First ensure that you have the necessary packages (e.g., `make` and `zlib`). +``` +sudo apt-get install build-essential zlib1g-dev ruby-full +``` -## 3. Build [deepspeed.ai](https://www.deepspeed.ai/) website locally using Jekyll +Add these lines to your `.bashrc` or equivalent to ensure you have permissions to install Ruby packages without `sudo`. +``` +export GEM_HOME="$HOME/gems" +export PATH="$HOME/gems/bin:$PATH" +``` +Don't forget to `source ~/.bashrc` afterwards 😊. -This is recommended for local website development or when you do not have internet access. You can follow the instruction at [here](https://help.github.com/en/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll) to install Ruby, Bundler, and Jekyll. Then run `bundle exec jekyll serve` at this directory so that you can view the website in your web browser at `http://localhost:4000`. + +Now we can install Jekyll and [Bundler](https://bundler.io/): +``` +gem install jekyll bundler +``` + +### Start a local webserver +We now need to install the required Ruby packages for the website. **NOTE**: this step frequently hangs when connected to a VPN (including MSVPN). Simply disconnect for the package installation. +``` +bundle install +``` + +You can now start a local webserver via: +``` +bundle exec jekyll serve +``` +The website should now be accessible at [http://localhost:4000](http://localhost:4000)