Enki makes it easy to keep your API documentation on your codebase while keeping a view of it on Confluence.
Heavily depends on https://github.com/apiaryio/snowcrash and https://github.com/qarioz/confluencer.
Add this line to your application's Gemfile:
gem 'enki'
And then execute:
$ bundle
Or install it yourself as:
$ gem install enki
This gem depends on the snowcrash binary.
Add a configuration file to your rails project, (for example at config/initializers/enki.rb):
Enki.configure do |c|
c.confluence_user = ENV['CONFLUENCE_USERNAME']
c.confluence_password = ENV['CONFLUENCE_PASSWORD']
c.confluence_url = 'https://confluence.domain.com/confluence'
c.confluence_space = 'API'
c.snowcrash_binary = `which snowcrash`.strip
endThis gem provides 3 rake tasks:
rake enki:generate_ast- Generates yaml files intmp/enkiby parsing every file indoc/rake enki:ast_to_html- Loads the yaml files and renders one html per yamlrake enki:upload_to_confluence- Uploads the rendered html to confluence by using the configuration variables
Note that each rake task calls the previous one, thus a realistic workflow is to just call rake enki:upload_to_confluence.
If you see too much getting uploaded, rm tmp/enki and try again.
- Whitelist doc files to process
- Better output/verbosity of rake tasks
- Fail on missing configuration settings early and obvious
- Fork it ( https://github.com/vrinek/enki/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request