Module: Slimdown

Defined in:
lib/slimdown.rb,
lib/slimdown/page.rb,
lib/slimdown/config.rb,
lib/slimdown/folder.rb,
lib/slimdown/version.rb,
lib/slimdown/exception.rb,
lib/slimdown/page_parser.rb

Overview

The main Slimdown namespace.

Defined Under Namespace

Classes: Config, Exception, Folder, Page, PageParser

Constant Summary collapse

VERSION =

The slimdown version

'1.2.0'.freeze

Class Method Summary collapse

Class Method Details

.config(&block) ⇒ Slimdown::Config

Sets and retrieves global configuration.

If called with a block, the config object will be passed to the block and allow settings to be modified. This could be done in a Rails initializer:

Slimdown.config do |config|
  config.location = Rails.root.join 'pages'
end

The settings object is always returned.

Parameters:

  • block (Proc)

    to call with config object.

Returns:



24
25
26
27
28
29
30
31
# File 'lib/slimdown.rb', line 24

def self.config(&block)
  @config ||= Slimdown::Config.new

  # Allow configuration via a block.
  block.call(@config) if block

  @config
end