Future 1.0.0 configuration dsl idea

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Future 1.0.0 configuration dsl idea

LightGuard
Administrator
I've been thinking about a DSL configuration for awestruct to help alleviate the need to edit four different files (Gemfile, site.yml, pipeline.rb, .awestruct_ignore). Here's my current thought:

``` ruby
Awestruct::Site.new do
  # Optional
  # The idea here is to mimic (then inject into) a Gemfile.
  # Could be thrown out, but I figured it would be easier for people to only
  # have to lookin one place.
  #
  # Each command (style, engine, other) would then become a new group in
  # the Gemfile.
  dependencies do
    # Optional
    style 'zurb-foundation', '4.2'
    style 'compass', '0.12'

    # Optional
    engine 'RedCarpet', '~> ...'

    # Optional
    other 'RestClient', '...' # needs a better name
  end

  # Optional This would replace profiles in site.yml
  profiles do
    development do

    end
    production do

    end
  end 

  # Settings for engines or other bits
  configuration do
    slim '...', '...'
    asciidoctor '...', '...'

    title 'My new awestruct site'
    ignore_files //, //, //, '...' # we'd convert strings to regexp
  end

  rendering_pipeline do # better name?
    # replaces current pipeline
    # Hopefully have a section for or allow things to be done
    # concurrently, haven't decided on the best idea yet.
    # Full concurrency would be great, but some things may not 
    # be able to be done concurrently (synthetic pages and Indexifier for example)
    #
    # But those things that cannot be done concurrently with other bits of the 
    # pipeline may be able to be done using a fork / join idea for themselves
  end
end
```

Thoughts?

--