jazzy 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.gitmodules +3 -0
  4. data/.rubocop.yml +67 -0
  5. data/.rubocop_todo.yml +16 -0
  6. data/.travis.yml +6 -0
  7. data/Gemfile +15 -7
  8. data/Gemfile.lock +62 -12
  9. data/LICENSE +0 -0
  10. data/README.md +39 -12
  11. data/Rakefile +87 -1
  12. data/bin/jazzy +10 -44
  13. data/bin/sourcekitten +0 -0
  14. data/jazzy.gemspec +16 -16
  15. data/lib/jazzy.rb +1 -159
  16. data/lib/jazzy/assets/css/jazzy.css +561 -0
  17. data/lib/{assets/Images/carat_2x.png → jazzy/assets/img/carat.png} +0 -0
  18. data/lib/jazzy/assets/img/dash.png +0 -0
  19. data/lib/jazzy/assets/img/gh.png +0 -0
  20. data/lib/jazzy/assets/js/jazzy.js +15 -0
  21. data/lib/jazzy/assets/js/jquery.min.js +4 -0
  22. data/lib/jazzy/config.rb +100 -0
  23. data/lib/jazzy/doc.mustache +46 -0
  24. data/lib/jazzy/doc.rb +23 -0
  25. data/lib/jazzy/doc_builder.rb +166 -0
  26. data/lib/jazzy/gem_version.rb +3 -0
  27. data/lib/jazzy/jazzy_markdown.rb +13 -0
  28. data/lib/jazzy/partials/footer.mustache +4 -0
  29. data/lib/jazzy/partials/nav.mustache +16 -0
  30. data/lib/jazzy/partials/parameter.mustache +12 -0
  31. data/lib/jazzy/partials/task.mustache +66 -0
  32. data/lib/jazzy/partials/tasks.mustache +7 -0
  33. data/lib/jazzy/source_declaration.rb +19 -0
  34. data/lib/jazzy/sourcekitten.rb +146 -0
  35. data/lib/jazzy/xml_helper.rb +15 -0
  36. data/screenshot.jpg +0 -0
  37. data/spec/.gitkeep +0 -0
  38. data/spec/integration_spec.rb +89 -0
  39. data/spec/integration_specs/document_alamofire/after/docs/Classes.html +266 -0
  40. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager.html +677 -0
  41. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/SessionDelegate.html +866 -0
  42. data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/Singleton.html +246 -0
  43. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request.html +1376 -0
  44. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/DataTaskDelegate.html +486 -0
  45. data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/TaskDelegate.html +506 -0
  46. data/spec/integration_specs/document_alamofire/after/docs/Enums.html +266 -0
  47. data/spec/integration_specs/document_alamofire/after/docs/Enums/ParameterEncoding.html +391 -0
  48. data/spec/integration_specs/document_alamofire/after/docs/Extensions.html +641 -0
  49. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Manager.html +376 -0
  50. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURL.html +226 -0
  51. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLComponents.html +226 -0
  52. data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLRequest.html +226 -0
  53. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request.html +377 -0
  54. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/DownloadTaskDelegate.html +406 -0
  55. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/MIMEType.html +286 -0
  56. data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/UploadTaskDelegate.html +266 -0
  57. data/spec/integration_specs/document_alamofire/after/docs/Extensions/String.html +226 -0
  58. data/spec/integration_specs/document_alamofire/after/docs/Functions.html +1001 -0
  59. data/spec/integration_specs/document_alamofire/after/docs/Global Variables.html +236 -0
  60. data/spec/integration_specs/document_alamofire/after/docs/Protocols.html +266 -0
  61. data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLRequestConvertible.html +236 -0
  62. data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLStringConvertible.html +236 -0
  63. data/spec/integration_specs/document_alamofire/after/docs/Typealiases.html +266 -0
  64. data/spec/integration_specs/document_alamofire/after/docs/css/jazzy.css +561 -0
  65. data/spec/integration_specs/document_alamofire/after/docs/img/carat.png +0 -0
  66. data/spec/integration_specs/document_alamofire/after/docs/img/dash.png +0 -0
  67. data/spec/integration_specs/document_alamofire/after/docs/img/gh.png +0 -0
  68. data/spec/integration_specs/document_alamofire/after/docs/index.html +194 -0
  69. data/spec/integration_specs/document_alamofire/after/docs/js/jazzy.js +15 -0
  70. data/spec/integration_specs/document_alamofire/after/docs/js/jquery.min.js +4 -0
  71. data/spec/integration_specs/document_alamofire/after/execution_output.txt +2 -0
  72. data/spec/integration_specs/misc_jazzy_features/after/docs/Classes.html +317 -0
  73. data/spec/integration_specs/misc_jazzy_features/after/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
  74. data/spec/integration_specs/misc_jazzy_features/after/docs/Enums.html +155 -0
  75. data/spec/integration_specs/misc_jazzy_features/after/docs/Enums/DocumentedEnum.html +128 -0
  76. data/spec/integration_specs/misc_jazzy_features/after/docs/Global Variables.html +138 -0
  77. data/spec/integration_specs/misc_jazzy_features/after/docs/css/jazzy.css +561 -0
  78. data/spec/integration_specs/misc_jazzy_features/after/docs/img/carat.png +0 -0
  79. data/spec/integration_specs/misc_jazzy_features/after/docs/img/dash.png +0 -0
  80. data/spec/integration_specs/misc_jazzy_features/after/docs/img/gh.png +0 -0
  81. data/spec/integration_specs/misc_jazzy_features/after/docs/index.html +99 -0
  82. data/spec/integration_specs/misc_jazzy_features/after/docs/js/jazzy.js +15 -0
  83. data/spec/integration_specs/misc_jazzy_features/after/docs/js/jquery.min.js +4 -0
  84. data/spec/integration_specs/misc_jazzy_features/after/execution_output.txt +2 -0
  85. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj/project.pbxproj +293 -0
  86. data/{parser/ASTDump.xcodeproj → spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj}/project.xcworkspace/contents.xcworkspacedata +1 -1
  87. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Classes.swift +60 -0
  88. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Info.plist +28 -0
  89. data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/MiscJazzyFeatures.h +10 -0
  90. data/spec/integration_specs/misc_jazzy_features/before/docs/Classes.html +317 -0
  91. data/spec/integration_specs/misc_jazzy_features/before/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
  92. data/spec/integration_specs/misc_jazzy_features/before/docs/Enums.html +155 -0
  93. data/spec/integration_specs/misc_jazzy_features/before/docs/Enums/DocumentedEnum.html +128 -0
  94. data/spec/integration_specs/misc_jazzy_features/before/docs/Global Variables.html +138 -0
  95. data/spec/integration_specs/misc_jazzy_features/before/docs/css/jazzy.css +561 -0
  96. data/spec/integration_specs/misc_jazzy_features/before/docs/img/carat.png +0 -0
  97. data/spec/integration_specs/misc_jazzy_features/before/docs/img/dash.png +0 -0
  98. data/spec/integration_specs/misc_jazzy_features/before/docs/img/gh.png +0 -0
  99. data/spec/integration_specs/misc_jazzy_features/before/docs/index.html +99 -0
  100. data/spec/integration_specs/misc_jazzy_features/before/docs/js/jazzy.js +15 -0
  101. data/spec/integration_specs/misc_jazzy_features/before/docs/js/jquery.min.js +4 -0
  102. metadata +112 -76
  103. data/DEV_README.md +0 -35
  104. data/bin/ASTDump +0 -0
  105. data/bin/generate_swift_header.sh +0 -14
  106. data/lib/assets/CSS/style-1.1.15.css +0 -3366
  107. data/lib/assets/Images/apple2.png +0 -0
  108. data/lib/assets/Images/check.png +0 -0
  109. data/lib/assets/Images/class_node_parent_and_child_2x.png +0 -0
  110. data/lib/assets/Images/class_node_subclass_last_child_2x.png +0 -0
  111. data/lib/assets/Images/class_node_subclass_with_siblings_2x.png +0 -0
  112. data/lib/assets/Images/closebox_2x.png +0 -0
  113. data/lib/assets/Images/collection_last_child_2x.png +0 -0
  114. data/lib/assets/Images/collection_last_child_orphan_grandparent_2x.png +0 -0
  115. data/lib/assets/Images/collection_last_child_orphan_parent_2x.png +0 -0
  116. data/lib/assets/Images/collection_last_child_orphan_parent_and_grandparent_2x.png +0 -0
  117. data/lib/assets/Images/collection_node_2x.png +0 -0
  118. data/lib/assets/Images/collection_node_orphan_grandparent_2x.png +0 -0
  119. data/lib/assets/Images/collection_node_orphan_parent_2x.png +0 -0
  120. data/lib/assets/Images/collection_node_orphan_parent_and_grandparent_2x.png +0 -0
  121. data/lib/assets/Images/collection_node_parent_2x.png +0 -0
  122. data/lib/assets/Images/collection_node_parent_last_child_orphan_parent_2x.png +0 -0
  123. data/lib/assets/Images/collection_node_parent_orphan_parent_2x.png +0 -0
  124. data/lib/assets/Images/collection_parent_last_child_2x.png +0 -0
  125. data/lib/assets/Images/download_2x.png +0 -0
  126. data/lib/assets/Images/left_arrow_2x.png +0 -0
  127. data/lib/assets/Images/magnify_2x.png +0 -0
  128. data/lib/assets/Images/minus_2x.png +0 -0
  129. data/lib/assets/Images/playbutton.svg +0 -15
  130. data/lib/assets/Images/plus_2x.png +0 -0
  131. data/lib/assets/Images/right_arrow_2x.png +0 -0
  132. data/lib/assets/Images/search_2x.png +0 -0
  133. data/lib/assets/Images/shortstack_2x.png +0 -0
  134. data/lib/assets/JavaScript/devpubs-1.1.15.js +0 -1293
  135. data/lib/jazzy/jazzhtml.rb +0 -7
  136. data/lib/jazzy/klass.mustache +0 -150
  137. data/lib/jazzy/klass.rb +0 -23
  138. data/lib/jazzy/partials/klass-method.mustache +0 -70
  139. data/lib/jazzy/partials/klass-overview.mustache +0 -6
  140. data/lib/jazzy/partials/klass-property.mustache +0 -41
  141. data/parser/ASTDump.xcodeproj/project.pbxproj +0 -301
  142. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcshareddata/ASTDump.xccheckout +0 -41
  143. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcuserdata/ta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  144. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/ASTDump.xcscheme +0 -86
  145. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/xcschememanagement.plist +0 -22
  146. data/parser/ASTDump/main.cpp +0 -71
  147. data/parser/clang-c/BuildSystem.h +0 -148
  148. data/parser/clang-c/CXCompilationDatabase.h +0 -170
  149. data/parser/clang-c/CXErrorCode.h +0 -64
  150. data/parser/clang-c/CXString.h +0 -61
  151. data/parser/clang-c/Documentation.h +0 -554
  152. data/parser/clang-c/Index.h +0 -5454
  153. data/parser/clang-c/Platform.h +0 -45
  154. data/sample/JAZMusician.h +0 -38
  155. data/sample/JAZMusician.m +0 -19
  156. data/sample/Musician.swift +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4693be658ce9c28ddc98fdc398e26db8bc48d5c8
4
- data.tar.gz: 2fd530bafb0099d145e8c07c2c34580f086aa79f
3
+ metadata.gz: e7a74dd62098862210aed5673baf188f364fbbaf
4
+ data.tar.gz: cc9531b73dfbdc5e02fd5f5489d9f81476a82394
5
5
  SHA512:
6
- metadata.gz: ad9e58a8fd88262f1671ecd3394a970cd1d3a52f4a0b66798f64f0f77a715cae87702cea614ffc6bff235a026004d243bc699e1e33a9c7405a53040aaba29e0e
7
- data.tar.gz: ee54d025fafa17e307eb2b2a9de639cc866a70ef799ce8ba1134130a93044c7d08c1ecd0a77504227f027e1e5b7327c2685be9ad363f7b91e5f4aa270c3ec216
6
+ metadata.gz: 725b86b39d1436252112d7c48ed599399dada85f77c0236e457c79cc0e6b10ea0fd1516b9b4a9ffebd171400e97279c2d64da402f344ad7334febdb8822e71fe
7
+ data.tar.gz: 2745f2aca3ce22c1ff821140736f10d7712b99ac996190ddd0545483140a4210e6f52befa84e84d2c74cb79044c00963f0ff3c71db491b38ba69e1f8793dbd8a
data/.gitignore CHANGED
@@ -1,5 +1,5 @@
1
1
  jazzy-docs/
2
- docs/
2
+ /docs/
3
3
 
4
4
  *.gem
5
5
  *.rbc
@@ -56,4 +56,4 @@ Icon
56
56
  .AppleDesktop
57
57
  Network Trash Folder
58
58
  Temporary Items
59
- .apdisk
59
+ .apdisk
@@ -0,0 +1,3 @@
1
+ [submodule "spec/integration_specs/document_alamofire/before"]
2
+ path = spec/integration_specs/document_alamofire/before
3
+ url = https://github.com/Alamofire/Alamofire
@@ -0,0 +1,67 @@
1
+ inherit_from:
2
+ - .rubocop_todo.yml
3
+
4
+ AllCops:
5
+ Include:
6
+ - ./Rakefile
7
+ - ./Gemfile
8
+ - ./*.gemspec
9
+
10
+ # At the moment not ready to be used
11
+ # https://github.com/bbatsov/rubocop/issues/947
12
+ Documentation:
13
+ Enabled: false
14
+
15
+ #- Jazzy -----------------------------------------------------------------#
16
+
17
+ # We adopted raise instead of fail.
18
+ SignalException:
19
+ EnforcedStyle: only_raise
20
+
21
+ # They are idiomatic
22
+ AssignmentInCondition:
23
+ Enabled: false
24
+
25
+ # Allow backticks
26
+ AsciiComments:
27
+ Enabled: false
28
+
29
+ # Indentation clarifies logic branches in implementations
30
+ IfUnlessModifier:
31
+ Enabled: false
32
+
33
+ # No enforced convention here.
34
+ SingleLineBlockParams:
35
+ Enabled: false
36
+
37
+ # We only add the comment when needed.
38
+ Encoding:
39
+ Enabled: false
40
+
41
+ # Having these make it easier to *not* forget to add one when adding a new
42
+ # value and you can simply copy the previous line.
43
+ TrailingComma:
44
+ EnforcedStyleForMultiline: comma
45
+
46
+ Style/SpecialGlobalVars:
47
+ Enabled: false
48
+
49
+ #- Jazzy specs -----------------------------------------------------------#
50
+
51
+ # Allow for `should.match /regexp/`.
52
+ AmbiguousRegexpLiteral:
53
+ Exclude:
54
+ - spec/**/*
55
+
56
+ # Allow `object.should == object` syntax.
57
+ Void:
58
+ Exclude:
59
+ - spec/**/*
60
+
61
+ ClassAndModuleChildren:
62
+ Exclude:
63
+ - spec/**/*
64
+
65
+ UselessComparison:
66
+ Exclude:
67
+ - spec/**/*
@@ -0,0 +1,16 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-10-27 13:52:00 -0700 using RuboCop version 0.26.1.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 19
9
+ # Configuration parameters: AllowURI, URISchemes.
10
+ Metrics/LineLength:
11
+ Max: 151
12
+
13
+ # Offense count: 7
14
+ # Configuration parameters: CountComments.
15
+ Metrics/MethodLength:
16
+ Max: 50
@@ -0,0 +1,6 @@
1
+ os:
2
+ - osx
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - system
data/Gemfile CHANGED
@@ -1,11 +1,19 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
2
4
 
3
5
  group :development do
4
- gem "mustache", "~> 0.99.5"
5
- gem "activesupport", "~> 4.1.1"
6
- gem "redcarpet", "~> 3.1.2"
7
- gem "nokogiri", "~> 1.6.2.1"
6
+ # Code style
7
+ gem 'rubocop'
8
+
9
+ # Tests
10
+ gem 'bacon'
11
+ gem 'mocha'
12
+ gem 'mocha-on-bacon'
13
+ gem 'prettybacon'
14
+ gem 'webmock'
8
15
 
9
- gem "bundler", "~> 1.5"
10
- gem "rake"
16
+ # Integration tests
17
+ gem 'diffy'
18
+ gem 'clintegracon'
11
19
  end
@@ -1,32 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jazzy (0.0.6)
5
+ activesupport (~> 4.1)
6
+ mustache (~> 0.99)
7
+ nokogiri (~> 1.6)
8
+ redcarpet (~> 3.2)
9
+
1
10
  GEM
2
11
  remote: http://rubygems.org/
3
12
  specs:
4
- activesupport (4.1.4)
13
+ activesupport (4.1.6)
5
14
  i18n (~> 0.6, >= 0.6.9)
6
15
  json (~> 1.7, >= 1.7.7)
7
16
  minitest (~> 5.1)
8
17
  thread_safe (~> 0.1)
9
18
  tzinfo (~> 1.1)
19
+ addressable (2.3.6)
20
+ ast (2.0.0)
21
+ astrolabe (1.3.0)
22
+ parser (>= 2.2.0.pre.3, < 3.0)
23
+ bacon (1.2.0)
24
+ clintegracon (0.5.3)
25
+ colored (~> 1.2)
26
+ diffy
27
+ colored (1.2)
28
+ crack (0.4.2)
29
+ safe_yaml (~> 1.0.0)
30
+ diffy (3.0.7)
10
31
  i18n (0.6.9)
11
32
  json (1.8.1)
33
+ metaclass (0.0.4)
12
34
  mini_portile (0.6.0)
13
- minitest (5.3.5)
14
- mustache (0.99.5)
15
- nokogiri (1.6.2.1)
35
+ minitest (5.4.2)
36
+ mocha (1.1.0)
37
+ metaclass (~> 0.0.1)
38
+ mocha-on-bacon (0.2.2)
39
+ mocha (>= 0.13.0)
40
+ mustache (0.99.7)
41
+ nokogiri (1.6.3.1)
16
42
  mini_portile (= 0.6.0)
43
+ parser (2.2.0.pre.5)
44
+ ast (>= 1.1, < 3.0)
45
+ slop (~> 3.4, >= 3.4.5)
46
+ powerpack (0.0.9)
47
+ prettybacon (0.0.2)
48
+ bacon (~> 1.2)
49
+ rainbow (2.0.0)
17
50
  rake (10.3.2)
18
- redcarpet (3.1.2)
51
+ redcarpet (3.2.0)
52
+ rubocop (0.26.1)
53
+ astrolabe (~> 1.3)
54
+ parser (>= 2.2.0.pre.4, < 3.0)
55
+ powerpack (~> 0.0.6)
56
+ rainbow (>= 1.99.1, < 3.0)
57
+ ruby-progressbar (~> 1.4)
58
+ ruby-progressbar (1.6.0)
59
+ safe_yaml (1.0.4)
60
+ slop (3.6.0)
19
61
  thread_safe (0.3.4)
20
- tzinfo (1.2.1)
62
+ tzinfo (1.2.2)
21
63
  thread_safe (~> 0.1)
64
+ webmock (1.20.0)
65
+ addressable (>= 2.3.6)
66
+ crack (>= 0.3.2)
22
67
 
23
68
  PLATFORMS
24
69
  ruby
25
70
 
26
71
  DEPENDENCIES
27
- activesupport (~> 4.1.1)
28
- bundler (~> 1.5)
29
- mustache (~> 0.99.5)
30
- nokogiri (~> 1.6.2.1)
31
- rake
32
- redcarpet (~> 3.1.2)
72
+ bacon
73
+ bundler (~> 1.7)
74
+ clintegracon
75
+ diffy
76
+ jazzy!
77
+ mocha
78
+ mocha-on-bacon
79
+ prettybacon
80
+ rake (~> 10.3)
81
+ rubocop
82
+ webmock
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -1,18 +1,27 @@
1
1
  ## jazzy <sup>♪♫</sup>
2
- **a soulful way to generate docs for Swift & Objective-C** ![analytics](https://ga-beacon.appspot.com/UA-50247013-2/jazzy/README?pixel)
2
+ **a soulful way to generate docs for Swift & Objective-C**
3
+ ![analytics](https://ga-beacon.appspot.com/UA-50247013-2/jazzy/README?pixel)
3
4
 
4
- jazzy is a command-line utility that generates documentation for your Swift or Objective-C projects.
5
+ jazzy is a command-line utility that generates documentation for your Swift or
6
+ Objective-C projects.
5
7
 
6
- Instead of parsing your source files, jazzy hooks into clang and uses the [AST][ast] representation of your code and its comments for more accurate results.
8
+ Only Swift projects are currently supported, but Objective-C support is coming
9
+ soon!
7
10
 
8
- jazzy’s output matches the look & feel of Apple’s official reference documentation, post WWDC 2014.
11
+ Instead of parsing your source files, jazzy hooks into [Clang][clang] and
12
+ [SourceKit][sourcekit] to use the [AST][ast] representation of your code and
13
+ its comments for more accurate results.
14
+
15
+ jazzy’s output matches the look & feel of Apple’s official reference
16
+ documentation, post WWDC 2014.
9
17
 
10
18
  ![Screenshot](screenshot.jpg)
11
19
 
12
20
  ### Requirements
13
21
 
14
- * [Xcode 6 (Beta 2)](https://developer.apple.com/xcode)
15
- * `xcode-select -p` should print Xcode 6's path. If it doesn't, run `sudo xcode-select -s /Applications/Xcode6-Beta2.app/Contents/Developer`
22
+ * [Xcode 6.1][xcode], installed in `/Applications/Xcode.app`
23
+ * `xcode-select -p` should print Xcode 6.1's path. If it doesn't, run
24
+ `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer`
16
25
 
17
26
  ### Installing
18
27
 
@@ -20,21 +29,39 @@ To install jazzy, run `[sudo] gem install jazzy` from your command line.
20
29
 
21
30
  ### Usage
22
31
 
23
- Run `jazzy` from your command line. Run `jazzy -h` for a list of additional options.
32
+ Run `jazzy` from your command line. Run `jazzy -h` for a list of additional
33
+ options.
34
+
35
+ ### Development
36
+
37
+ jazzy is composed of two parts: the parser ([sourcekitten][sourcekitten],
38
+ written in Swift) and the site generator (written in ruby).
39
+
40
+ To build and run jazzy from source, you'll first need [bundler][bundler]. Once
41
+ bundler is installed, run `bundle install` from the root of this repo. At this
42
+ point, run jazzy from source by running `bin/jazzy`.
43
+
44
+ Instructions to build sourcekitten from source can be found at
45
+ [sourcekitten's GitHub repository][sourcekitten].
24
46
 
25
47
  ### Design Goals
26
48
 
27
49
  jazzy's main design goals are:
28
50
 
29
51
  - Generate source code docs matching Apple's official reference documentation
30
- - Support for Xcode and Dash docsets
31
- - High readability of source code comments
32
- - Leverage modern HTML templating ([Mustache](http://mustache.github.io))
33
- - Leverage the power and accuracy of the [Clang AST][ast]
34
- - Compatibility with [appledoc](https://github.com/tomaz/appledoc) when possible
52
+ - Support for standard Objective-C and Swift documentation comment syntax
53
+ - Leverage modern HTML templating ([Mustache][mustache])
54
+ - Leverage the power and accuracy of the [Clang AST][ast] and [SourceKit][sourcekit]
55
+ - Support for Xcode and Dash docsets (*work in progress*)
56
+ - Support Swift, Objective-C or mixed projects (*work in progress*)
35
57
 
36
58
  ### License
37
59
 
38
60
  This project is under the MIT license.
39
61
 
62
+ [clang]: http://clang.llvm.org "Clang"
63
+ [sourcekit]: http://www.jpsim.com/uncovering-sourcekit "Uncovering SourceKit"
40
64
  [ast]: http://clang.llvm.org/docs/IntroductionToTheClangAST.html "Introduction To The Clang AST"
65
+ [xcode]: https://developer.apple.com/xcode "Xcode"
66
+ [bundler]: http://rubygems.org/gems/bundler
67
+ [mustache]: http://mustache.github.io "Mustache"
data/Rakefile CHANGED
@@ -1 +1,87 @@
1
- require "bundler/gem_tasks"
1
+ #-- Bootstrap --------------------------------------------------------------#
2
+
3
+ desc 'Initializes your working copy to run the specs'
4
+ task :bootstrap do
5
+ if system('which bundle')
6
+ title 'Installing gems'
7
+ sh 'bundle install'
8
+ else
9
+ $stderr.puts "\033[0;31m" \
10
+ "[!] Please install the bundler gem manually:\n" \
11
+ ' $ [sudo] gem install bundler' \
12
+ "\e[0m"
13
+ exit 1
14
+ end
15
+ end
16
+
17
+ begin
18
+ require 'bundler/gem_tasks'
19
+
20
+ task default: :spec
21
+
22
+ #-- Specs ------------------------------------------------------------------#
23
+
24
+ desc 'Run specs'
25
+ task :spec do
26
+ title 'Running Unit Tests'
27
+ files = FileList['spec/**/*_spec.rb'].shuffle.join(' ')
28
+ sh "bundle exec bacon #{files}"
29
+
30
+ Rake::Task['rubocop'].invoke
31
+ end
32
+
33
+ desc 'Rebuilds integration fixtures'
34
+ task :rebuild_integration_fixtures do
35
+ title 'Running Integration tests'
36
+ sh 'rm -rf spec/integration_specs/tmp'
37
+ puts `bundle exec bacon spec/integration_spec.rb`
38
+
39
+ title 'Storing fixtures'
40
+ # Copy the files to the files produced by the specs to the after folders
41
+ FileList['tmp/*'].each do |source|
42
+ destination = "spec/integration_specs/#{source.gsub('tmp/', '')}/after"
43
+ if File.exist?(destination)
44
+ sh "rm -rf #{destination}"
45
+ sh "mv #{source} #{destination}"
46
+ end
47
+ end
48
+
49
+ # Remove files not used for the comparison
50
+ # To keep the git diff clean
51
+ files_to_delete = FileList['spec/integration_specs/*/after/{*,.git,.gitignore}']
52
+ .exclude('spec/integration_specs/*/after/docs', 'spec/integration_specs/*/after/execution_output.txt')
53
+ files_to_delete.each do |file_to_delete|
54
+ sh "rm -rf '#{file_to_delete}'"
55
+ end
56
+
57
+ puts
58
+ puts 'Integration fixtures updated, see `spec/integration_specs`'
59
+ end
60
+
61
+ #-- RuboCop ----------------------------------------------------------------#
62
+
63
+ require 'rubocop/rake_task'
64
+ RuboCop::RakeTask.new(:rubocop) do |task|
65
+ task.patterns = %w(lib spec Rakefile Gemfile jazzy.gemspec)
66
+ end
67
+
68
+ rescue LoadError, NameError
69
+ $stderr.puts "\033[0;31m" \
70
+ '[!] Some Rake tasks haven been disabled because the environment' \
71
+ ' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
72
+ "\e[0m"
73
+ $stderr.puts e.message
74
+ $stderr.puts e.backtrace
75
+ $stderr.puts
76
+ end
77
+
78
+ #-- Helpers ------------------------------------------------------------------#
79
+
80
+ def title(title)
81
+ cyan_title = "\033[0;36m#{title}\033[0m"
82
+ puts
83
+ puts '-' * 80
84
+ puts cyan_title
85
+ puts '-' * 80
86
+ puts
87
+ end
data/bin/jazzy CHANGED
@@ -1,49 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
- require 'jazzy'
3
- require 'find'
4
- require 'fileutils'
5
- require 'optparse'
6
-
7
- options = {
8
- input: File.expand_path('.'),
9
- output: File.expand_path('docs'),
10
- excludes: []
11
- }
12
-
13
- opt_parser = OptionParser.new do |opt|
14
- opt.banner = "Usage: jazzy [-i input] [-o output]"
15
- opt.separator ""
16
- opt.separator "Options"
17
-
18
- opt.on("-i","--input FOLDER","Folder to recursively search for header files") do |input|
19
- options[:input] = File.expand_path(input)
20
- end
21
-
22
- opt.on("-o","--output FOLDER","Folder to output the HTML docs to") do |output|
23
- options[:output] = File.expand_path(output)
24
- end
25
-
26
- opt.on("-e", "--exclude filepath1,filepath2,…filepathN", Array, "Exclude specific files") do |e|
27
- options[:excludes] = e # path will be expanded after we’re sure the input has been stored
28
- end
29
2
 
30
- opt.on("-h","--help","help") do
31
- puts opt_parser
32
- end
3
+ if $PROGRAM_NAME == __FILE__ && !ENV['JAZZY_NO_BUNDLER']
4
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
5
+ require 'rubygems'
6
+ require 'bundler/setup'
7
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
8
+ elsif ENV['JAZZY_NO_BUNDLER']
9
+ require 'rubygems'
10
+ gem 'jazzy'
33
11
  end
34
12
 
35
- opt_parser.parse!
36
-
37
- options[:excludes] = options[:excludes].map { |p| File.expand_path(File.join(options[:input], p)) }
38
-
39
- paths = Jazzy.headers(options[:input]) - options[:excludes]
40
-
41
- FileUtils.rm_r options[:output] if File.directory?(options[:output]); Dir.mkdir options[:output]
42
-
43
- paths.each do |path|
44
- doc = Jazzy.document(path)
45
- path = File.join(options[:output], path.scan(/\/(\w+)\.h$/)[0][0]+'.html')
46
- File.open(path, 'w') { |file| file.write(doc) }
47
- end
13
+ require 'jazzy'
48
14
 
49
- Jazzy.assets(options[:output])
15
+ Jazzy::DocBuilder.build(Jazzy::Config.parse!)