-
Notifications
You must be signed in to change notification settings - Fork 19
/
config.rb
105 lines (86 loc) · 2.76 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Layouts
require "lib/breaking_source.rb"
require "lib/breaking_image.rb"
require "lib/shared_layouts.rb"
# Tools for generating data
require "lib/navigation_helpers.rb"
require "lib/html_helpers.rb"
require 'lib/doc/code_objects'
set :encoding, 'utf-8'
set :relative_links, true
# Support for browsing from the build folder.
set :strip_index_file, false
configure :build do
activate :sprockets
activate :minify_javascript
activate :minify_css
activate :relative_assets
end
set :markdown, :tables => true, :autolink => true, :gh_blockcode => true, :fenced_code_blocks => true, :with_toc_data => true
set :markdown_engine, :redcarpet
activate :automatic_image_sizes
activate :rouge_syntax
activate :breaking_image
activate :breaking_source
activate :shared_layouts
helpers NavigationHelpers
helpers HTMLHelpers
configure :development do
activate :livereload
end
# Allow shared assets folder to not be in source, thereby not dragging in every asset
after_configuration do
sprockets.append_path "../shared/img"
sprockets.append_path "../shared/js"
sprockets.append_path "../shared/fonts"
sprockets.append_path "../shared/includes"
sprockets.append_path "../shared/sass"
end
navigation_data = {
'dsl' => [
{ :name => "podfile", :title => "Podfile Syntax Reference" },
{:name => "podspec", :title => "Podspec Syntax Reference"}
],
'gems' => %w[ CocoaPods CLAide cocoapods-downloader cocoapods-core Xcodeproj]
}
content_for :dsl_data do navigation_data * '<br>' end
# Dynamic pages for documentation, Pod, command line
navigation_data['dsl'].each do |dsl|
name = dsl[:name]
title = dsl[:title]
proxy "syntax/#{name}.html", "templates/dsl.html", {
:locals => { :name => name, :page_title => title, :fullwidth => true},
:ignore => true
}
end
proxy "terminal/commands.html", "templates/commands.html", {
:locals => { :name => 'commands', :page_title => "Command-line Reference" },
:ignore => true
}
data.store("site", "guides")
#
gems = []
navigation_data['gems'].each do |name|
proxy "#{parameterize name}/index.html", "templates/gem.html", {
:locals => { :name => name, :fullwidth => true },
:ignore => true
}
proxy "#{parameterize name}/name_spaces.html", "templates/gem_namespaces_list.html", {
:locals => { :name => name, :fullwidth => true},
: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)