actmd/abraham

Provide full configuration of underlying Shepherd.Tour JS component

kofronpi opened this issue · 3 comments

Right now, the shepherd component is initialized like this:

  var tour = new Shepherd.Tour({
    defaults: {
      classes: '<%= Rails.configuration.abraham.default_theme %>'
    }
  });

It would be great to be able to use all of Shepherd.js options.

Maybe it would be easier to do with PORO Abrahamah tours rather than yml files, just suggesting :)

Great question. Is there a way we could do both, i.e. a YAML-driven approach for the simple cases, and a PORO-driven approach for full customization?

My primary motivation for creating Abraham was to simplify the implementation of the most typical product tours, after building them by hand with the same Shepherd configuration each and every time. This way, it becomes possible for non-developer team members to compose and refine tour flow/content. Whatever we do, I want to ensure we maintain that possibility.

I understand the need and think it's great, but I also think it's a great gem for more technical profiles. Convention by default, configuration if needed :)

How could we configure yml vs ruby without checking at each controller call ?

@kofronpi FYI, in addressing #22, I'm going to make new Shepherd.Tour() accept a full JSON block from abraham.yml, so you can configure it with anything you like.

Putting JSON into YAML isn't the most beautiful thing to do, but it'll get the job done ;)

For example:

defaults: &defaults
  :tour_options: '{ classPrefix: "abraham-" }'