jazzy 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.gitmodules +3 -0
- data/.rubocop.yml +67 -0
- data/.rubocop_todo.yml +16 -0
- data/.travis.yml +6 -0
- data/Gemfile +15 -7
- data/Gemfile.lock +62 -12
- data/LICENSE +0 -0
- data/README.md +39 -12
- data/Rakefile +87 -1
- data/bin/jazzy +10 -44
- data/bin/sourcekitten +0 -0
- data/jazzy.gemspec +16 -16
- data/lib/jazzy.rb +1 -159
- data/lib/jazzy/assets/css/jazzy.css +561 -0
- data/lib/{assets/Images/carat_2x.png → jazzy/assets/img/carat.png} +0 -0
- data/lib/jazzy/assets/img/dash.png +0 -0
- data/lib/jazzy/assets/img/gh.png +0 -0
- data/lib/jazzy/assets/js/jazzy.js +15 -0
- data/lib/jazzy/assets/js/jquery.min.js +4 -0
- data/lib/jazzy/config.rb +100 -0
- data/lib/jazzy/doc.mustache +46 -0
- data/lib/jazzy/doc.rb +23 -0
- data/lib/jazzy/doc_builder.rb +166 -0
- data/lib/jazzy/gem_version.rb +3 -0
- data/lib/jazzy/jazzy_markdown.rb +13 -0
- data/lib/jazzy/partials/footer.mustache +4 -0
- data/lib/jazzy/partials/nav.mustache +16 -0
- data/lib/jazzy/partials/parameter.mustache +12 -0
- data/lib/jazzy/partials/task.mustache +66 -0
- data/lib/jazzy/partials/tasks.mustache +7 -0
- data/lib/jazzy/source_declaration.rb +19 -0
- data/lib/jazzy/sourcekitten.rb +146 -0
- data/lib/jazzy/xml_helper.rb +15 -0
- data/screenshot.jpg +0 -0
- data/spec/.gitkeep +0 -0
- data/spec/integration_spec.rb +89 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes.html +266 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager.html +677 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/SessionDelegate.html +866 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Manager/Singleton.html +246 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Request.html +1376 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/DataTaskDelegate.html +486 -0
- data/spec/integration_specs/document_alamofire/after/docs/Classes/Request/TaskDelegate.html +506 -0
- data/spec/integration_specs/document_alamofire/after/docs/Enums.html +266 -0
- data/spec/integration_specs/document_alamofire/after/docs/Enums/ParameterEncoding.html +391 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions.html +641 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/Manager.html +376 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURL.html +226 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLComponents.html +226 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/NSURLRequest.html +226 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request.html +377 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/DownloadTaskDelegate.html +406 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/MIMEType.html +286 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/Request/UploadTaskDelegate.html +266 -0
- data/spec/integration_specs/document_alamofire/after/docs/Extensions/String.html +226 -0
- data/spec/integration_specs/document_alamofire/after/docs/Functions.html +1001 -0
- data/spec/integration_specs/document_alamofire/after/docs/Global Variables.html +236 -0
- data/spec/integration_specs/document_alamofire/after/docs/Protocols.html +266 -0
- data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLRequestConvertible.html +236 -0
- data/spec/integration_specs/document_alamofire/after/docs/Protocols/URLStringConvertible.html +236 -0
- data/spec/integration_specs/document_alamofire/after/docs/Typealiases.html +266 -0
- data/spec/integration_specs/document_alamofire/after/docs/css/jazzy.css +561 -0
- data/spec/integration_specs/document_alamofire/after/docs/img/carat.png +0 -0
- data/spec/integration_specs/document_alamofire/after/docs/img/dash.png +0 -0
- data/spec/integration_specs/document_alamofire/after/docs/img/gh.png +0 -0
- data/spec/integration_specs/document_alamofire/after/docs/index.html +194 -0
- data/spec/integration_specs/document_alamofire/after/docs/js/jazzy.js +15 -0
- data/spec/integration_specs/document_alamofire/after/docs/js/jquery.min.js +4 -0
- data/spec/integration_specs/document_alamofire/after/execution_output.txt +2 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/Classes.html +317 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/Enums.html +155 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/Enums/DocumentedEnum.html +128 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/Global Variables.html +138 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/css/jazzy.css +561 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/img/carat.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/img/dash.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/img/gh.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/index.html +99 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/js/jazzy.js +15 -0
- data/spec/integration_specs/misc_jazzy_features/after/docs/js/jquery.min.js +4 -0
- data/spec/integration_specs/misc_jazzy_features/after/execution_output.txt +2 -0
- data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj/project.pbxproj +293 -0
- data/{parser/ASTDump.xcodeproj → spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures.xcodeproj}/project.xcworkspace/contents.xcworkspacedata +1 -1
- data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Classes.swift +60 -0
- data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/Info.plist +28 -0
- data/spec/integration_specs/misc_jazzy_features/before/MiscJazzyFeatures/MiscJazzyFeatures.h +10 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/Classes.html +317 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/Classes/ImplicitlyInternalTopLevelClass.html +138 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/Enums.html +155 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/Enums/DocumentedEnum.html +128 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/Global Variables.html +138 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/css/jazzy.css +561 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/img/carat.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/img/dash.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/img/gh.png +0 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/index.html +99 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/js/jazzy.js +15 -0
- data/spec/integration_specs/misc_jazzy_features/before/docs/js/jquery.min.js +4 -0
- metadata +112 -76
- data/DEV_README.md +0 -35
- data/bin/ASTDump +0 -0
- data/bin/generate_swift_header.sh +0 -14
- data/lib/assets/CSS/style-1.1.15.css +0 -3366
- data/lib/assets/Images/apple2.png +0 -0
- data/lib/assets/Images/check.png +0 -0
- data/lib/assets/Images/class_node_parent_and_child_2x.png +0 -0
- data/lib/assets/Images/class_node_subclass_last_child_2x.png +0 -0
- data/lib/assets/Images/class_node_subclass_with_siblings_2x.png +0 -0
- data/lib/assets/Images/closebox_2x.png +0 -0
- data/lib/assets/Images/collection_last_child_2x.png +0 -0
- data/lib/assets/Images/collection_last_child_orphan_grandparent_2x.png +0 -0
- data/lib/assets/Images/collection_last_child_orphan_parent_2x.png +0 -0
- data/lib/assets/Images/collection_last_child_orphan_parent_and_grandparent_2x.png +0 -0
- data/lib/assets/Images/collection_node_2x.png +0 -0
- data/lib/assets/Images/collection_node_orphan_grandparent_2x.png +0 -0
- data/lib/assets/Images/collection_node_orphan_parent_2x.png +0 -0
- data/lib/assets/Images/collection_node_orphan_parent_and_grandparent_2x.png +0 -0
- data/lib/assets/Images/collection_node_parent_2x.png +0 -0
- data/lib/assets/Images/collection_node_parent_last_child_orphan_parent_2x.png +0 -0
- data/lib/assets/Images/collection_node_parent_orphan_parent_2x.png +0 -0
- data/lib/assets/Images/collection_parent_last_child_2x.png +0 -0
- data/lib/assets/Images/download_2x.png +0 -0
- data/lib/assets/Images/left_arrow_2x.png +0 -0
- data/lib/assets/Images/magnify_2x.png +0 -0
- data/lib/assets/Images/minus_2x.png +0 -0
- data/lib/assets/Images/playbutton.svg +0 -15
- data/lib/assets/Images/plus_2x.png +0 -0
- data/lib/assets/Images/right_arrow_2x.png +0 -0
- data/lib/assets/Images/search_2x.png +0 -0
- data/lib/assets/Images/shortstack_2x.png +0 -0
- data/lib/assets/JavaScript/devpubs-1.1.15.js +0 -1293
- data/lib/jazzy/jazzhtml.rb +0 -7
- data/lib/jazzy/klass.mustache +0 -150
- data/lib/jazzy/klass.rb +0 -23
- data/lib/jazzy/partials/klass-method.mustache +0 -70
- data/lib/jazzy/partials/klass-overview.mustache +0 -6
- data/lib/jazzy/partials/klass-property.mustache +0 -41
- data/parser/ASTDump.xcodeproj/project.pbxproj +0 -301
- data/parser/ASTDump.xcodeproj/project.xcworkspace/xcshareddata/ASTDump.xccheckout +0 -41
- data/parser/ASTDump.xcodeproj/project.xcworkspace/xcuserdata/ta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/ASTDump.xcscheme +0 -86
- data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/xcschememanagement.plist +0 -22
- data/parser/ASTDump/main.cpp +0 -71
- data/parser/clang-c/BuildSystem.h +0 -148
- data/parser/clang-c/CXCompilationDatabase.h +0 -170
- data/parser/clang-c/CXErrorCode.h +0 -64
- data/parser/clang-c/CXString.h +0 -61
- data/parser/clang-c/Documentation.h +0 -554
- data/parser/clang-c/Index.h +0 -5454
- data/parser/clang-c/Platform.h +0 -45
- data/sample/JAZMusician.h +0 -38
- data/sample/JAZMusician.m +0 -19
- data/sample/Musician.swift +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7a74dd62098862210aed5673baf188f364fbbaf
|
4
|
+
data.tar.gz: cc9531b73dfbdc5e02fd5f5489d9f81476a82394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725b86b39d1436252112d7c48ed599399dada85f77c0236e457c79cc0e6b10ea0fd1516b9b4a9ffebd171400e97279c2d64da402f344ad7334febdb8822e71fe
|
7
|
+
data.tar.gz: 2745f2aca3ce22c1ff821140736f10d7712b99ac996190ddd0545483140a4210e6f52befa84e84d2c74cb79044c00963f0ff3c71db491b38ba69e1f8793dbd8a
|
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/.rubocop.yml
ADDED
@@ -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/**/*
|
data/.rubocop_todo.yml
ADDED
@@ -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
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
2
4
|
|
3
5
|
group :development do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
10
|
-
|
16
|
+
# Integration tests
|
17
|
+
gem 'diffy'
|
18
|
+
gem 'clintegracon'
|
11
19
|
end
|
data/Gemfile.lock
CHANGED
@@ -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.
|
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.
|
14
|
-
|
15
|
-
|
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.
|
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.
|
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
|
-
|
28
|
-
bundler (~> 1.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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**
|
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
|
5
|
+
jazzy is a command-line utility that generates documentation for your Swift or
|
6
|
+
Objective-C projects.
|
5
7
|
|
6
|
-
|
8
|
+
Only Swift projects are currently supported, but Objective-C support is coming
|
9
|
+
soon!
|
7
10
|
|
8
|
-
|
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
|
15
|
-
* `xcode-select -p` should print Xcode 6's path. If it doesn't, run
|
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
|
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
|
31
|
-
-
|
32
|
-
- Leverage
|
33
|
-
-
|
34
|
-
-
|
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
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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.
|
15
|
+
Jazzy::DocBuilder.build(Jazzy::Config.parse!)
|