Improve "Usage" in the README and link to documentation

This commit is contained in:
Benjamin Neff 2018-08-25 00:09:32 +02:00
parent 42f115dbc8
commit 564e4dd20d
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -37,25 +37,31 @@ Configure the engine in ```config/initializers/diaspora_federation.rb```:
```ruby ```ruby
DiasporaFederation.configure do |config| DiasporaFederation.configure do |config|
# the pod url # the pod url
config.server_uri = AppConfig.pod_uri config.server_uri = "http://localhost:3000"
# ... other settings
config.define_callbacks do config.define_callbacks do
on :fetch_person_for_webfinger do |diaspora_id| on :fetch_person_for_webfinger do |diaspora_id|
person = Person.find_local_by_diaspora_id(diaspora_id) person = Person.find_local_by_diaspora_id(diaspora_id)
if person if person
DiasporaFederation::Discovery::WebFinger.new( DiasporaFederation::Discovery::WebFinger.new(
# ... # ... copy person attributes to WebFinger object
) )
end end
end end
on :fetch_person_for_hcard do |guid| on :fetch_person_for_hcard do |guid|
# ... # ... fetch hcard information
end end
# ... other callbacks
end end
end end
``` ```
The available config settings can be found [here](https://www.rubydoc.info/gems/diaspora_federation/DiasporaFederation#class_attr_details) and the callbacks are listed [here](https://www.rubydoc.info/gems/diaspora_federation/DiasporaFederation#define_callbacks-class_method) in the gem documentation.
## Contributing ## Contributing
See [our contribution guide](/CONTRIBUTING.md) for more information on how to contribute to the diaspora\* federation library. See [our contribution guide](/CONTRIBUTING.md) for more information on how to contribute to the diaspora\* federation library.