diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000000..73b8208afd --- /dev/null +++ b/.env.sample @@ -0,0 +1 @@ +RUBY_VERSION=2.7 diff --git a/.gitignore b/.gitignore index badbc02f6c..cb72b705a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ _site .sass-cache +.env diff --git a/README.md b/README.md index 218032b5cf..8c977f332d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# [railsdoc.github.io](https://railsdoc.github.io/) +# [railsdoc.github.io](https://railsdoc.github.io/) [![CI](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml) [![Deploy](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/deploy.yml/badge.svg)](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/deploy.yml) [![Netlify Status](https://api.netlify.com/api/v1/badges/c964029a-6d5a-4f3a-95e9-d35830a2fe83/deploy-status)](https://app.netlify.com/sites/railsdoc-preview/deploys) -railsdoc.github.io is yet another Rails API documentation website. +[railsdoc.github.io](https://railsdoc.github.io/) is yet another Rails API documentation website. ## Project Goal @@ -24,6 +24,45 @@ There are some enhancements in addition to SEO. - [ ] Comment System - [ ] etc. (see. https://github.com/railsdoc/railsdoc.github.io/issues) -## Feature Request +## Setup + +```console +$ bundle install +``` + +## Build docs + +For the latest Rails version: + +```console +$ rake build +``` + +This command generates Rails docs with `default_rails_version` defined in `_config.yml`. + +For specific Rails versions: + +```console +$ rake build_multi[5.2,6.0,6.1] +``` + +### Using docker for the older Rails build + +Set `RUBY_VERSION` in `.env` file and run `docker compose`. + +```console +$ cp .env.sample .env +$ docker compose run app bash -c 'rake build_multi[5.2]' +``` + +## Serve docs + +Serve html under `src` directory. + +```console +$ bundle exec jekyll server +``` + +## Feature Request Please create an [issue](https://github.com/railsdoc/railsdoc.github.io/issues).