jazzy 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +32 -0
- data/Gemfile.lock +1 -1
- data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/SourceKittenFramework +0 -0
- data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework +0 -0
- data/lib/jazzy/config.rb +0 -2
- data/lib/jazzy/docset_builder.rb +1 -2
- data/lib/jazzy/docset_builder/info_plist.mustache +2 -2
- data/lib/jazzy/gem_version.rb +1 -1
- data/lib/jazzy/sourcekitten.rb +51 -14
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3bdc6c255a16e1b1494039f0761ed607e0a6dc75
         | 
| 4 | 
            +
              data.tar.gz: 46315c068326227766dc54f87f292c21c76d1e78
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 57a1884009cb79217841982ce9b25ddf12a1085cf8c0d8b1b8f7be456b8b18f913e11e81dc4b87adc68e606c8d8fd32c72ab223080fe06725cc2815a0b2619ca
         | 
| 7 | 
            +
              data.tar.gz: 853465acf5e3be80f3c026d9782711bb8dfd25459860a19e128c6ae71912f2b897b0dc116c1f86dfd17fe3f0d2b652535895922e86e75b8a058fd81f0458c38c
         | 
    
        data/.rubocop.yml
    CHANGED
    
    | @@ -60,6 +60,9 @@ TrailingCommaInArguments: | |
| 60 60 | 
             
            Style/SpecialGlobalVars:
         | 
| 61 61 | 
             
              Enabled: false
         | 
| 62 62 |  | 
| 63 | 
            +
            Style/MultilineBlockChain:
         | 
| 64 | 
            +
              Enabled: false
         | 
| 65 | 
            +
             | 
| 63 66 | 
             
            # We prefer explicit `a, _ = arr` to `a, = arr` (which could be misread as a stray comma)
         | 
| 64 67 | 
             
            Style/TrailingUnderscoreVariable:
         | 
| 65 68 | 
             
              Enabled: false
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,3 +1,35 @@ | |
| 1 | 
            +
            ## 0.7.0
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            ##### Breaking
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            * The `docset_platform` option is no longer available. The module name will
         | 
| 6 | 
            +
              now be used instead of `jazzy`.  
         | 
| 7 | 
            +
              [JP Simard](https://github.com/jpsim)
         | 
| 8 | 
            +
              [#423](https://github.com/realm/jazzy/issues/423)
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            ##### Enhancements
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            * Improved auto-linking behavior to link declarations within declarations and
         | 
| 13 | 
            +
              fix cases where declarations would link to themselves or their current page.  
         | 
| 14 | 
            +
              [Esad Hajdarevic](https://github.com/esad)
         | 
| 15 | 
            +
              [#483](https://github.com/realm/jazzy/issues/483)
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            ##### Bug Fixes
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            * Fix issue where single-line declaration + bodies in Swift would include the
         | 
| 20 | 
            +
              body in the parsed declaration.  
         | 
| 21 | 
            +
              [JP Simard](https://github.com/jpsim)
         | 
| 22 | 
            +
              [#226](https://github.com/realm/jazzy/issues/226)
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            * Fix issue where some sections would become empty when using custom groups.  
         | 
| 25 | 
            +
              [JP Simard](https://github.com/jpsim)
         | 
| 26 | 
            +
              [#475](https://github.com/realm/jazzy/issues/475)
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            * Fix issue where directories ending with `.swift` would be considered Swift
         | 
| 29 | 
            +
              source files.  
         | 
| 30 | 
            +
              [JP Simard](https://github.com/jpsim)
         | 
| 31 | 
            +
              [#586](https://github.com/realm/jazzy/issues/586)
         | 
| 32 | 
            +
             | 
| 1 33 | 
             
            ## 0.6.3
         | 
| 2 34 |  | 
| 3 35 | 
             
            ##### Breaking
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/jazzy/SourceKitten/Frameworks/SourceKittenFramework.framework/SourceKittenFramework
    CHANGED
    
    | Binary file | 
| Binary file | 
    
        data/lib/jazzy/config.rb
    CHANGED
    
    | @@ -212,8 +212,6 @@ module Jazzy | |
| 212 212 | 
             
                  parse: ->(ps) { PodspecDocumenter.create_podspec(Pathname(ps)) if ps },
         | 
| 213 213 | 
             
                  default: Dir['*.podspec{,.json}'].first
         | 
| 214 214 |  | 
| 215 | 
            -
                config_attr :docset_platform, default: 'jazzy'
         | 
| 216 | 
            -
             | 
| 217 215 | 
             
                config_attr :docset_icon,
         | 
| 218 216 | 
             
                  command_line: '--docset-icon FILEPATH',
         | 
| 219 217 | 
             
                  parse: ->(di) { expand_path(di) }
         | 
    
        data/lib/jazzy/docset_builder.rb
    CHANGED
    
    | @@ -41,9 +41,8 @@ module Jazzy | |
| 41 41 | 
             
                      template = Pathname(__dir__) + 'docset_builder/info_plist.mustache'
         | 
| 42 42 | 
             
                      plist << Mustache.render(
         | 
| 43 43 | 
             
                        template.read,
         | 
| 44 | 
            -
                         | 
| 44 | 
            +
                        lowercase_name: source_module.name.downcase,
         | 
| 45 45 | 
             
                        name: source_module.name,
         | 
| 46 | 
            -
                        platform_family: config.docset_platform,
         | 
| 47 46 | 
             
                      )
         | 
| 48 47 | 
             
                    end
         | 
| 49 48 | 
             
                  end
         | 
| @@ -3,11 +3,11 @@ | |
| 3 3 | 
             
            <plist version="1.0">
         | 
| 4 4 | 
             
              <dict>
         | 
| 5 5 | 
             
                <key>CFBundleIdentifier</key>
         | 
| 6 | 
            -
                  <string>com.jazzy.{{ | 
| 6 | 
            +
                  <string>com.jazzy.{{lowercase_name}}</string>
         | 
| 7 7 | 
             
                <key>CFBundleName</key>
         | 
| 8 8 | 
             
                  <string>{{name}}</string>
         | 
| 9 9 | 
             
                <key>DocSetPlatformFamily</key>
         | 
| 10 | 
            -
                  <string>{{ | 
| 10 | 
            +
                  <string>{{lowercase_name}}</string>
         | 
| 11 11 | 
             
                <key>isDashDocset</key>
         | 
| 12 12 | 
             
                  <true/>
         | 
| 13 13 | 
             
                <key>dashIndexFilePath</key>
         | 
    
        data/lib/jazzy/gem_version.rb
    CHANGED
    
    
    
        data/lib/jazzy/sourcekitten.rb
    CHANGED
    
    | @@ -54,6 +54,7 @@ module Jazzy | |
| 54 54 | 
             
                end
         | 
| 55 55 |  | 
| 56 56 | 
             
                def self.make_group(group, name, abstract)
         | 
| 57 | 
            +
                  group.reject! { |doc| doc.name.empty? }
         | 
| 57 58 | 
             
                  SourceDeclaration.new.tap do |sd|
         | 
| 58 59 | 
             
                    sd.type     = SourceDeclaration::Type.overview
         | 
| 59 60 | 
             
                    sd.name     = name
         | 
| @@ -446,10 +447,26 @@ module Jazzy | |
| 446 447 | 
             
                  doc
         | 
| 447 448 | 
             
                end
         | 
| 448 449 |  | 
| 449 | 
            -
                 | 
| 450 | 
            -
             | 
| 450 | 
            +
                # Links recognized top-level declarations within
         | 
| 451 | 
            +
                # - inlined code within docs
         | 
| 452 | 
            +
                # - method signatures after they've been processed by the highlighter
         | 
| 453 | 
            +
                #
         | 
| 454 | 
            +
                # The `after_highlight` flag is used to differentiate between the two modes.
         | 
| 455 | 
            +
                # rubocop:disable Metrics/MethodLength
         | 
| 456 | 
            +
                # rubocop:disable Metrics/PerceivedComplexity
         | 
| 457 | 
            +
                # rubocop:disable Metrics/CyclomaticComplexity
         | 
| 458 | 
            +
                def self.autolink_text(text, doc, root_decls, after_highlight = false)
         | 
| 459 | 
            +
                  start_tag_re, end_tag_re =
         | 
| 460 | 
            +
                    if after_highlight
         | 
| 461 | 
            +
                      [/<span class="(?:n|kt)">/, '</span>']
         | 
| 462 | 
            +
                    else
         | 
| 463 | 
            +
                      ['<code>', '</code>']
         | 
| 464 | 
            +
                    end
         | 
| 465 | 
            +
             | 
| 466 | 
            +
                  text.gsub(/(#{start_tag_re})[ \t]*([^\s]+)[ \t]*(#{end_tag_re})/) do
         | 
| 451 467 | 
             
                    original = Regexp.last_match(0)
         | 
| 452 | 
            -
                    raw_name = Regexp.last_match | 
| 468 | 
            +
                    start_tag, raw_name, end_tag = Regexp.last_match.captures
         | 
| 469 | 
            +
             | 
| 453 470 | 
             
                    parts = raw_name
         | 
| 454 471 | 
             
                            .split(/(?<!\.)\.(?!\.)/) # dot with no neighboring dots
         | 
| 455 472 | 
             
                            .reject(&:empty?)
         | 
| @@ -462,34 +479,53 @@ module Jazzy | |
| 462 479 | 
             
                    # Traverse children via subsequence components, if any
         | 
| 463 480 | 
             
                    link_target = name_traversal(parts, name_root)
         | 
| 464 481 |  | 
| 465 | 
            -
                    if link_target && | 
| 466 | 
            -
             | 
| 467 | 
            -
             | 
| 482 | 
            +
                    if link_target &&
         | 
| 483 | 
            +
                       !link_target.type.extension? &&
         | 
| 484 | 
            +
                       link_target.url &&
         | 
| 485 | 
            +
                       link_target.url != doc.url.split('#').first && # Don't link to parent
         | 
| 486 | 
            +
                       link_target.url != doc.url # Don't link to self
         | 
| 487 | 
            +
                      start_tag +
         | 
| 488 | 
            +
                        "<a href=\"#{ELIDED_AUTOLINK_TOKEN}#{link_target.url}\">" +
         | 
| 489 | 
            +
                        raw_name + '</a>' + end_tag
         | 
| 468 490 | 
             
                    else
         | 
| 469 491 | 
             
                      original
         | 
| 470 492 | 
             
                    end
         | 
| 471 493 | 
             
                  end
         | 
| 472 494 | 
             
                end
         | 
| 495 | 
            +
                # rubocop:enable Metrics/CyclomaticComplexity
         | 
| 496 | 
            +
                # rubocop:enable Metrics/PerceivedComplexity
         | 
| 497 | 
            +
                # rubocop:enable Metrics/MethodLength
         | 
| 473 498 |  | 
| 474 499 | 
             
                def self.autolink(docs, root_decls)
         | 
| 475 500 | 
             
                  docs.each do |doc|
         | 
| 476 | 
            -
                    doc.abstract = autolink_text(doc.abstract, doc, root_decls)
         | 
| 477 | 
            -
                    doc.return = autolink_text(doc.return, doc, root_decls) if doc.return
         | 
| 478 501 | 
             
                    doc.children = autolink(doc.children, root_decls)
         | 
| 502 | 
            +
             | 
| 503 | 
            +
                    doc.return = autolink_text(doc.return, doc, root_decls) if doc.return
         | 
| 504 | 
            +
                    doc.abstract = autolink_text(doc.abstract, doc, root_decls)
         | 
| 505 | 
            +
             | 
| 506 | 
            +
                    doc.declaration = autolink_text(
         | 
| 507 | 
            +
                      doc.declaration, doc, root_decls, true
         | 
| 508 | 
            +
                    ) if doc.declaration
         | 
| 509 | 
            +
             | 
| 510 | 
            +
                    doc.other_language_declaration = autolink_text(
         | 
| 511 | 
            +
                      doc.other_language_declaration, doc, root_decls, true
         | 
| 512 | 
            +
                    ) if doc.other_language_declaration
         | 
| 479 513 | 
             
                  end
         | 
| 480 514 | 
             
                end
         | 
| 481 515 |  | 
| 482 516 | 
             
                def self.reject_objc_types(docs)
         | 
| 483 | 
            -
                  enums = docs. | 
| 484 | 
            -
                    doc.children | 
| 485 | 
            -
                  end
         | 
| 517 | 
            +
                  enums = docs.map do |doc|
         | 
| 518 | 
            +
                    [doc, doc.children]
         | 
| 519 | 
            +
                  end.flatten.select { |child| child.type.objc_enum? }.map(&:name)
         | 
| 486 520 | 
             
                  docs.map do |doc|
         | 
| 487 521 | 
             
                    doc.children = doc.children.reject do |child|
         | 
| 488 522 | 
             
                      child.type.objc_typedef? && enums.include?(child.name)
         | 
| 489 523 | 
             
                    end
         | 
| 490 524 | 
             
                    doc
         | 
| 525 | 
            +
                  end.reject do |doc|
         | 
| 526 | 
            +
                    doc.type.objc_unexposed? ||
         | 
| 527 | 
            +
                      (doc.type.objc_typedef? && enums.include?(doc.name))
         | 
| 491 528 | 
             
                  end
         | 
| 492 | 
            -
                  docs.reject { |doc| doc.type.objc_unexposed? }
         | 
| 493 529 | 
             
                end
         | 
| 494 530 |  | 
| 495 531 | 
             
                # Parse sourcekitten STDOUT output as JSON
         | 
| @@ -499,8 +535,7 @@ module Jazzy | |
| 499 535 | 
             
                  @skip_undocumented = skip_undocumented
         | 
| 500 536 | 
             
                  sourcekitten_json = filter_excluded_files(JSON.parse(sourcekitten_output))
         | 
| 501 537 | 
             
                  docs = make_source_declarations(sourcekitten_json).concat inject_docs
         | 
| 502 | 
            -
                  docs =  | 
| 503 | 
            -
                  docs = group_docs(docs)
         | 
| 538 | 
            +
                  docs = deduplicate_declarations(docs)
         | 
| 504 539 | 
             
                  if Config.instance.objc_mode
         | 
| 505 540 | 
             
                    docs = reject_objc_types(docs)
         | 
| 506 541 | 
             
                  else
         | 
| @@ -508,6 +543,8 @@ module Jazzy | |
| 508 543 | 
             
                    # than min_acl
         | 
| 509 544 | 
             
                    docs = docs.reject { |doc| doc.type.swift_enum_element? }
         | 
| 510 545 | 
             
                  end
         | 
| 546 | 
            +
                  ungrouped_docs = docs
         | 
| 547 | 
            +
                  docs = group_docs(docs)
         | 
| 511 548 | 
             
                  make_doc_urls(docs)
         | 
| 512 549 | 
             
                  autolink(docs, ungrouped_docs)
         | 
| 513 550 | 
             
                  [docs, doc_coverage, @undocumented_tokens]
         | 
    
        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. | 
| 4 | 
            +
              version: 0.7.0
         | 
| 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: 2016-06- | 
| 13 | 
            +
            date: 2016-06-12 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: cocoapods
         |