jazzy 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +4 -3
  5. data/Rakefile +2 -4
  6. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/SourceKittenFramework +0 -0
  7. data/lib/jazzy/SourceKitten/{Commandant.framework → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework}/Commandant +0 -0
  8. data/lib/jazzy/SourceKitten/{Commandant.framework → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework}/Versions/A/Commandant +0 -0
  9. data/lib/jazzy/SourceKitten/{Commandant.framework → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework}/Versions/A/Resources/Info.plist +4 -4
  10. data/lib/jazzy/SourceKitten/{LlamaKit.framework/Versions/A → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework}/LlamaKit +0 -0
  11. data/lib/jazzy/SourceKitten/{LlamaKit.framework → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework/Versions/A}/LlamaKit +0 -0
  12. data/lib/jazzy/SourceKitten/{LlamaKit.framework → Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework}/Versions/A/Resources/Info.plist +4 -4
  13. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SWXMLHash.framework/SWXMLHash +0 -0
  14. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/Resources/Info.plist +4 -4
  15. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash +0 -0
  16. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SwiftXPC.framework/SwiftXPC +0 -0
  17. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/Resources/Info.plist +4 -4
  18. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/SwiftXPC +0 -0
  19. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftCore.dylib +0 -0
  20. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftCoreGraphics.dylib +0 -0
  21. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftDarwin.dylib +0 -0
  22. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftDispatch.dylib +0 -0
  23. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftFoundation.dylib +0 -0
  24. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftObjectiveC.dylib +0 -0
  25. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Frameworks/libswiftSecurity.dylib +0 -0
  26. data/lib/jazzy/SourceKitten/{SourceKittenFramework.framework → Frameworks/SourceKittenFramework.framework}/Versions/A/Resources/Info.plist +5 -5
  27. data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework +0 -0
  28. data/lib/jazzy/SourceKitten/Rakefile +1 -2
  29. data/lib/jazzy/SourceKitten/bin/sourcekitten +0 -0
  30. data/lib/jazzy/assets/css/jazzy.css.scss +1 -1
  31. data/lib/jazzy/config.rb +14 -1
  32. data/lib/jazzy/doc.rb +12 -12
  33. data/lib/jazzy/doc_builder.rb +2 -4
  34. data/lib/jazzy/gem_version.rb +1 -1
  35. data/lib/jazzy/jazzy_markdown.rb +15 -1
  36. data/lib/jazzy/source_declaration.rb +3 -0
  37. data/lib/jazzy/sourcekitten.rb +25 -4
  38. data/lib/jazzy/templates/doc.mustache +7 -0
  39. data/lib/jazzy/templates/footer.mustache +1 -1
  40. data/spec/integration_spec.rb +1 -1
  41. metadata +26 -26
  42. data/lib/jazzy/SourceKitten/SourceKittenFramework.framework/SourceKittenFramework +0 -0
  43. data/lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/SourceKittenFramework +0 -0
  44. data/lib/jazzy/SourceKitten/sourcekitten +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec769c8636609b8b4d6557633fe765929a0c6734
4
- data.tar.gz: b10db798f53a77bceed7800b3c474528371c381f
3
+ metadata.gz: bfdc8ff94daa57717cca49f094c0844e887966c7
4
+ data.tar.gz: 4476ebbceab1a7f423718385181b5d7c8ec6c9e3
5
5
  SHA512:
6
- metadata.gz: 3efe0871f0c10b0e06dcd62fcc535e72a4adfbd938bfd8268e720ada1b625dba34e7bb91d9f2ebe240465b93d2e7ffdc95061e883b67b8e7c52def23ab014352
7
- data.tar.gz: 998599ca369d570fb1e92132c6f96d10e5a031b48119a84d5c38cf393e8512e9b1c40b38d005a71dd8051652b549b73e713fae84e5f65b65e932f98ea80bbdec
6
+ metadata.gz: 07c5389be619f4e5739cb9afc114b423fa9dbad9217d47e91a5538aaa54c89eb0fd6d27b286812ace6ee82ca4873f01bc6c770cadf3e1231461741f112047be2
7
+ data.tar.gz: ed8b0bd4d88757e4eeda790f50debc4ff74356ff4812312991b78148462738b4692a469d2ad896adf35a8e8589faad95ddd831962ff5f59d715557d65a6e5ec5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 0.2.4
2
+
3
+ ##### Breaking
4
+
5
+ * None.
6
+
7
+ ##### Enhancements
8
+
9
+ * Improved how SourceKitten is vendored.
10
+ [JP Simard](https://github.com/jpsim)
11
+
12
+ * Show type declaration under its title.
13
+ [pcantrell](https://github.com/pcantrell)
14
+
15
+ * Added support for custom assets: pass `--assets-directory` to jazzy.
16
+ [gurkendoktor](https://github.com/gurkendoktor)
17
+
18
+ * Added support for custom copyright text: pass `--copyright` to jazzy.
19
+ [emaloney](https://github.com/emaloney)
20
+
21
+ ##### Bug Fixes
22
+
23
+ * Fixed a crash when parsing an empty documentation comment.
24
+ [JP Simard](https://github.com/jpsim)
25
+ [#236](https://github.com/realm/jazzy/issues/236)
26
+
27
+ * `--exclude` now works properly if its argument is a relative path.
28
+ [pcantrell](https://github.com/pcantrell)
29
+
30
+
1
31
  ## 0.2.3
2
32
 
3
33
  ##### Breaking
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.2.3)
4
+ jazzy (0.2.4)
5
5
  cocoapods (~> 0.38)
6
6
  mustache (~> 0.99)
7
7
  open4
data/README.md CHANGED
@@ -21,9 +21,10 @@ documentation, post WWDC 2014.
21
21
 
22
22
  ### Requirements
23
23
 
24
- * [Xcode 6.3][xcode], installed in `/Applications/Xcode.app`
25
- * `xcode-select -p` should print Xcode 6.3's path. If it doesn't, run
26
- `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer`
24
+ * A 6.x version of [Xcode][xcode] capable of building the Swift project
25
+ you wish to document, installed anywhere under `/Applications`.
26
+ Support for Xcode 7 betas is in progress (see
27
+ [#261](https://github.com/realm/jazzy/pull/261)).
27
28
 
28
29
  ### Installing
29
30
 
data/Rakefile CHANGED
@@ -85,12 +85,10 @@ begin
85
85
 
86
86
  destination = 'lib/jazzy/sourcekitten'
87
87
  rakefile = File.read("#{destination}/Rakefile")
88
- frameworks = Dir.glob('/tmp/SourceKitten.dst/Library/Frameworks/*')
89
- binary = '/tmp/SourceKitten.dst/usr/local/bin/sourcekitten'
88
+ source = '/tmp/SourceKitten.dst/usr/local/.'
90
89
  FileUtils.rm_rf destination
91
90
  FileUtils.mkdir_p destination
92
- FileUtils.cp_r frameworks, destination
93
- FileUtils.cp binary, destination
91
+ FileUtils.cp_r source, destination
94
92
  File.open("#{destination}/Rakefile", 'w') { |f| f.write rakefile }
95
93
  end
96
94
 
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>14D136</string>
6
+ <string>15A235d</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -25,7 +25,7 @@
25
25
  <key>DTCompiler</key>
26
26
  <string>com.apple.compilers.llvm.clang.1_0</string>
27
27
  <key>DTPlatformBuild</key>
28
- <string>6D1002</string>
28
+ <string>6E35b</string>
29
29
  <key>DTPlatformVersion</key>
30
30
  <string>GM</string>
31
31
  <key>DTSDKBuild</key>
@@ -33,9 +33,9 @@
33
33
  <key>DTSDKName</key>
34
34
  <string>macosx10.10</string>
35
35
  <key>DTXcode</key>
36
- <string>0631</string>
36
+ <string>0640</string>
37
37
  <key>DTXcodeBuild</key>
38
- <string>6D1002</string>
38
+ <string>6E35b</string>
39
39
  <key>NSHumanReadableCopyright</key>
40
40
  <string>Copyright © 2014 Carthage. All rights reserved.</string>
41
41
  </dict>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>14D136</string>
6
+ <string>15A235d</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -25,7 +25,7 @@
25
25
  <key>DTCompiler</key>
26
26
  <string>com.apple.compilers.llvm.clang.1_0</string>
27
27
  <key>DTPlatformBuild</key>
28
- <string>6D1002</string>
28
+ <string>6E35b</string>
29
29
  <key>DTPlatformVersion</key>
30
30
  <string>GM</string>
31
31
  <key>DTSDKBuild</key>
@@ -33,9 +33,9 @@
33
33
  <key>DTSDKName</key>
34
34
  <string>macosx10.10</string>
35
35
  <key>DTXcode</key>
36
- <string>0631</string>
36
+ <string>0640</string>
37
37
  <key>DTXcodeBuild</key>
38
- <string>6D1002</string>
38
+ <string>6E35b</string>
39
39
  <key>NSHumanReadableCopyright</key>
40
40
  <string>Copyright © 2014 Rob Napier. All rights reserved.</string>
41
41
  <key>UIDeviceFamily</key>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>14D136</string>
6
+ <string>15A235d</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -25,7 +25,7 @@
25
25
  <key>DTCompiler</key>
26
26
  <string>com.apple.compilers.llvm.clang.1_0</string>
27
27
  <key>DTPlatformBuild</key>
28
- <string>6D1002</string>
28
+ <string>6E35b</string>
29
29
  <key>DTPlatformVersion</key>
30
30
  <string>GM</string>
31
31
  <key>DTSDKBuild</key>
@@ -33,9 +33,9 @@
33
33
  <key>DTSDKName</key>
34
34
  <string>macosx10.10</string>
35
35
  <key>DTXcode</key>
36
- <string>0631</string>
36
+ <string>0640</string>
37
37
  <key>DTXcodeBuild</key>
38
- <string>6D1002</string>
38
+ <string>6E35b</string>
39
39
  <key>UIDeviceFamily</key>
40
40
  <array>
41
41
  <integer>1</integer>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>14D136</string>
6
+ <string>15A235d</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -25,7 +25,7 @@
25
25
  <key>DTCompiler</key>
26
26
  <string>com.apple.compilers.llvm.clang.1_0</string>
27
27
  <key>DTPlatformBuild</key>
28
- <string>6D1002</string>
28
+ <string>6E35b</string>
29
29
  <key>DTPlatformVersion</key>
30
30
  <string>GM</string>
31
31
  <key>DTSDKBuild</key>
@@ -33,9 +33,9 @@
33
33
  <key>DTSDKName</key>
34
34
  <string>macosx10.10</string>
35
35
  <key>DTXcode</key>
36
- <string>0631</string>
36
+ <string>0640</string>
37
37
  <key>DTXcodeBuild</key>
38
- <string>6D1002</string>
38
+ <string>6E35b</string>
39
39
  <key>NSHumanReadableCopyright</key>
40
40
  <string>Copyright © 2014 JP Simard. All rights reserved.</string>
41
41
  </dict>
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>14D136</string>
6
+ <string>15A235d</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -17,7 +17,7 @@
17
17
  <key>CFBundlePackageType</key>
18
18
  <string>FMWK</string>
19
19
  <key>CFBundleShortVersionString</key>
20
- <string>0.4.1</string>
20
+ <string>0.4.4</string>
21
21
  <key>CFBundleSignature</key>
22
22
  <string>????</string>
23
23
  <key>CFBundleVersion</key>
@@ -25,7 +25,7 @@
25
25
  <key>DTCompiler</key>
26
26
  <string>com.apple.compilers.llvm.clang.1_0</string>
27
27
  <key>DTPlatformBuild</key>
28
- <string>6D1002</string>
28
+ <string>6E35b</string>
29
29
  <key>DTPlatformVersion</key>
30
30
  <string>GM</string>
31
31
  <key>DTSDKBuild</key>
@@ -33,9 +33,9 @@
33
33
  <key>DTSDKName</key>
34
34
  <string>macosx10.10</string>
35
35
  <key>DTXcode</key>
36
- <string>0631</string>
36
+ <string>0640</string>
37
37
  <key>DTXcodeBuild</key>
38
- <string>6D1002</string>
38
+ <string>6E35b</string>
39
39
  <key>NSHumanReadableCopyright</key>
40
40
  <string>Copyright © 2015 SourceKitten. All rights reserved.</string>
41
41
  </dict>
@@ -2,7 +2,7 @@
2
2
  # when installed as a gem, as RubyGems doesn't play nice with symlinks.
3
3
 
4
4
  task :prepare do
5
- Dir.glob('*.framework').each do |fw|
5
+ Dir.glob('**/*.framework/').each do |fw|
6
6
  Dir.chdir(fw) do
7
7
  basename = File.basename(fw, '.framework')
8
8
  FileUtils.rm_f(basename)
@@ -10,7 +10,6 @@ task :prepare do
10
10
  File.symlink('A', 'Versions/Current')
11
11
  File.symlink("Versions/Current/#{basename}", "#{basename}")
12
12
  File.symlink('Versions/Current/Resources', 'Resources')
13
- File.symlink('Versions/Current/Modules', 'Modules')
14
13
  end
15
14
  end
16
15
  end
@@ -416,7 +416,7 @@ html.dash {
416
416
  width: $content_wrapper_width;
417
417
  margin-left: 0;
418
418
  border: none;
419
- width: auto;
419
+ width: 100%;
420
420
  top: 0;
421
421
  padding-bottom: 0;
422
422
  }
data/lib/jazzy/config.rb CHANGED
@@ -32,6 +32,8 @@ module Jazzy
32
32
  attr_accessor :excluded_files
33
33
  attr_accessor :template_directory
34
34
  attr_accessor :swift_version
35
+ attr_accessor :assets_directory
36
+ attr_accessor :copyright
35
37
 
36
38
  def initialize
37
39
  PodspecDocumenter.configure(self, Dir['*.podspec{,.json}'].first)
@@ -49,6 +51,7 @@ module Jazzy
49
51
  self.excluded_files = []
50
52
  self.template_directory = Pathname(__FILE__).parent + 'templates'
51
53
  self.swift_version = '1.2'
54
+ self.assets_directory = Pathname(__FILE__).parent + 'assets'
52
55
  end
53
56
 
54
57
  def podspec=(podspec)
@@ -180,6 +183,11 @@ module Jazzy
180
183
  config.swift_version = swift_version
181
184
  end
182
185
 
186
+ opt.on('--assets-directory DIRPATH', 'The directory that contains ' \
187
+ 'the assets (CSS, JS, images) to use') do |assets_directory|
188
+ config.assets_directory = Pathname(assets_directory)
189
+ end
190
+
183
191
  opt.on('--readme FILEPATH',
184
192
  'The path to a markdown README file') do |readme|
185
193
  config.readme_path = Pathname(readme)
@@ -187,7 +195,7 @@ module Jazzy
187
195
 
188
196
  opt.on('-e', '--exclude file1,file2,…fileN', Array,
189
197
  'Files to be excluded from documentation') do |files|
190
- config.excluded_files = files
198
+ config.excluded_files = files.map { |f| File.expand_path(f) }
191
199
  end
192
200
 
193
201
  opt.on('-v', '--version', 'Print version number') do
@@ -195,6 +203,11 @@ module Jazzy
195
203
  exit
196
204
  end
197
205
 
206
+ opt.on('--copyright COPYRIGHT_MARKDOWN', 'copyright markdown ' \
207
+ 'rendered at the bottom of the docs pages') do |copyright|
208
+ config.copyright = copyright
209
+ end
210
+
198
211
  opt.on('-h', '--help', 'Print this help message') do
199
212
  puts opt
200
213
  exit
data/lib/jazzy/doc.rb CHANGED
@@ -2,24 +2,24 @@ require 'date'
2
2
  require 'pathname'
3
3
  require 'mustache'
4
4
 
5
+ require 'jazzy/config'
5
6
  require 'jazzy/gem_version'
7
+ require 'jazzy/jazzy_markdown'
6
8
 
7
9
  module Jazzy
8
10
  class Doc < Mustache
9
11
  self.template_name = 'doc'
10
12
 
11
- def date
12
- # Fake date is used to keep integration tests consistent
13
- ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
14
- end
15
-
16
- def year
17
- # Fake date is used to keep integration tests consistent
18
- if ENV['JAZZY_FAKE_DATE']
19
- ENV['JAZZY_FAKE_DATE'][0..3]
20
- else
21
- DateTime.now.strftime('%Y')
22
- end
13
+ def copyright
14
+ config = Config.instance
15
+ copyright = config.copyright || (
16
+ # Fake date is used to keep integration tests consistent
17
+ date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
18
+ year = date[0..3]
19
+ "&copy; #{year} [#{config.author_name}](#{config.author_url}). " \
20
+ "All rights reserved. (Last updated: #{date})"
21
+ )
22
+ Jazzy.copyright_markdown.render(copyright).chomp
23
23
  end
24
24
 
25
25
  def jazzy_version
@@ -160,8 +160,7 @@ module Jazzy
160
160
  end
161
161
 
162
162
  def self.copy_assets(destination)
163
- origin = Pathname(__FILE__).parent + '../../lib/jazzy/assets/.'
164
- FileUtils.cp_r(origin, destination)
163
+ FileUtils.cp_r(Config.instance.assets_directory.children, destination)
165
164
  Pathname.glob(destination + 'css/**/*.scss').each do |scss|
166
165
  contents = scss.read
167
166
  css = Sass::Engine.new(contents, syntax: :scss).render
@@ -184,7 +183,6 @@ module Jazzy
184
183
  doc[:structure] = source_module.doc_structure
185
184
  doc[:module_name] = source_module.name
186
185
  doc[:author_name] = source_module.author_name
187
- doc[:author_website] = source_module.author_url.to_s
188
186
  doc[:github_url] = source_module.github_url.to_s
189
187
  doc[:dash_url] = source_module.dash_url
190
188
  doc[:path_to_root] = path_to_root
@@ -283,12 +281,12 @@ module Jazzy
283
281
  doc[:name] = doc_model.name
284
282
  doc[:kind] = doc_model.type.name
285
283
  doc[:dash_type] = doc_model.type.dash_type
284
+ doc[:declaration] = doc_model.declaration
286
285
  doc[:overview] = Jazzy.markdown.render(doc_model.overview)
287
286
  doc[:structure] = source_module.doc_structure
288
287
  doc[:tasks] = render_tasks(source_module, doc_model.children)
289
288
  doc[:module_name] = source_module.name
290
289
  doc[:author_name] = source_module.author_name
291
- doc[:author_website] = source_module.author_url.to_s
292
290
  doc[:github_url] = source_module.github_url.to_s
293
291
  doc[:dash_url] = source_module.dash_url
294
292
  doc[:path_to_root] = path_to_root
@@ -1,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.2.3' unless defined? Jazzy::VERSION
2
+ VERSION = '0.2.4' unless defined? Jazzy::VERSION
3
3
  end
@@ -31,6 +31,20 @@ module Jazzy
31
31
  end
32
32
 
33
33
  def self.markdown
34
- @markdown ||= Redcarpet::Markdown.new(JazzyHTML, JazzyHTML::OPTIONS)
34
+ @markdown ||= Redcarpet::Markdown.new(JazzyHTML, JazzyHTML::OPTIONS)
35
+ end
36
+
37
+ class JazzyCopyright < Redcarpet::Render::HTML
38
+ def link(link, _title, content)
39
+ %(<a class="link" href="#{link}" target="_blank" \
40
+ rel="external">#{content}</a>)
41
+ end
42
+ end
43
+
44
+ def self.copyright_markdown
45
+ @copyright_markdown ||= Redcarpet::Markdown.new(
46
+ JazzyCopyright,
47
+ JazzyHTML::OPTIONS,
48
+ )
35
49
  end
36
50
  end
@@ -3,7 +3,10 @@ require 'jazzy/source_declaration/type'
3
3
 
4
4
  module Jazzy
5
5
  class SourceDeclaration
6
+ # kind of declaration (e.g. class, variable, function)
6
7
  attr_accessor :type
8
+ # static type of declared element (e.g. String.Type -> ())
9
+ attr_accessor :typename
7
10
  attr_accessor :file
8
11
  attr_accessor :line
9
12
  attr_accessor :column
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
  require 'pathname'
3
+ require 'shellwords'
3
4
  require 'xcinvoke'
4
5
 
5
6
  require 'jazzy/config'
@@ -27,6 +28,7 @@ module Jazzy
27
28
  docs
28
29
  end
29
30
 
31
+ # rubocop:disable Metrics/MethodLength
30
32
  # Generate doc URL by prepending its parents URLs
31
33
  # @return [Hash] input docs with URLs
32
34
  def self.make_doc_urls(docs, parents)
@@ -39,15 +41,33 @@ module Jazzy
39
41
  else
40
42
  # Don't create HTML page for this doc if it doesn't have children
41
43
  # Instead, make its link a hash-link on its parent's page
42
- doc.url = parents.join('/') + '.html#/' + doc.usr
44
+ if doc.typename == '<<error type>>'
45
+ warn 'A compile error prevented ' +
46
+ (parents[1..-1] + [doc.name]).join('.') + ' from receiving a ' \
47
+ 'unique USR. Documentation may be incomplete. Please check for ' \
48
+ 'compile errors by running `xcodebuild ' \
49
+ "#{Config.instance.xcodebuild_arguments.shelljoin}`."
50
+ end
51
+ id = doc.usr
52
+ unless id
53
+ id = doc.name || 'unknown'
54
+ warn "`#{id}` has no USR. First make sure all modules used in " \
55
+ 'your project have been imported. If all used modules are ' \
56
+ 'imported, please report this problem by filing an issue at ' \
57
+ 'https://github.com/realm/jazzy/issues along with your Xcode ' \
58
+ 'project. If this token is declared in an `#if` block, please ' \
59
+ 'ignore this message.'
60
+ end
61
+ doc.url = parents.join('/') + '.html#/' + id
43
62
  end
44
63
  end
45
64
  end
65
+ # rubocop:enable Metrics/MethodLength
46
66
 
47
67
  # Run sourcekitten with given arguments and return STDOUT
48
68
  def self.run_sourcekitten(arguments)
49
69
  xcode = XCInvoke::Xcode.find_swift_version(Config.instance.swift_version)
50
- bin_path = Pathname(__FILE__).parent + 'SourceKitten/sourcekitten'
70
+ bin_path = Pathname(__FILE__).parent + 'SourceKitten/bin/sourcekitten'
51
71
  output, _ = Executable.execute_command(bin_path, arguments, true,
52
72
  env: xcode.as_env)
53
73
  output
@@ -100,8 +120,8 @@ module Jazzy
100
120
  doc[key].map do |p|
101
121
  if para = p['Para']
102
122
  Jazzy.markdown.render(para)
103
- elsif verbatim = p['Verbatim']
104
- Jazzy.markdown.render("```\n#{verbatim}```\n")
123
+ elsif code = p['Verbatim'] || p['CodeListing']
124
+ Jazzy.markdown.render("```\n#{code}```\n")
105
125
  else
106
126
  warn "Jazzy could not recognize the `#{p.keys.first}` tag. " \
107
127
  'Please report this by filing an issue at ' \
@@ -174,6 +194,7 @@ module Jazzy
174
194
  end
175
195
  declaration = SourceDeclaration.new
176
196
  declaration.type = SourceDeclaration::Type.new(doc['key.kind'])
197
+ declaration.typename = doc['key.typename']
177
198
  if declaration.type.mark? && doc['key.name'].start_with?('MARK: ')
178
199
  current_mark = SourceMark.new(doc['key.name'])
179
200
  end
@@ -27,6 +27,13 @@
27
27
  <section>
28
28
  <section class="section">
29
29
  {{^hide_name}}<h1>{{name}}</h1>{{/hide_name}}
30
+ {{#declaration}}
31
+ <div class="declaration">
32
+ <div class="Swift">
33
+ {{{declaration}}}
34
+ </div>
35
+ </div>
36
+ {{/declaration}}
30
37
  {{{overview}}}
31
38
  </section>
32
39
  {{> tasks}}
@@ -1,4 +1,4 @@
1
1
  <section id="footer">
2
- <p>&copy; {{year}} <a class="link" href="{{author_website}}" target="_blank" rel="external">{{author_name}}</a>. All rights reserved. (Last updated: {{date}})</p>
2
+ {{{copyright}}}
3
3
  <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v{{jazzy_version}}</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
4
4
  </section>
@@ -116,7 +116,7 @@ describe_cli 'jazzy' do
116
116
  '--root-url https://realm.io/docs/swift/' \
117
117
  "#{realm_version}/api/ " \
118
118
  '--xcodebuild-arguments ' \
119
- '"-project,RealmSwift.xcodeproj,-dry-run" '
119
+ '-project,RealmSwift.xcodeproj,-dry-run'
120
120
  end
121
121
 
122
122
  describe 'Creates docs for a podspec with dependencies and subspecs' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jazzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Simard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-07-31 00:00:00.000000000 Z
13
+ date: 2015-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cocoapods
@@ -175,30 +175,30 @@ files:
175
175
  - bin/jazzy
176
176
  - jazzy.gemspec
177
177
  - lib/jazzy.rb
178
- - lib/jazzy/SourceKitten/Commandant.framework/Commandant
179
- - lib/jazzy/SourceKitten/Commandant.framework/Versions/A/Commandant
180
- - lib/jazzy/SourceKitten/Commandant.framework/Versions/A/Resources/Info.plist
181
- - lib/jazzy/SourceKitten/LlamaKit.framework/LlamaKit
182
- - lib/jazzy/SourceKitten/LlamaKit.framework/Versions/A/LlamaKit
183
- - lib/jazzy/SourceKitten/LlamaKit.framework/Versions/A/Resources/Info.plist
178
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/SourceKittenFramework
179
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Commandant
180
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Commandant
181
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Resources/Info.plist
182
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework/LlamaKit
183
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework/Versions/A/LlamaKit
184
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/LlamaKit.framework/Versions/A/Resources/Info.plist
185
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/SWXMLHash
186
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/Resources/Info.plist
187
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash
188
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/SwiftXPC
189
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/Resources/Info.plist
190
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/SwiftXPC
191
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCore.dylib
192
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCoreGraphics.dylib
193
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib
194
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib
195
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib
196
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib
197
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftSecurity.dylib
198
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/Resources/Info.plist
199
+ - lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework
184
200
  - lib/jazzy/SourceKitten/Rakefile
185
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/SourceKittenFramework
186
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/SWXMLHash
187
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/Resources/Info.plist
188
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash
189
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/SwiftXPC
190
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/Resources/Info.plist
191
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework/Versions/A/SwiftXPC
192
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCore.dylib
193
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftCoreGraphics.dylib
194
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib
195
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib
196
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib
197
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib
198
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Frameworks/libswiftSecurity.dylib
199
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/Resources/Info.plist
200
- - lib/jazzy/SourceKitten/SourceKittenFramework.framework/Versions/A/SourceKittenFramework
201
- - lib/jazzy/SourceKitten/sourcekitten
201
+ - lib/jazzy/SourceKitten/bin/sourcekitten
202
202
  - lib/jazzy/assets/css/highlight.css.scss
203
203
  - lib/jazzy/assets/css/jazzy.css.scss
204
204
  - lib/jazzy/assets/img/carat.png
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  version: '0'
258
258
  requirements: []
259
259
  rubyforge_project:
260
- rubygems_version: 2.4.8
260
+ rubygems_version: 2.2.2
261
261
  signing_key:
262
262
  specification_version: 4
263
263
  summary: Soulful docs for Swift & Objective-C.
Binary file