README.md in apipie-dsl-2.0.0 vs README.md in apipie-dsl-2.1.0
- old
+ new
@@ -2,11 +2,11 @@
Apipie-dsl is a DSL for documenting DSLs written in Ruby. Instead of traditional
use of `#comments`, ApipieDSL lets you describe the code, through the code.
## Getting started
-
+#### Within Rails application
The easiest way to get ApipieDSL up and running with your app is:
```sh
echo "gem 'apipie-dsl'" >> Gemfile
bundle install
@@ -21,9 +21,39 @@
required :string, String, 'Required string parameter'
end
def print(string)
# ...
end
+```
+
+#### Within plain Ruby application
+```sh
+ echo "gem 'apipie-dsl'" >> Gemfile
+ # To be able to generate HTML documentation via rake command
+ echo "gem 'rake'" >> Gemfile
+ echo "gem 'actionview'" >> Gemfile
+ bundle install
+```
+In case if you want to generate HTML documentation via rake command, I'd suggest
+have the following in your `Rakefile`:
+```ruby
+require 'apipie-dsl'
+
+# Configuration is required!
+ApipieDSL.configure do |config|
+ config.app_name = 'My DSL Docs'
+ # Matchers are needed to load your code with documentation
+ config.dsl_classes_matchers = [
+ "#{File.dirname(__dir__)}/dsl_example/common_classes.rb",
+ "#{File.dirname(__dir__)}/dsl_example/dsl.rb"
+ ]
+ # This is important for plain ruby application!
+ config.rails = false
+ # ... other configurations
+end
+spec = Gem::Specification.find_by_name('apipie-dsl')
+rakefile = "#{spec.gem_dir}/lib/apipie_dsl/Rakefile"
+load(rakefile)
```
# Documentation
## Contents
- [__Configuration Reference__](#Configuration-Reference)