Documentation Portal - Multiple Deliverable Version
This is a documentation portal written in Ruby, using Sinatra for routing and CouchDB for content storage and searching. The UI is controlled by Twitter Bootstrap.
Quick hosting using Heroku
-
Answer questions on that web page. Use your own Cloudant database URL, please. It should be something like this:
http://<username>:<password>@sanderson.cloudant.com
You can use the default for initial testing, but please update it to use your Cloudant URL. -
When the app is deployed, click View It. Sign in with username
redsofa-qa
passworddoc123456
Setting up the project to configure and customize
-
Install Ruby 2.1.2 (I suggest using - RVM)
-
Clone this project
-
Install the gems in the Gemfile (I suggest using bundle)
Run it locally
-
Set up your database
-
Set the CLOUDANT_URL environment variable
- For a local database, do something like this:
export CLOUDANT_URL=http://admin:admin@localhost:5984
- For a hosted database, do something like this:
export CLOUDANT_URL=http://<username>:<passcode>:<cloudant-host>.cloudant.com
- For a local database, do something like this:
-
Create a file named
.env.development
and add your CLOUDANT_URL export command to it (ie,export CLOUDANT_URL=http://admin:admin@localhost:5984
) -
Then run
rake update_local_db
-
Review the log in log/upload_*.txt
-
Then run
rake start_local
-
If you want to auto-load local changes, instead of start_local, use
rake start_local_debug
-
Open your web browser and look at [http://localhost:5000]
- If you are prompted to login, the username is redsofa-qa, password doc123456
Deploy it to heroku - manual
-
One time, initialize the project on heroku
rake initialize_heroku[
app_name,CLOUDANT_URL ]
where *app_name* is the name you want for your app, and *CLOUDANT_URL* is the URL to your hosted database. *Note*: Don't put spaces around the comma between *app_name* and *CLOUDANT_URL*. If you do, you'll get an error.
-
Push your content to the remote database
rake update_remote_db
-
Review the log in log/upload_*.txt
-
Validate it's working
heroku open
Username: redsofa-qa
Password: doc123456
Customizing the look and feel
The project depends on Twitter Bootstrap for its look and feel. To customize, you need to do the following:
-
Install lessc and uglifyjs installed (the best way is to install them with npm, then
npm install -g less uglify-js
) -
Customize the files in
less/
. See http://lesscss.org/ for details on less. -
Due to an issue with less v2 (see http://stackoverflow.com/questions/26628309/less-v2-does-not-compile-twitters-bootstrap-2-x), modify vendor/twitter-bootstrap/less/navbar.less by changing
.navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { #grid > .core > .span(@gridColumns); }
to
.navbar-fixed-top .container, .navbar-fixed-bottom .container { width: (@gridColumnWidth * @gridColumns) + (@gridGutterWidth * (@gridColumns - 1)); }
-
Run
rake bootstrap:make
Updating the content with your own
The content in content/sample
is there for example purposes. To serve up your own content, you need to do the following:
-
Move the content directory to content-bak (save the files for refernece)
-
Add your html files to content/lang-local/deliverable_name
-
Copy deliverable_metadata.json from the sample files and update it for your needs.
-
Copy sample.toc and update it for your needs. Copy it to deliverable_name.toc in content/lang-local/deliverable_name
-
If you have specific metadata requirements update
lib/db/db_transaction.rb
Customizing the username and password
The username and password are stored in config/app_config.yaml
. Update that file to change the username or password.
To turn off the required login, uncomment (remove the # character) the line that begins with LOGIN_REQUIRED
.
© Copyright 2013 salesforce.com, inc.