forked from CocoaPods/cocoapods.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.rb
95 lines (70 loc) · 2.08 KB
/
config.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
set :css_dir, 'css'
set :js_dir, 'js'
set :images_dir, 'img'
set :encoding, 'utf-8'
set :relative_links, true
# Support for browsing from the build folder.
set :strip_index_file, false
configure :build do
activate :minify_javascript
activate :minify_css
activate :relative_assets
activate :asset_hash
end
#--------------------------------------#
set :markdown_engine, :redcarpet
set :markdown, {
:fenced_code_blocks => true,
:autolink => true,
:smartypants => true
}
activate :automatic_image_sizes
#------------------------------------------------------------------------------#
require "lib/navigation_helpers.rb"
require "lib/html_helpers.rb"
require 'lib/doc/code_objects'
helpers NavigationHelpers
helpers HTMLHelpers
#--------------------------------------#
# Loading data
navigation_data = {
'dsl' => %w[ podfile specification],
'gems' => %w[ CocoaPods CocoaPods-Core Xcodeproj CLAide cocoapods-downloader ]
}
content_for :dsl_data do navigation_data * '<br>' end
# Dynamic pages
navigation_data['dsl'].each do |name|
proxy "#{name}.html", "templates/dsl.html", {
:locals => { :name => name },
:ignore => true
}
end
proxy "commands.html", "templates/commands.html", {
:locals => { :name => 'commands' },
:ignore => true
}
gems = []
navigation_data['gems'].each do |name|
proxy "#{parameterize name}/index.html", "templates/gem.html", {
:locals => { :name => name },
:ignore => true
}
proxy "#{parameterize name}/name_spaces.html", "templates/gem_namespaces_list.html", {
:locals => { :name => name },
:ignore => true
}
proxy "#{parameterize name}/gem_todo_list.html", "templates/gem_todo_list.html", {
:locals => { :name => name },
:ignore => true
}
# FIXME
gem = deserialize(name)
gems << gem
gem.name_spaces.each do |name_space|
proxy "#{link_for_code_object(name_space)}/index.html", "templates/gem_namespace.html", {
:locals => { :name_space => name_space, :code_object => name_space },
:ignore => true
}
end
end
data.store('gems', gems)