Class: Nanoc3::PreprocessorContext

Nanoc3::PreprocessorContext provides a context in which preprocessing code can be executed. It provides access to the site and its configuration, items and layouts.

Constructor Summary

public initialize(site)

Creates a new preprocessor context for the given site.

[View source]


9
10
11
# File 'lib/nanoc3/base/preprocessor_context.rb', line 9

def initialize(site)
  @site = site
end

Public Visibility

Public Instance Method Summary

#config

The configuration of the site for which the preprocessor code is being executed.

#items

The items in the site for which the preprocessor code is being executed.

#layouts

The layouts in the site for which the preprocessor code is being executed.

#site

The site for which the preprocessor code is being executed.

Public Instance Method Details

config

public config

The configuration of the site for which the preprocessor code is being executed.

[View source]


20
21
22
# File 'lib/nanoc3/base/preprocessor_context.rb', line 20

def config
  site.config
end

items

public items

The items in the site for which the preprocessor code is being executed.

[View source]


25
26
27
# File 'lib/nanoc3/base/preprocessor_context.rb', line 25

def items
  site.items
end

layouts

public layouts

The layouts in the site for which the preprocessor code is being executed.

[View source]


31
32
33
# File 'lib/nanoc3/base/preprocessor_context.rb', line 31

def layouts
  site.layouts
end

site

public site

The site for which the preprocessor code is being executed.

[View source]


14
15
16
# File 'lib/nanoc3/base/preprocessor_context.rb', line 14

def site
  @site
end
Generated on Sunday, August 09 2009 at 01:43:10 PM by YARD 0.2.3.2 (ruby-1.8.7).