开发者社区> 镜像站> NPM> authenticated-docs
authenticated-docs
A simple Rails app with Devise authentication to serve static docs generated with a tool like MkDocs
Last updated 4 years ago by artemv .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install authenticated-docs 
SYNC missed versions from official npm registry.

CircleCI Code Climate semantic-release

What is it

A simple Rails app with Devise authentication to serve static docs generated with a tool like MkDocs or Gitbook. Static html is served by HighVoltage customized to serve pathes containing whitespaces and dir pathes missing 'index' filename. RailsAdmin is used for users administration.

Usage

This assumes you have a docs-building project in Git, the built docs are in 'site' directory and you want to deploy it to Heroku.

  • Install Node.JS (v5.1 or higher)
  • Change current dir to your project: cd my-docs-project
  • Install authenticated-docs and couple additional tools:
npm install authenticated-docs gh-pages gulp gulp-debug
  • Copy docs files to authenticated-docs dirs:
./node_modules/.bin/gulp --gulpfile node_modules/authenticated-docs/Gulpfile.js --cwd ./ prepare
  • Publish the prepared dir to 'deploy' Git branch of your docs project:
./node_modules/gh-pages/bin/gh-pages -d node_modules/authenticated-docs -b deploy
  • Switch to the deploy branch:
# first time
git fetch && git checkout -b deploy origin/deploy
# next time
git fetch && git checkout deploy && git reset --hard origin/deploy
  • Create a my-docs app at Heroku (use whatever app name you like)
  • Provision the Heroku app with Sendgrid addon for sending auth emails like the one for 'forgot password' function
  • set up config vars at heroku based on .env.example file of this project
  • Push the deploy branch to Heroku
git remote add heroku https://git.heroku.com/my-docs.git # use proper path for your app
git push -f heroku HEAD:master
heroku run rake db:migrate
heroku restart

Local installation

This section is for those who want to make modifications to this app.

  • Clone the master repo: git clone https://github.com/artemv/authenticated-docs.git && cd authenticated-docs
  • Copy .env.example file to .env and change values as appropriate for your local env
  • Install Ruby 2.3.1 from https://www.ruby-lang.org/en/downloads/ or via RVM (https://rvm.io/)
  • Install Bundler and dependencies:
gem install bundler
bundle install
  • Install NPM dependencies: npm install
  • generate site docs to './site' dir
  • change Gulpfile.js to have const TARGET_DIR = '.' - the default value there is for prod usage
  • copy the docs pages to relevant dirs: ./node_modules/.bin/gulp prepare
  • run local webserver:
rails s

Current Tags

  • 1.0.13                                ...           latest (4 years ago)

14 Versions

  • 1.0.13                                ...           4 years ago
  • 1.0.12                                ...           4 years ago
  • 1.0.11                                ...           4 years ago
  • 1.0.10                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (0)
None