{{name}}
{{/hide_name}} {{> deprecation}} {{#declaration}}{{language}}
{{/other_language_declaration}} {{{declaration}}}Swift
{{{other_language_declaration}}}Repository: realm/jazzy
Branch: master
Commit: 5ff729211cc7
Files: 90
Total size: 527.4 KB
Directory structure:
gitextract_xj36c4n0/
├── .github/
│ └── workflows/
│ └── Tests.yml
├── .gitignore
├── .gitmodules
├── .rubocop.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Dangerfile
├── Gemfile
├── LICENSE
├── ObjectiveC.md
├── README.md
├── Rakefile
├── bin/
│ ├── jazzy
│ └── sourcekitten
├── images/
│ └── logo.sketch
├── jazzy.gemspec
├── js/
│ └── package.json
├── lib/
│ ├── jazzy/
│ │ ├── config.rb
│ │ ├── doc.rb
│ │ ├── doc_builder.rb
│ │ ├── doc_index.rb
│ │ ├── docset_builder/
│ │ │ └── info_plist.mustache
│ │ ├── docset_builder.rb
│ │ ├── documentation_generator.rb
│ │ ├── executable.rb
│ │ ├── gem_version.rb
│ │ ├── grouper.rb
│ │ ├── highlighter.rb
│ │ ├── jazzy_markdown.rb
│ │ ├── podspec_documenter.rb
│ │ ├── search_builder.rb
│ │ ├── source_declaration/
│ │ │ ├── access_control_level.rb
│ │ │ └── type.rb
│ │ ├── source_declaration.rb
│ │ ├── source_document.rb
│ │ ├── source_host.rb
│ │ ├── source_mark.rb
│ │ ├── source_module.rb
│ │ ├── sourcekitten.rb
│ │ ├── stats.rb
│ │ ├── symbol_graph/
│ │ │ ├── constraint.rb
│ │ │ ├── ext_key.rb
│ │ │ ├── ext_node.rb
│ │ │ ├── graph.rb
│ │ │ ├── relationship.rb
│ │ │ ├── sym_node.rb
│ │ │ └── symbol.rb
│ │ ├── symbol_graph.rb
│ │ └── themes/
│ │ ├── apple/
│ │ │ ├── assets/
│ │ │ │ ├── css/
│ │ │ │ │ ├── highlight.css.scss
│ │ │ │ │ └── jazzy.css.scss
│ │ │ │ └── js/
│ │ │ │ ├── jazzy.js
│ │ │ │ ├── jazzy.search.js
│ │ │ │ └── typeahead.jquery.js
│ │ │ └── templates/
│ │ │ ├── deprecation.mustache
│ │ │ ├── doc.mustache
│ │ │ ├── footer.mustache
│ │ │ ├── header.mustache
│ │ │ ├── nav.mustache
│ │ │ ├── parameter.mustache
│ │ │ ├── task.mustache
│ │ │ └── tasks.mustache
│ │ ├── fullwidth/
│ │ │ ├── assets/
│ │ │ │ ├── css/
│ │ │ │ │ ├── highlight.css.scss
│ │ │ │ │ └── jazzy.css.scss
│ │ │ │ └── js/
│ │ │ │ ├── jazzy.js
│ │ │ │ ├── jazzy.search.js
│ │ │ │ └── typeahead.jquery.js
│ │ │ └── templates/
│ │ │ ├── deprecation.mustache
│ │ │ ├── doc.mustache
│ │ │ ├── footer.mustache
│ │ │ ├── header.mustache
│ │ │ ├── nav.mustache
│ │ │ ├── parameter.mustache
│ │ │ ├── task.mustache
│ │ │ └── tasks.mustache
│ │ └── jony/
│ │ ├── assets/
│ │ │ ├── css/
│ │ │ │ ├── highlight.css.scss
│ │ │ │ └── jazzy.css.scss
│ │ │ └── js/
│ │ │ └── jazzy.js
│ │ └── templates/
│ │ ├── deprecation.mustache
│ │ ├── doc.mustache
│ │ ├── footer.mustache
│ │ ├── header.mustache
│ │ ├── nav.mustache
│ │ ├── parameter.mustache
│ │ ├── task.mustache
│ │ └── tasks.mustache
│ └── jazzy.rb
└── spec/
├── Moya.podspec
├── integration_spec.rb
├── spec_helper/
│ └── pre_flight.rb
└── spec_helper.rb
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/Tests.yml
================================================
name: Tests
on:
push:
branches: [master]
pull_request:
branches: ['*']
jobs:
danger_and_rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Rubocop
run: |
bundle exec rake rubocop
- name: Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bundle exec danger --verbose
spec:
runs-on: macos-15
continue-on-error: true
strategy:
matrix:
spec: ["objc_spec", "swift_spec", "cocoapods_spec"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.2'
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Cache cocoapods
uses: actions/cache@v4
env:
cache-name: cocoapods
with:
path: ~/.cocoapods
key: ${{ matrix.spec }}-${{ env.cache-name }}
- name: Test
run: |
bundle exec rake ${{ matrix.spec }}
================================================
FILE: .gitignore
================================================
jazzy-docs/
/docs/
node_modules
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/tmp/
/test/version_tmp/
/tmp/
## Specific to RubyMotion:
.dat*
.repl_history
build/
## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/
## Environment normalisation:
/.bundle/
/lib/bundler/man/
# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
vendor
================================================
FILE: .gitmodules
================================================
[submodule "SourceKitten"]
path = SourceKitten
url = https://github.com/jpsim/SourceKitten.git
[submodule "spec/integration_specs"]
path = spec/integration_specs
url = https://github.com/realm/jazzy-integration-specs.git
================================================
FILE: .rubocop.yml
================================================
AllCops:
Exclude:
- ./spec/integration_specs/**/*
- ./spec/Moya.podspec
- ./vendor/**/*
- ./tmp/**/*
- ./SourceKitten/**/*
SuggestExtensions: false
TargetRubyVersion: 2.6
#- Pending Cops as of 1.81.1 ---------------------------------------------#
Gemspec/AddRuntimeDependency: # new in 1.65
Enabled: true
Gemspec/AttributeAssignment: # new in 1.77
Enabled: true
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
Enabled: true
Gemspec/DevelopmentDependencies: # new in 1.44
Enabled: false
Gemspec/RequireMFA: # new in 1.23
Enabled: true
Layout/EmptyLinesAfterModuleInclusion: # new in 1.79
Enabled: true
Layout/LineContinuationLeadingSpace: # new in 1.31
Enabled: false
Layout/LineContinuationSpacing: # new in 1.31
Enabled: true
Layout/SpaceBeforeBrackets: # (new in 1.7)
Enabled: true
Lint/AmbiguousAssignment: # (new in 1.7)
Enabled: true
Lint/AmbiguousRange: # (new in 1.19)
Enabled: true
Lint/ArrayLiteralInRegexp: # new in 1.71
Enabled: true
Lint/ConstantOverwrittenInRescue: # new in 1.31
Enabled: true
Lint/ConstantReassignment: # new in 1.70
Enabled: true
Lint/CopDirectiveSyntax: # new in 1.72
Enabled: true
Lint/DeprecatedConstants: # (new in 1.8)
Enabled: true
Lint/DuplicateBranch: # (new in 1.3)
Enabled: true
Lint/DuplicateMagicComment: # new in 1.37
Enabled: true
Lint/DuplicateMatchPattern: # new in 1.50
Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
Enabled: true
Lint/DuplicateSetElement: # new in 1.67
Enabled: true
Lint/EmptyBlock: # (new in 1.1)
Enabled: true
Lint/EmptyClass: # (new in 1.3)
Enabled: true
Lint/EmptyInPattern: # (new in 1.16)
Enabled: true
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
Enabled: true
Lint/ItWithoutArgumentsInBlock: # new in 1.59
Enabled: true
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
Enabled: true
Lint/LiteralAssignmentInCondition: # new in 1.58
Enabled: true
Lint/MixedCaseRange: # new in 1.53
Enabled: true
Lint/NonAtomicFileOperation: # new in 1.31
Enabled: true
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
Enabled: true
Lint/NumberedParameterAssignment: # (new in 1.9)
Enabled: true
Lint/NumericOperationWithConstantResult: # new in 1.69
Enabled: true
Lint/OrAssignmentToConstant: # (new in 1.9)
Enabled: true
Lint/RedundantDirGlobSort: # (new in 1.8)
Enabled: true
Lint/RedundantRegexpQuantifiers: # new in 1.53
Enabled: true
Lint/RedundantTypeConversion: # new in 1.72
Enabled: true
Lint/RefinementImportMethods: # new in 1.27
Enabled: true
Lint/RequireRangeParentheses: # new in 1.32
Enabled: true
Lint/RequireRelativeSelfPath: # new in 1.22
Enabled: true
Lint/SharedMutableDefault: # new in 1.70
Enabled: true
Lint/SuppressedExceptionInNumberConversion: # new in 1.72
Enabled: true
Lint/SymbolConversion: # (new in 1.9)
Enabled: true
Lint/ToEnumArguments: # (new in 1.1)
Enabled: true
Lint/TripleQuotes: # (new in 1.9)
Enabled: true
Lint/UnescapedBracketInRegexp: # new in 1.68
Enabled: true
Lint/UnexpectedBlockArity: # (new in 1.5)
Enabled: true
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
Enabled: true
Lint/UselessConstantScoping: # new in 1.72
Enabled: true
Lint/UselessDefaultValueArgument: # new in 1.76
Enabled: true
Lint/UselessDefined: # new in 1.69
Enabled: true
Lint/UselessNumericOperation: # new in 1.66
Enabled: true
Lint/UselessOr: # new in 1.76
Enabled: true
Lint/UselessRescue: # new in 1.43
Enabled: true
Lint/UselessRuby2Keywords: # new in 1.23
Enabled: true
Metrics/CollectionLiteralLength: # new in 1.47
Enabled: true
Naming/BlockForwarding: # new in 1.24
Enabled: true
Naming/InclusiveLanguage: # (new in 1.18)
Enabled: true
Naming/PredicateMethod: # new in 1.76
Enabled: true
Security/CompoundHash: # new in 1.28
Enabled: true
Style/BitwisePredicate: # new in 1.68
Enabled: true
Style/CombinableDefined: # new in 1.68
Enabled: true
Style/ComparableBetween: # new in 1.74
Enabled: true
Style/ConcatArrayLiterals: # new in 1.41
Enabled: true
Security/IoMethods: # new in 1.22
Enabled: true
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
Enabled: true
Style/ArgumentsForwarding: # (new in 1.1)
Enabled: true
Style/ArrayIntersect: # new in 1.40
Enabled: true
Style/ArrayIntersectWithSingleElement: # new in 1.81
Enabled: true
Style/CollectionCompact: # (new in 1.2)
Enabled: true
Style/CollectionQuerying: # new in 1.77
Enabled: true
Style/ComparableClamp: # new in 1.44
Enabled: true
Style/DataInheritance: # new in 1.49
Enabled: true
Style/DigChain: # new in 1.69
Enabled: true
Style/DirEmpty: # new in 1.48
Enabled: true
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
Enabled: true
Style/EmptyHeredoc: # new in 1.32
Enabled: true
Style/EmptyStringInsideInterpolation: # new in 1.76
Enabled: true
Style/EndlessMethod: # (new in 1.8)
Enabled: true
Style/EnvHome: # new in 1.29
Enabled: true
Style/ExactRegexpMatch: # new in 1.51
Enabled: true
Style/FetchEnvVar: # new in 1.28
Enabled: true
Style/FileEmpty: # new in 1.48
Enabled: true
Style/FileNull: # new in 1.69
Enabled: true
Style/FileRead: # new in 1.24
Enabled: true
Style/FileTouch: # new in 1.69
Enabled: true
Style/FileWrite: # new in 1.24
Enabled: true
Style/HashConversion: # (new in 1.10)
Enabled: true
Style/HashExcept: # (new in 1.7)
Enabled: true
Style/HashFetchChain: # new in 1.75
Enabled: true
Style/HashSlice: # new in 1.71
Enabled: true
Style/IfWithBooleanLiteralBranches: # (new in 1.9)
Enabled: true
Style/InPatternThen: # (new in 1.16)
Enabled: true
Style/ItAssignment: # new in 1.70
Enabled: true
Style/ItBlockParameter: # new in 1.75
Enabled: true
Style/KeywordArgumentsMerging: # new in 1.68
Enabled: true
Style/MagicCommentFormat: # new in 1.35
Enabled: true
Style/MapCompactWithConditionalBlock: # new in 1.30
Enabled: true
Style/MapIntoArray: # new in 1.63
Enabled: true
Style/MapToHash: # new in 1.24
Enabled: true
Style/MapToSet: # new in 1.42
Enabled: true
Style/MinMaxComparison: # new in 1.42
Enabled: true
Style/MultilineInPatternThen: # (new in 1.16)
Enabled: true
Style/NegatedIfElseCondition: # (new in 1.2)
Enabled: true
Style/NestedFileDirname: # new in 1.26
Enabled: true
Style/NilLambda: # (new in 1.3)
Enabled: true
Style/NumberedParameters: # new in 1.22
Enabled: true
Style/NumberedParametersLimit: # new in 1.22
Enabled: true
Style/ObjectThen: # new in 1.28
Enabled: true
Style/OpenStructUse: # new in 1.23
Enabled: true
Style/OperatorMethodCall: # new in 1.37
Enabled: true
Style/QuotedSymbols: # (new in 1.16)
Enabled: true
Style/RedundantArgument: # (new in 1.4)
Enabled: true
Style/RedundantArrayConstructor: # new in 1.52
Enabled: true
Style/RedundantArrayFlatten: # new in 1.76
Enabled: true
Style/RedundantConstantBase: # new in 1.40
Enabled: true
Style/RedundantCurrentDirectoryInPath: # new in 1.53
Enabled: true
Style/RedundantDoubleSplatHashBraces: # new in 1.41
Enabled: true
Style/RedundantEach: # new in 1.38
Enabled: true
Style/RedundantFilterChain: # new in 1.52
Enabled: true
Style/RedundantFormat: # new in 1.72
Enabled: true
Style/RedundantHeredocDelimiterQuotes: # new in 1.45
Enabled: true
Style/RedundantInitialize: # new in 1.27
Enabled: true
Style/RedundantInterpolationUnfreeze: # new in 1.66
Enabled: true
Style/RedundantLineContinuation: # new in 1.49
Enabled: true
Style/RedundantRegexpArgument: # new in 1.53
Enabled: true
Style/RedundantRegexpConstructor: # new in 1.52
Enabled: true
Style/RedundantSelfAssignmentBranch: # (new in 1.19)
Enabled: true
Style/RedundantStringEscape: # new in 1.37
Enabled: true
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
Enabled: true
Style/SafeNavigationChainLength: # new in 1.68
Enabled: true
Style/SelectByRegexp: # new in 1.22
Enabled: true
Style/SendWithLiteralMethodName: # new in 1.64
Enabled: true
Style/SingleLineDoEndBlock: # new in 1.57
Enabled: true
Style/StringChars: # (new in 1.12)
Enabled: true
Style/SuperArguments: # new in 1.64
Enabled: true
Style/SuperWithArgsParentheses: # new in 1.58
Enabled: true
Style/SwapValues: # (new in 1.1)
Enabled: true
Style/YAMLFileRead: # new in 1.53
Enabled: true
# At the moment not ready to be used
# https://github.com/bbatsov/rubocop/issues/947
Style/Documentation:
Enabled: false
#- Jazzy -----------------------------------------------------------------#
# 20 lines is more reasonable than rubocop's default of 10
Metrics/MethodLength:
Max: 20
Metrics/AbcSize:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ParameterLists:
CountKeywordArgs: false
Style/NumericPredicate:
Enabled: false
Layout/HeredocIndentation:
Enabled: false
# We adopted raise instead of fail.
Style/SignalException:
EnforcedStyle: only_raise
# They are idiomatic
Lint/AssignmentInCondition:
Enabled: false
# Allow backticks
Style/AsciiComments:
Enabled: false
# Indentation clarifies logic branches in implementations
Style/IfUnlessModifier:
Enabled: false
# No enforced convention here.
Style/SingleLineBlockParams:
Enabled: false
# We only add the comment when needed.
Style/Encoding:
Enabled: false
# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/SpecialGlobalVars:
Enabled: false
Style/MultilineBlockChain:
Enabled: false
# We prefer explicit `a, _ = arr` to `a, = arr` (which could be misread as a stray comma)
Style/TrailingUnderscoreVariable:
Enabled: false
# For lambdas nested within certain expressions, this rule forces either ugly
# parens or curly braces that violate the "do/end for multiline blocks" rule.
Style/Lambda:
Enabled: false
# Disallowing indented "when" clauses destroys readability when using the
# single-line "when/then" style.
Layout/CaseIndentation:
Enabled: false
# These are both subjective judgements that depend on the situation, and are
# not appropriate as absolute rules.
Style/GuardClause:
Enabled: false
Style/Next:
Enabled: false
# Avoid the least-readable varieties of regular expressions.
Style/RegexpLiteral:
EnforcedStyle: mixed
# Sometimes easier to read either way
Style/AccessorGrouping:
Enabled: false
# Avoid mandatory wide indentation
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/LineEndStringConcatenationIndentation:
Enabled: true
EnforcedStyle: indented
# Avoid false positives with `Pathname`
Style/StringConcatenation:
Mode: conservative
# Compatibility with earlier Rubocops
Metrics/CyclomaticComplexity:
Max: 10
Metrics/PerceivedComplexity:
Max: 10
# Too much firing on basic arithmetic
Lint/AmbiguousOperatorPrecedence:
Enabled: false
#- Jazzy specs -----------------------------------------------------------#
# Allow for `should.match /regexp/`.
Lint/AmbiguousRegexpLiteral:
Exclude:
- spec/**/*
# Allow `object.should == object` syntax.
Lint/Void:
Exclude:
- spec/**/*
Style/ClassAndModuleChildren:
Exclude:
- spec/**/*
Lint/BinaryOperatorWithIdenticalOperands:
Exclude:
- spec/**/*
================================================
FILE: CHANGELOG.md
================================================
## Master
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* None.
## 0.15.4
##### Breaking
* None.
##### Enhancements
* Allow `custom_categories` to specify a regex for a child.
[Enrico Zannini](https://github.com/Enricoza)
[#688](https://github.com/realm/jazzy/issues/688)
* Update Javascript: KaTeX 0.16.25
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Don't call extension members that do not need documentation
'undocumented'.
[John Fairhurst](https://github.com/johnfairh)
* Work around activesupport vs. concurrent-ruby crash.
[John Fairhurst](https://github.com/johnfairh)
[#1414](https://github.com/realm/jazzy/issues/1414)
* Better identify default implementations.
[John Fairhurst](https://github.com/johnfairh)
[#1420](https://github.com/realm/jazzy/issues/1420)
* Suppress warning on extensions providing default implementations.
[John Fairhurst](https://github.com/johnfairh)
[#1396](https://github.com/realm/jazzy/issues/1396)
## 0.15.3
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Don't crash in SourceKitten when the Swift 6 compiler reports
educational notes.
[John Fairhurst](https://github.com/johnfairh)
[#1399](https://github.com/realm/jazzy/issues/1399)
## 0.15.2
##### Breaking
* None.
##### Enhancements
* Support Swift 6.0 / Xcode 16.0
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* None.
## 0.15.1
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Restore compatibility with Ruby 2.6
[John Fairhurst](https://github.com/johnfairh)
[#1388](https://github.com/realm/jazzy/issues/1388)
## 0.15.0
##### Breaking
* None.
##### Enhancements
* Update Javascript: typeahead.js 1.3.4, KaTeX 0.16.10
[John Fairhurst](https://github.com/johnfairh)
* Support Swift 5.10 with Swift Package Manager projects.
[John Fairhurst](https://github.com/johnfairh)
[#1381](https://github.com/realm/jazzy/issues/1381)
* Support documentation of multiple modules in a single website. Use
`--modules` or the config-file `modules` for more control. See the
README 'Documenting multiple modules' for more details.
[Argjira Mala](https://github.com/argjiramala-tomtom)
[Pedro Alcobia](https://github.com/PedroAlcobia-TomTom)
[John Fairhurst](https://github.com/johnfairh)
[#564](https://github.com/realm/jazzy/issues/564)
* Improve page breadcrumbs to include parent pages and indicate source module
of extensions from other modules.
[John Fairhurst](https://github.com/johnfairh)
* Add `--readme-title` and `--docset-title` to set the titles of the readme
docs page and the Dash docset independently of the module name.
[John Fairhurst](https://github.com/johnfairh)
* Support Swift 5.9 symbolgraph extension symbols.
[John Fairhurst](https://github.com/johnfairh)
[#1368](https://github.com/realm/jazzy/issues/1368)
##### Bug Fixes
* Fix incorrect activesupport usage.
[John Fairhurst](https://github.com/johnfairh)
## 0.14.4
##### Breaking
* None.
##### Enhancements
* Update Javascript: jQuery 3.7.1, KaTeX 0.16.8
[John Fairhurst](https://github.com/johnfairh)
* Support Swift `package` access control level.
[John Fairhurst](https://github.com/johnfairh)
* Initial support for Swift macro declarations. Requires
`--swift-build-tool symbolgraph`.
[John Fairhurst](https://github.com/johnfairh)
* Support Swift `@_documentation(visibility:)` attribute. Requires
`--swift-build-tool spm|xcodebuild`.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Issue a warning instead of crashing on declarations without names.
[#1325](https://github.com/realm/jazzy/issues/1325)
[John Fairhurst](https://github.com/johnfairh)
* Fix extension ordering in symbolgraph mode.
[John Fairhurst](https://github.com/johnfairh)
* Fix symbolgraph mode crash involving tuple generic constraints.
[John Fairhurst](https://github.com/johnfairh)
## 0.14.3
##### Breaking
* None.
##### Enhancements
* Support Swift 5.7 and Xcode 14.
[John Fairhurst](https://github.com/johnfairh)
* Update Javascript: jQuery 3.6.1, KaTeX 0.13.5
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* None.
## 0.14.2
##### Breaking
* When building with Swift 5.6 and not passing `—-module` to Jazzy, declarations
may not be correctly identified as undocumented and docs may include unwanted
extensions. Pass `—-module MyModuleName` to fix this.
[John Fairhurst](https://github.com/johnfairh)
##### Enhancements
* Support using pre-generated symbolgraph files in Swift symbolgraph mode.
[Nathan Wong](https://github.com/esteluk)
* Issue a warning on some combinations of Objective-C flags.
[John Fairhurst](https://github.com/johnfairh)
[#900](https://github.com/realm/jazzy/issues/900)
* Support Swift 5.6. The bundled `sourcekitten` is a universal binary.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* In Swift symbolgraph mode, stop including extensions to types that are beneath
the minimum ACL.
[John Fairhurst](https://github.com/johnfairh)
[#1291](https://github.com/realm/jazzy/issues/1291)
## 0.14.1
##### Breaking
* Support Swift SPI groups. Swift declarations marked `@_spi` are no longer
included in docs when `--min-acl` is set to `public` or `open`. Use
`--include-spi-declarations` to include docs for these declarations.
[John Fairhurst](https://github.com/johnfairh)
[#1263](https://github.com/realm/jazzy/issues/1263)
##### Enhancements
* Correct line number references with Xcode 13.
[John Fairhurst](https://github.com/johnfairh)
* Support `union` declarations in Objective-C headers.
[Brian Osborn](https://github.com/bosborn)
[John Fairhurst](https://github.com/johnfairh)
* Support Swift concurrency features: identify actors and asynchronous
methods.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Improve HTML5 correctness, all themes.
[John Fairhurst](https://github.com/johnfairh)
[#1280](https://github.com/realm/jazzy/issues/1280)
## 0.14.0
##### Breaking
* Require at least Ruby 2.6.3.
##### Enhancements
* Support DocC-style autolinks and callouts in markdown.
[John Fairhurst](https://github.com/johnfairh)
* Add `--source-host` option to support projects hosted on GitLab and
Bitbucket as well as GitHub. Options `--source-host-url` and
`--source-host-files-url` and new Mustache tags replace the 'github' versions
which remain as back-compatibility aliases.
[John Fairhurst](https://github.com/johnfairh)
[#314](https://github.com/realm/jazzy/issues/314)
* Add `rel="noopener"` to all `target="_blank"` links.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Fix source-host line number references in Swift symbolgraph mode, and
in ObjC mode for references to one-line declarations.
[John Fairhurst](https://github.com/johnfairh)
* Fix crash with `` ` ` `` in markdown.
[John Fairhurst](https://github.com/johnfairh)
[#1270](https://github.com/realm/jazzy/issues/1270)
* Fix symbolgraph mode with Xcode 13.
[John Fairhurst](https://github.com/johnfairh)
## 0.13.7
The next release of Jazzy will require a minimum of Ruby 2.6.
##### Breaking
* None.
##### Enhancements
* Update JavaScript libraries: jQuery 3.6.0, Lunr 2.3.9,
KaTeX 0.13.5.
[John Fairhurst](https://github.com/johnfairh)
* Support the markdown [footnotes](https://www.markdownguide.org/extended-syntax/#footnotes) extension in all themes.
[John Fairhurst](https://github.com/johnfairh)
[#1246](https://github.com/realm/jazzy/issues/1246)
##### Bug Fixes
* Fix parameter doc comments in Swift symbolgraph mode.
[John Fairhurst](https://github.com/johnfairh)
[#1244](https://github.com/realm/jazzy/issues/1244)
## 0.13.6
##### Breaking
* None.
##### Enhancements
* Support documentation generation from `.swiftmodule` binaries using
`--swift-build-tool symbolgraph` with Swift 5.3.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Always bypass codesigning when building Xcode projects.
[John Fairhurst](https://github.com/johnfairh)
[#1183](https://github.com/realm/jazzy/issues/1183)
## 0.13.5
##### Breaking
* None.
##### Enhancements
* Add search function to `apple` theme.
[Giles Payne](https://github.com/komakai)
[#726](https://github.com/realm/jazzy/issues/726)
* Add option `--[no-]separate-global-declarations` to always create separate
documentation pages for top-level declarations as well as classes,
structures, enums etc. even if they don't have members. As part of this,
improve the main page declaration in all modes.
[Nikolay Volosatov](https://github.com/bamx23)
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Style fixes for `apple` and `jony` themes to codeblocks inside lists and
links.
[John Fairhurst](https://github.com/johnfairh)
[#818](https://github.com/realm/jazzy/issues/818)
[#1177](https://github.com/realm/jazzy/issues/1177)
## 0.13.4
##### Breaking
* None.
##### Enhancements
* Update JavaScript libraries: jQuery 3.5.1 (all themes), Lunr 2.3.8,
typeahead.js 1.3.1 (`fullwidth` theme only).
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Fix warnings from Ruby 2.7.
[John Fairhurst](https://github.com/johnfairh)
[#1185](https://github.com/realm/jazzy/issues/1185)
* Accept `root_url` without trailing slash.
[John Fairhurst](https://github.com/johnfairh)
[#1188](https://github.com/realm/jazzy/issues/1188)
## 0.13.3
##### Breaking
* None.
##### Enhancements
* Added a config option to provide sources of privately hosted pod
dependencies when using the `--podspec` option.
`--pod-sources url1,url2,…urlN`.
[Jonathan Bailey](https://github.com/jon889)
[#650](https://github.com/realm/jazzy/issues/650)
* Improve Dash docset support: support online redirection when
`--root-url` is set, and provide `--docset-playground-url` to
support docset playground links.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Fix module version not being used from podspec.
[Jonathan Bailey](https://github.com/jon889)
* Autolink Swift custom attributes/property wrappers.
[John Fairhurst](https://github.com/johnfairh)
## 0.13.2
##### Breaking
* None.
##### Enhancements
* Support Xcode 11.4. Default Objective-C property attributes are now
stripped from declarations: turn this off with
`--keep-default-property-attributes`.
[John Fairhurst](https://github.com/johnfairh)
[#829](https://github.com/realm/jazzy/issues/829)
* Render LaTeX expressions written using `$equation$` or `$$equation$$`
syntax.
[Arthur Guiot](https://github.com/arguiot)
[John Fairhurst](https://github.com/johnfairh)
[#1156](https://github.com/realm/jazzy/issues/1156)
* Wrap long method names on category pages. Use `name_html` in custom
mustache templates to take advantage of this.
[John Fairhurst](https://github.com/johnfairh)
[#995](https://github.com/realm/jazzy/issues/995)
* Support Dash-style `apple_ref` links to specific API items, for more
stable and human-readable links from external docs.
[Paul Cantrell](https://github.com/pcantrell)
##### Bug Fixes
* Don't generate documentation if the `xcodebuild` command fails.
[John Fairhurst](https://github.com/johnfairh)
[jpsim/SourceKitten#643](https://github.com/jpsim/SourceKitten/issues/643)
* Use multi-line parsed declarations in more places including protocol
methods and typealiases.
[John Fairhurst](https://github.com/johnfairh)
[#896](https://github.com/realm/jazzy/issues/896)
## 0.13.1
##### Breaking
* None.
##### Enhancements
* Allow inline html tags in ObjC doc comments.
[Chris Williams](https://github.com/ultramiraculous)
[#976](https://github.com/realm/jazzy/issues/976)
* Support code formatting in ObjC doc comments with `@c`, `@code` and
`@endcode`.
[Bryce Pauken](https://github.com/brycepauken)
[jpsim/SourceKitten#631](https://github.com/jpsim/SourceKitten/issues/631)
* Add `custom_categories_unlisted_prefix` configuration setting. This
is the prefix for navigation section names that aren't explicitly
listed in `custom_categories`. Defaults to 'Other '.
[JP Simard](https://github.com/jpsim)
* Add `hide_unlisted_documentation` configuration setting. Setting this
to `true` hides documentation entries in the sidebar from the
`documentation` config value that aren't explicitly listed in
`custom_categories`.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Fix crash when SourceKit returns out of bounds string byte offsets.
[JP Simard](https://github.com/jpsim)
* Pick the right version of declarations with type attributes.
[John Fairhurst](https://github.com/johnfairh)
[#1148](https://github.com/realm/jazzy/issues/1148)
## 0.13.0
##### Breaking
* None.
##### Enhancements
* Add section headings for members added by Swift conditional conformances.
[John Fairhurst](https://github.com/johnfairh)
[#717](https://github.com/realm/jazzy/issues/717)
* Parse markdown in MARK comments, make the html available to themes via
`name_html` mustache tag key for section headings.
[John Fairhurst](https://github.com/johnfairh)
* Include protocol conformances added by extensions in Swift docs.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Render bullet lists correctly when followed by a callout.
[John Fairhurst](https://github.com/johnfairh)
[#785](https://github.com/realm/jazzy/issues/785)
* Render markup of text inside double quotes.
[John Fairhurst](https://github.com/johnfairh)
[#992](https://github.com/realm/jazzy/issues/992)
* Fix `sourcekitten_sourcefile` used from config file.
[John Fairhurst](https://github.com/johnfairh)
[#1137](https://github.com/realm/jazzy/issues/1137)
## 0.12.0
##### Breaking
* None.
##### Enhancements
* Support for mixed Swift-ObjC modules: generate two sets of SourceKitten
json and pass them on using `--sourcekitten-sourcefile`.
[Joe Susnick](https://github.com/joesus)
[John Fairhurst](https://github.com/johnfairh)
[#447](https://github.com/realm/jazzy/issues/447)
##### Bug Fixes
* Stop displaying type attributes on extension declarations.
[John Fairhurst](https://github.com/johnfairh)
* Show ObjC and Swift classes (etc.) in the same category.
[John Fairhurst](https://github.com/johnfairh)
* Merge Swift extensions into ObjC classes.
[John Fairhurst](https://github.com/johnfairh)
[Joe Susnick](https://github.com/joesus)
## 0.11.2
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Generate Swift docs with Xcode 11 and paths with spaces.
[John Fairhurst](https://github.com/johnfairh)
[#1108](https://github.com/realm/jazzy/issues/1108)
* Reinstate guessing of module name from podspec, broken in 0.11.0.
[John Fairhurst](https://github.com/johnfairh)
[#1109](https://github.com/realm/jazzy/issues/1109)
## 0.11.1
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Don't use SwiftPM if there is an Xcode workspace or project in a non-root
directory.
[John Fairhurst](https://github.com/johnfairh)
[#1103](https://github.com/realm/jazzy/issues/1103)
## 0.11.0
##### Breaking
* None.
##### Enhancements
* Sass support now provided by `libsass` via `sassc` instead of the
deprecated Ruby Sass gem.
[John Fairhurst](https://github.com/johnfairh)
* Update bundled jQuery to 3.4.1 (all themes).
[Paul Idstein](https://github.com/idstein)
* Support Xcode 11 Swift projects that pass a response file to the Swift
compiler.
[John Fairhurst](https://github.com/johnfairh)
[#1087](https://github.com/realm/jazzy/issues/1087)
* Generate Swift docs from a Swift Package Manager package without
requiring an Xcode project file. Add `--swift-build-tool` to choose
the build method if both `.xcodeproj` and `Package.swift` files are
present. Add `--build-tool-flags` as a preferred alias for
`--xcodebuild-flags`.
[John Fairhurst](https://github.com/johnfairh)
[#487](https://github.com/realm/jazzy/issues/487)
##### Bug Fixes
* Preserve non-latin characters in guide filenames and heading IDs.
[John Fairhurst](https://github.com/johnfairh)
[#1091](https://github.com/realm/jazzy/issues/1091)
* Generate correct html for custom categories containing special
characters.
[John Fairhurst](https://github.com/johnfairh)
[#945](https://github.com/realm/jazzy/issues/945)
* Fix crash on files with misplaced documentation comments.
[John Fairhurst](https://github.com/johnfairh)
[#1083](https://github.com/realm/jazzy/issues/1083)
## 0.10.0
##### Breaking
* The included `sourcekitten` binary is built with Xcode 10.2. This means
it does not run on macOS earlier than 10.14.4 without the *Swift 5 Runtime
Support for Command Line Tools* being installed.
[John Fairhurst](https://github.com/johnfairh)
##### Enhancements
* Support CocoaPods 1.6+. Use the `swift_version[s]` dsl in `--podspec` mode
to set the Swift language version.
[John Fairhurst](https://github.com/johnfairh)
* Show the extension declaration when documenting Swift extensions.
[John Fairhurst](https://github.com/johnfairh)
* Allow docs title customization. Include `--module-version` when it is set
and support `--title` to fully customize the title. Pass `{{module_version}}`
and `{{docs_title}}` to templates.
[Maximilian Alexander](https://github.com/mbalex99)
[John Fairhurst](https://github.com/johnfairh)
[#666](https://github.com/realm/jazzy/issues/666)
[#411](https://github.com/realm/jazzy/issues/411)
##### Bug Fixes
* Unfold member documentation when linked to from current web page.
[John Fairhurst](https://github.com/johnfairh)
[#788](https://github.com/realm/jazzy/issues/788)
* Generate docs when there are unusual characters in source pathnames.
[John Fairhurst](https://github.com/johnfairh)
[#1049](https://github.com/realm/jazzy/issues/1049)
* Generate docs for signed modules with Xcode 10.2.
[John Fairhurst](https://github.com/johnfairh)
[#1057](https://github.com/realm/jazzy/issues/1057)
* Use correct module name when only target name is supplied.
[Chris Zielinski](https://github.com/chriszielinski)
[#422](https://github.com/realm/jazzy/issues/422)
## 0.9.6
This is (probably) the last release to support Ruby earlier than 2.3.
This is due to a change in a dependency.
This is (probably) the last release to support macOS earlier than 10.14.4
without the *Swift 5 Runtime Support for Command Line Tools* package installed.
This is a consequence of Swift 5 ABI stability.
##### Breaking
* None.
##### Enhancements
* Swift 5 support: suppress unwanted newlines and `deinit` declarations.
[John Fairhurst](https://github.com/johnfairh)
* Update JavaScript libraries: jQuery 3.3.1 (all themes), Lunr 2.3.5,
typeahead.js 1.2.1 (`fullwidth` theme only).
[John Fairhurst](https://github.com/johnfairh)
[#901](https://github.com/realm/jazzy/issues/901)
* Avoid `clean build` when using the new Xcode build system.
[Norio Nomura](https://github.com/norio-nomura)
##### Bug Fixes
* None.
## 0.9.5
##### Breaking
* None.
##### Enhancements
* Link to documentation pages from contents pages.
[John Fairhurst](https://github.com/johnfairh)
[#730](https://github.com/realm/jazzy/issues/730)
* Call out unavailable and deprecated Objective-C declarations.
[Stefan Kieleithner](https://github.com/steviki)
[John Fairhurst](https://github.com/johnfairh)
[#843](https://github.com/realm/jazzy/issues/843)
##### Bug Fixes
* Support Swift 4.2 with `--podspec`.
[John Fairhurst](https://github.com/johnfairh)
[#1015](https://github.com/realm/jazzy/issues/1015)
* Fix multiline copyright for `apple` theme.
[Fabien Lydoire](https://github.com/fabienlydoire)
[John Fairhurst](https://github.com/johnfairh)
[#1016](https://github.com/realm/jazzy/issues/1016)
## 0.9.4
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Fix crash with pre-existing `Docs` directory.
[John Fairhurst](https://github.com/johnfairh)
[#965](https://github.com/realm/jazzy/issues/965)
* Fix crash with unicode scalars in string literals.
[John Fairhurst](https://github.com/johnfairh)
[#972](https://github.com/realm/jazzy/issues/972)
* Fix error compiling a Swift podspec in Xcode 10.
[Minh Nguyễn](https://github.com/1ec5)
[#970](https://github.com/realm/jazzy/issues/970)
## 0.9.3
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Fix crash when specifying empty Swift version. Now correctly uses the default
Swift version.
[JP Simard](https://github.com/jpsim)
* Fix jony theme selection.
[John Fairhurst](https://github.com/johnfairh)
[#962](https://github.com/realm/jazzy/issues/962)
## 0.9.2
##### Breaking
* None.
##### Enhancements
* Add a new 'jony' theme similar to the 2017 Apple documentation style.
[Harshil Shah](https://github.com/HarshilShah)
* Add the ability to limit documentation to certain files by passing in an
`-i`/`--include` argument.
[Nick Fox](https://github.com/nicholasffox)
[#949](https://github.com/realm/jazzy/issues/949)
* Improve Swift declarations to look more like the Xcode Quick Help version,
for example including `{ get set }`, and include all attributes.
[John Fairhurst](https://github.com/johnfairh)
[#768](https://github.com/realm/jazzy/issues/768)
[#591](https://github.com/realm/jazzy/issues/591)
##### Bug Fixes
* Preserve `MARK` comment headings associated with extensions and enum cases.
[John Fairhurst](https://github.com/johnfairh)
* Fix issue where Overview items were invalidly being referenced with NULL
types in the generated Dash docset index.
[Andrew De Ponte](https://github.com/cyphactor)
* Don't display FIXME or TODO comments as section markers.
[John Fairhurst](https://github.com/johnfairh)
[#658](https://github.com/realm/jazzy/issues/658)
## 0.9.1
##### Breaking
* None.
##### Enhancements
* Added a config option (`--undocumented-text UNDOCUMENTED_TEXT`) to set the
default text for undocumented symbols.
[Akhil Batra](https://github.com/akhillies)
[#913](https://github.com/realm/jazzy/issues/913)
* Added a config option to hide Objective-C or Swift declarations:
`--hide-declarations [objc|swift]`.
[Ibrahim Ulukaya](https://github.com/ulukaya)
[#828](https://github.com/realm/jazzy/issues/828)
* Automatically use Swift or Objective-C syntax highlighting for code blocks
in documentation comments. Improve Swift highlighting with latest Rouge.
[John Fairhurst](https://github.com/johnfairh)
[#218](https://github.com/realm/jazzy/issues/218)
##### Bug Fixes
* Fix Swift declarations when generating Objective-C docs for generic types.
[John Fairhurst](https://github.com/johnfairh)
[#910](https://github.com/realm/jazzy/issues/910)
* Don't create documentation nodes for generic type parameters.
[John Fairhurst](https://github.com/johnfairh)
[#878](https://github.com/realm/jazzy/issues/878)
## 0.9.0
##### Breaking
* Generate documentation coverage badge locally. Since this avoids the failable
HTTP request to shields.io previously used to obtain the badge, we've removed
the `--[no-]download-badge` flag and the corresponding `download_badge`
YAML configuration key.
[Samuel Giddins](https://github.com/segiddins)
##### Enhancements
* None.
##### Bug Fixes
* Fixed issue that prevented Jazzy from running on case sensitive file systems.
[Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
[#891](https://github.com/realm/jazzy/issues/891)
* Fixed issue preventing `--podspec` from working with `test_spec`s.
[John Fairhurst](https://github.com/johnfairh)
[#894](https://github.com/realm/jazzy/issues/894)
* Always display correct declaration for undocumented symbols.
[John Fairhurst](https://github.com/johnfairh)
[#864](https://github.com/realm/jazzy/issues/864)
* Trim common indentation in multiline declarations.
[John Fairhurst](https://github.com/johnfairh)
[#836](https://github.com/realm/jazzy/issues/836)
## 0.8.4
##### Breaking
* None.
##### Enhancements
* Align jazzy terminology with Apple usage.
[Xiaodi Wu](https://github.com/xwu)
[John Fairhurst](https://github.com/johnfairh)
* Add `url` attribute that can be more accurate than `{{section}}.html` as a URL
in custom templates.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Fix crash when specifying `swift_version` as a floating point value in
`.jazzy.yaml` rather than a string.
[JP Simard](https://github.com/jpsim)
[#860](https://github.com/realm/jazzy/issues/860)
* Autolink from parameter documentation and from external markdown documents
including README. Autolink to symbols containing & < >.
[John Fairhurst](https://github.com/johnfairh)
[#715](https://github.com/realm/jazzy/issues/715)
[#789](https://github.com/realm/jazzy/issues/789)
[#805](https://github.com/realm/jazzy/issues/805)
* Fix Swift 4 declarations containing ampersands (`&`) being truncated.
[JP Simard](https://github.com/jpsim)
## 0.8.3
##### Breaking
* None.
##### Enhancements
* Generate Swift declaration for more Objective-C declarations.
[Zheng Li](https://github.com/ainopara)
* Improve quality & accuracy of Swift interfaces for Objective-C declarations
when generating Objective-C docs.
[Norio Nomura](https://github.com/norio-nomura)
* Process Swift 3.2/4 doc comments.
[John Fairhurst](https://github.com/johnfairh)
##### Bug Fixes
* Fix missing doc comments on some extensions.
[John Fairhurst](https://github.com/johnfairh)
[#454](https://github.com/realm/jazzy/issues/454)
* Fix failure when attempting to download documentation coverage badge with
jazzy using macOS system Ruby, or a Ruby built with outdated versions of
OpenSSL.
[JP Simard](https://github.com/jpsim)
[#824](https://github.com/realm/jazzy/issues/824)
* Stop `--skip-undocumented` from skipping documented items nested
inside extensions of types from other modules.
[John Fairhurst](https://github.com/johnfairh)
[#502](https://github.com/realm/jazzy/issues/502)
* Fix members added to extensions of a nested type showing up in the parent.
[John Fairhurst](https://github.com/johnfairh)
[#333](https://github.com/realm/jazzy/issues/333)
## 0.8.2
##### Breaking
* None.
##### Enhancements
* Report number of included and skipped declarations in CLI output.
[John Fairhurst](https://github.com/johnfairh)
[#238](https://github.com/realm/jazzy/issues/238)
* Build ObjC docs with clang modules enabled by default (`-fmodules` flag).
[Maksym Grebenets](https://github.com/mgrebenets)
[#636](https://github.com/realm/jazzy/issues/636)
* Shave ~1MB from jazzy's gem distribution.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Fix support for Ruby 2.2.
[John Fairhurst](https://github.com/johnfairh)
[#801](https://github.com/realm/jazzy/issues/801)
* Fix many cases of incorrect, missing or superfluous docs on Swift
declarations.
[John Fairhurst](https://github.com/johnfairh)
## 0.8.1
##### Breaking
* None.
##### Enhancements
* Allow all markdown in returns and parameter description callouts.
[John Fairhurst](https://github.com/johnfairh)
[#476](https://github.com/realm/jazzy/issues/476)
##### Bug Fixes
* Fix a crash that occurred when a documentation comment ended with an extended
grapheme cluster.
[Lukas Stührk](https://github.com/Lukas-Stuehrk)
[#794](https://github.com/realm/jazzy/issues/794)
[SourceKitten#350](https://github.com/jpsim/SourceKitten/issues/350)
## 0.8.0
##### Breaking
* `undocumented.json` is now only in the output directory and is no longer
copied into docsets.
[Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
[#754](https://github.com/realm/jazzy/issues/754)
##### Enhancements
* Add `--[no-]download-badge` flag to skip downloading the documentation
coverage badge from shields.io. Useful if generating docs offline.
[JP Simard](https://github.com/jpsim)
[#765](https://github.com/realm/jazzy/issues/765)
##### Bug Fixes
* Blank line no longer needed before lists or code blocks.
[John Fairhurst](https://github.com/johnfairh)
[#546](https://github.com/realm/jazzy/issues/546)
* Linking to headers in apple theme gives correct vertical alignment.
[John Fairhurst](https://github.com/johnfairh)
* Headers in source code markdown no longer cause corruption.
[John Fairhurst](https://github.com/johnfairh)
[#628](https://github.com/realm/jazzy/issues/628)
## 0.7.5
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Fix issue where using a custom theme would crash jazzy when using Ruby 2.4.
[Jason Wray](https://github.com/friedbunny)
[#752](https://github.com/realm/jazzy/issues/752)
* Fix support for Ruby 2.0.0.
[Jason Wray](https://github.com/friedbunny)
[#747](https://github.com/realm/jazzy/issues/747)
* Fix issue where header files are not found if inside subdirectories of the
framework_root specified folder.
[Christopher Gretzki](https://github.com/gretzki)
[#518](https://github.com/realm/jazzy/issues/518)
## 0.7.4
##### Breaking
* None.
##### Enhancements
* Generate shields.io badge for documentation coverage, unless
`hide_documentation_coverage` is set.
[Harlan Haskins](https://github.com/harlanhaskins)
[#723](https://github.com/realm/jazzy/issues/723)
* Add support for searching docs when using the `fullwidth` theme. A new option,
`--disable-search`, lets you turn this off.
[Esad Hajdarevic](https://github.com/esad)
[Tom MacWright](https://github.com/tmcw)
[Nadia Barbosa](https://github.com/captainbarbosa)
[#14](https://github.com/realm/jazzy/issues/14)
* New config option `use_safe_filenames` encodes unsafe characters when
generating filenames. By default, documentation may receive filenames like
`/(_:_:).html`. With `use_safe_filenames`, the same file will receive the name
`_2F_28_5F_3A_5F_3A_29.html` instead.
[Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
[#699](https://github.com/realm/jazzy/issues/699)
[#146](https://github.com/realm/jazzy/issues/146)
[#361](https://github.com/realm/jazzy/issues/361)
[#547](https://github.com/realm/jazzy/issues/547)
* References to Objective-C methods are now autolinked.
[Minh Nguyễn](https://github.com/1ec5)
[#362](https://github.com/realm/jazzy/issues/362)
* Print documentation coverage percentage and the number of undocumented
methods to the command line when running jazzy.
[Jason Wray](https://github.com/friedbunny)
##### Bug Fixes
* Fix issue where existing abstracts for non custom sections would be completely
overwritten when using extra abstract injection with --abstract.
[Thibaud Robelain](https://github.com/thibaudrobelain)
[#600](https://github.com/realm/jazzy/issues/600)
* Fix issue where generic type parameters registered as undocumented symbols.
[Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
[#429](https://github.com/realm/jazzy/issues/429)
* Fix issue where parameter and return callouts were duplicated in documentation.
[Jeremy David Giesbrecht](https://github.com/SDGGiesbrecht)
[#673](https://github.com/realm/jazzy/issues/673)
* Fix issue where Objective-C superclass in declaration was unlinked.
[Minh Nguyễn](https://github.com/1ec5)
[#706](https://github.com/realm/jazzy/issues/706)
* Fix issue where multiple Objective-C categories of the same external class
in different files were merged into one and named after the first category
found.
[Minh Nguyễn](https://github.com/1ec5)
[#539](https://github.com/realm/jazzy/issues/539)
* String literals in code listings are no longer wrapped in `` tags (`apple`
and `fullwidth` themes only).
[Minh Nguyễn](https://github.com/1ec5)
[#714](https://github.com/realm/jazzy/issues/714)
* Fix issue where passing a `--podspec` argument would use a malformed
`SWIFT_VERSION` value, causing compilation to fail.
[JP Simard](https://github.com/jpsim)
## 0.7.3
##### Breaking
* None.
##### Enhancements
* Podspec-based documentation will take trunk's `pushed_with_swift_version`
attribute into account when generating documentation by default.
[Orta Therox](https://github.com/orta)
* Podspec-based documentation respects the `swift-version` config option.
[Orta Therox](https://github.com/orta)
##### Enhancements
* Support Objective-C class properties.
[Jérémie Girault](https://github.com/jeremiegirault)
[JP Simard](https://github.com/jpsim)
* Support documenting Swift 3 operator precedence groups.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Rename Dash typedef type from "Alias" to "Type".
[Bogdan Popescu](https://github.com/Kapeli)
* Fix crash when sorting multiple identically named declarations with no USR,
which is very common when generating docs for podspecs supporting multiple
platforms.
[JP Simard](https://github.com/jpsim)
[#661](https://github.com/realm/jazzy/issues/661)
* Fix Xcode not being found when specifying a custom Swift version
(`--swift-version`).
[Samuel Giddins](https://github.com/segiddins)
[Paul Cantrell](https://github.com/pcantrell)
[#656](https://github.com/realm/jazzy/issues/656)
* Fix crash when generating Objective-C docs for projects with "@" directives in
documentation comments with Xcode 8.1 or later.
[Jérémie Girault](https://github.com/jeremiegirault)
## 0.7.2
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Declarations marked `@available(..., unavailable, ...)` are no longer
documented.
[JP Simard](https://github.com/jpsim)
[#654](https://github.com/realm/jazzy/issues/654)
* Treat the `open` ACL as more public than `public`.
[JP Simard](https://github.com/jpsim)
## 0.7.1
##### Breaking
* None.
##### Enhancements
* Added support for the new access control specifiers of fileprivate and open.
[Shmuel Kallner](https://github.com/shmuelk)
[#645](https://github.com/realm/jazzy/issues/645)
[#646](https://github.com/realm/jazzy/issues/646)
##### Bug Fixes
* Fix issue where jazzy could not be installed from Gemfile due to
SourceKitten symlinks already being present.
[William Meleyal](https://github.com/meleyal)
[#438](https://github.com/realm/jazzy/issues/438)
* The lint report in `undocumented.json` is more human-readable: includes fully
qualified symbol names, pretty printed.
[Paul Cantrell](https://github.com/pcantrell)
[#598](https://github.com/realm/jazzy/issues/598)
* The `exclude` option now properly supports wildcards.
[Paul Cantrell](https://github.com/pcantrell)
[#640](https://github.com/realm/jazzy/issues/640)
## 0.7.0
##### Breaking
* The `docset_platform` option is no longer available. The module name will
now be used instead of `jazzy`.
[JP Simard](https://github.com/jpsim)
[#423](https://github.com/realm/jazzy/issues/423)
##### Enhancements
* Improved auto-linking behavior to link declarations within declarations and
fix cases where declarations would link to themselves or their current page.
[Esad Hajdarevic](https://github.com/esad)
[#483](https://github.com/realm/jazzy/issues/483)
##### Bug Fixes
* Fix issue where single-line declaration + bodies in Swift would include the
body in the parsed declaration.
[JP Simard](https://github.com/jpsim)
[#226](https://github.com/realm/jazzy/issues/226)
* Fix issue where some sections would become empty when using custom groups.
[JP Simard](https://github.com/jpsim)
[#475](https://github.com/realm/jazzy/issues/475)
* Fix issue where directories ending with `.swift` would be considered Swift
source files.
[JP Simard](https://github.com/jpsim)
[#586](https://github.com/realm/jazzy/issues/586)
## 0.6.3
##### Breaking
* None.
##### Enhancements
* `--exclude` flag now supports excluding directories in addition to files.
[Gurrinder](https://github.com/gurrinder)
[#503](https://github.com/realm/jazzy/issues/503)
* The `cocoapods` gem was updated to 1.0.1 and `rouge` to 1.11.0.
[Samuel Giddins](https://github.com/segiddins)
[#568](https://github.com/realm/jazzy/issues/568)
* Extra markdown documentation can now be included as their own pages in the
sidebar using the `--documentation` option and in the generated Dash docset
as Guides.
[Karl Bowden](https://github.com/agentk)
[#435](https://github.com/realm/jazzy/issues/435)
* Section headings can now include additional markdown content using the
`--abstract` option.
[Karl Bowden](https://github.com/agentk)
[#435](https://github.com/realm/jazzy/issues/435)
* If Swift version is not specified, look for Swift toolchain or clang location
in the following order:
* `$XCODE_DEFAULT_TOOLCHAIN_OVERRIDE`
* `$TOOLCHAIN_DIR`
* `xcrun -find swift`
* `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain`
* `/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain`
* `~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain`
* `~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain`
This will be especially useful once jazzy supports generating docs for
Swift Package Manager modules with a toolchain not tied to an Xcode release.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Don't document clang-unexposed Objective-C declarations.
[JP Simard](https://github.com/jpsim)
[#573](https://github.com/realm/jazzy/issues/573)
## 0.6.2
##### Breaking
* None.
##### Enhancements
* Include one level of nested classes, structs, protocols and enums in the
navigation bar.
[JP Simard](https://github.com/jpsim)
[#64](https://github.com/realm/jazzy/issues/64)
##### Bug Fixes
* None.
## 0.6.1
##### Breaking
* None.
##### Enhancements
* Objective-C documentation now also includes Swift declarations.
[JP Simard](https://github.com/jpsim)
[#136](https://github.com/realm/jazzy/issues/136)
* Default to the Xcode version selected in `xcode-select` if no Swift version is
specified.
[Samuel Giddins](https://github.com/segiddins)
[#427](https://github.com/realm/jazzy/issues/427)
##### Bug Fixes
* Uses GitHub-Flavored Markdown syntax for anchors when rendering README pages.
[Zachary Waldowski](https://github.com/zwaldowski)
[#524](https://github.com/realm/jazzy/issues/524)
* Fix crash when using unexposed declarations in Objective-C.
[JP Simard](https://github.com/jpsim)
[#543](https://github.com/realm/jazzy/issues/543)
* No longer document Swift extensions on types with an ACL lower than `min-acl`
when they contain `MARK`s.
[JP Simard](https://github.com/jpsim)
[#544](https://github.com/realm/jazzy/issues/544)
## 0.6.0
##### Breaking
* Config files now use the same option names as the command line. If you are
using one of the keys that has changed in your `.jazzy.yaml`, you will receive
a warning. See the [pull request](https://github.com/realm/jazzy/pull/456) for
a complete list of changed options. As always, you can get a list of all
options with `jazzy --help config`.
[Paul Cantrell](https://github.com/pcantrell)
* Jazzy's undocumented.txt has been replaced with undocumented.json. This new
format includes contextual information that one might use to lint
documentation in an automated fashion.
[Jeff Verkoeyen](https://github.com/jverkoey)
* `--swift-version` now defaults to 2.2 instead of 2.1.1.
[Tamar Nachmany](https://github.com/tamarnachmany)
##### Enhancements
* Add `--skip-documentation` flag. Skips site generation phase. `undocumented.json`
is still generated.
[Jeff Verkoeyen](https://github.com/jverkoey)
* Merge Objective-C categories into their parent type documentation to match
Swift behavior.
[Esad Hajdarevic](https://github.com/esad)
[#457](https://github.com/realm/jazzy/issues/457)
* Add support for documenting Swift 2.2 `associatedtype`s and infix, postfix &
prefix operators.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Add support for Objective-C module imports.
[JP Simard](https://github.com/jpsim)
[#452](https://github.com/realm/jazzy/issues/452)
* Workaround for an apparent SourceKit bug which sometimes caused extensions
to be merged into the wrong type.
[Paul Cantrell](https://github.com/pcantrell)
[#459](https://github.com/realm/jazzy/issues/459)
[#460](https://github.com/realm/jazzy/issues/460)
## 0.5.0
##### Breaking
* `--swift-version` now defaults to 2.1.1 instead of 2.1.
[Nikita Lutsenko](https://github.com/nlutsenko)
[#416](https://github.com/realm/jazzy/pull/416)
* Swift 1.x is no longer supported.
* `--templates-directory` and `--assets-directory` have been deprecated in favor
of `--theme`. Specify either 'apple' (default), 'fullwidth' or the path to
your mustache templates and other assets for a custom theme.
[Karl Bowden](https://github.com/agentk)
[JP Simard](https://github.com/jpsim)
[#130](https://github.com/realm/jazzy/issues/130)
##### Enhancements
* Add `--sdk [iphone|watch|appletv][os|simulator]|macosx` option for Objective-C
projects.
[Jeff Verkoeyen](https://github.com/jverkoey)
* Add `--head` option to inject custom HTML into ``.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* Fix an issue where extension documentation would use the original type
documentation block rather than the comment immediately preceding the
extension.
[JP Simard](https://github.com/jpsim)
[#230](https://github.com/realm/jazzy/issues/230)
[#313](https://github.com/realm/jazzy/issues/313)
[#334](https://github.com/realm/jazzy/issues/334)
* Fix multi-byte documentation issues.
[Norio Nomura](https://github.com/norio-nomura)
[#403](https://github.com/realm/jazzy/issues/403)
## 0.4.1
*Note: this is the last official release of jazzy supporting Swift 1.x.*
##### Breaking
* None.
##### Enhancements
* Support "wall of asterisk" documentation comments.
[Jeff Verkoeyen](https://github.com/jverkoey)
[#347](https://github.com/realm/jazzy/issues/347)
* Expanding a token no longer causes the document to 'jump' to the hash.
[Jeff Verkoeyen](https://github.com/jverkoey)
[#352](https://github.com/realm/jazzy/issues/352)
* Autolinking improvements:
- Autolinks only match `` `ThingsInBackticks` ``, and must match the entire
string. This prevents spurious matching in prose and sample code.
- Autolinks supports siblings, ancestors, top-level elements, and
dot-separated chains starting with any of the above: `someProperty`,
`SomeType.NestedType.someMethod(_:)`.
- New `...` wildcard prevents you from having to list all method parameters:
`someMethod(...)`
[Paul Cantrell](https://github.com/pcantrell)
[#327](https://github.com/realm/jazzy/issues/327)
[#329](https://github.com/realm/jazzy/issues/329)
[#359](https://github.com/realm/jazzy/issues/359)
* Miscellaneous minor font size, weight, and color adjustments.
[Jeff Verkoeyen](https://github.com/jverkoey)
* In-page anchors now appear below the header.
[Jeff Verkoeyen](https://github.com/jverkoey)
##### Bug Fixes
* Fix an out-of-bounds exception when generating pragma marks.
[JP Simard](https://github.com/jpsim)
[#370](https://github.com/realm/jazzy/issues/370)
* Add support for C/C++ struct, field & ivar types.
[JP Simard](https://github.com/jpsim)
[#374](https://github.com/realm/jazzy/issues/374)
[#387](https://github.com/realm/jazzy/issues/387)
* Links to source files on GitHub are no longer broken when `source_directory`
does not point to the current working directory.
[Paul Cantrell](https://github.com/pcantrell)
* When `excluded_files` is specified in a config file, it is now resolved
relative to the file (like other options) instead of relative to the working
directory.
[Paul Cantrell](https://github.com/pcantrell)
## 0.4.0
##### Breaking
* `--swift-version` now defaults to 2.1 instead of 2.0.
[JP Simard](https://github.com/jpsim)
##### Enhancements
* Support for documenting Objective-C projects! 🎉
Pass `--objc`, `--umbrella-header ...` and `-framework-root ...`.
[JP Simard](https://github.com/jpsim)
[#56](https://github.com/realm/jazzy/issues/56)
* Mentions of top-level declarations in documentation comments are now
automatically hyperlinked to their reference.
[JP Simard](https://github.com/jpsim)
* Jazzy can now read options from a configuration file. The command line
provides comprehensive help for available options via `jazzy -h config`.
[Paul Cantrell](https://github.com/pcantrell)
[#310](https://github.com/realm/jazzy/pull/310)
* Render special list items (e.g. Throws, See, etc.). See
https://ericasadun.com/2015/06/14/swift-header-documentation-in-xcode-7/ for
a complete list.
[JP Simard](https://github.com/jpsim)
[#317](https://github.com/realm/jazzy/issues/317)
* Support for Swift 2.1.
[JP Simard](https://github.com/jpsim)
* Swift extensions are now merged with their extended type, rendering a note
to describe extension default implementations and extension methods.
[Paul Cantrell](https://github.com/pcantrell)
##### Bug Fixes
* None.
## 0.3.2
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Fixed an issue that prevented building projects with different schema & module
names.
[JP Simard](https://github.com/jpsim)
[#259](https://github.com/realm/jazzy/issues/259)
* Hide documentation coverage from header using `--hide-documentation-coverage`.
[mbogh](https://github.com/mbogh)
[#129](https://github.com/realm/jazzy/issues/297)
* Print a more informative error when unable to find an Xcode that has the
requested Swift version.
[Samuel Giddins](https://github.com/segiddins)
## 0.3.1
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Added missing Swift 2 declaration types.
[JP Simard](https://github.com/jpsim)
## 0.3.0
##### Breaking
* `--swift-version` now defaults to 2.0 instead of 1.2.
[JP Simard](https://github.com/jpsim)
##### Enhancements
* Now supports Swift 2.0 (previous Swift versions are still supported).
[JP Simard](https://github.com/jpsim)
[Samuel Giddins](https://github.com/segiddins)
* Declarations can now be grouped by custom categories defined in a JSON or YAML
file passed to `--categories`.
[Paul Cantrell](https://github.com/pcantrell)
##### Bug Fixes
* "View on GitHub" is now only generated if a GitHub URL is specified.
[mbogh](https://github.com/mbogh)
[#244](https://github.com/realm/jazzy/issues/244)
* Empty extensions are no longer documented.
[Paul Cantrell](https://github.com/pcantrell)
* Undocumented enum cases are now supported.
[JP Simard](https://github.com/jpsim)
[#74](https://github.com/realm/jazzy/issues/74)
## 0.2.4
##### Breaking
* None.
##### Enhancements
* Improved how SourceKitten is vendored.
[JP Simard](https://github.com/jpsim)
* Show type declaration under its title.
[Paul Cantrell](https://github.com/pcantrell)
* Added support for custom assets: pass `--assets-directory` to jazzy.
[gurkendoktor](https://github.com/gurkendoktor)
* Added support for custom copyright text: pass `--copyright` to jazzy.
[emaloney](https://github.com/emaloney)
##### Bug Fixes
* Fixed a crash when parsing an empty documentation comment.
[JP Simard](https://github.com/jpsim)
[#236](https://github.com/realm/jazzy/issues/236)
* `--exclude` now works properly if its argument is a relative path.
[Paul Cantrell](https://github.com/pcantrell)
## 0.2.3
##### Breaking
* None.
##### Enhancements
* The `jazzy` CLI now accepts a `--swift-version` option (defaulting to 1.2),
and will automatically find an appropriate Xcode installation.
[Samuel Giddins](https://github.com/segiddins)
[#214](https://github.com/realm/jazzy/issues/214)
##### Bug Fixes
* Declarations with no USR will no longer be documented.
[JP Simard](https://github.com/jpsim)
## 0.2.2
##### Breaking
* None.
##### Enhancements
* Added support for custom templates: use the `-t`/`--template-directory`
argument to jazzy.
[JP Simard](https://github.com/jpsim)
[#20](https://github.com/realm/jazzy/issues/20)
##### Bug Fixes
* None.
## 0.2.1
##### Breaking
* None.
##### Enhancements
* Added the ability to ignore certain files by passing in an `-e`/`--exclude`
argument to jazzy.
[JP Simard](https://github.com/jpsim)
[#173](https://github.com/realm/jazzy/issues/173)
##### Bug Fixes
* None.
## 0.2.0
##### Breaking
* Jazzy now only supports projects using Swift 1.2.
[JP Simard](https://github.com/jpsim)
[#170](https://github.com/realm/jazzy/issues/170)
* Increase default minimum ACL to public.
[JP Simard](https://github.com/jpsim)
[#186](https://github.com/realm/jazzy/issues/186)
##### Enhancements
* Use `key.accessibility` to determine ACL (value coming from SourceKit, which
is generally more accurate than parsing the declaration for an accessibility
keyword).
[JP Simard](https://github.com/jpsim)
[#185](https://github.com/realm/jazzy/issues/185)
##### Bug Fixes
* None.
## 0.1.6
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Make the gem installable.
[Samuel Giddins](https://github.com/segiddins)
## 0.1.5
##### Breaking
* None.
##### Enhancements
* Added `--readme` command line option.
[segiddins](https://github.com/segiddins)
[#196](https://github.com/realm/jazzy/issues/196)
* Cleaned up front end HTML & CSS.
[JP Simard](https://github.com/jpsim)
[#95](https://github.com/realm/jazzy/issues/95)
* "Show on GitHub" links now link to line-ranges for multi-line definitions.
[JP Simard](https://github.com/jpsim)
[#198](https://github.com/realm/jazzy/issues/198)
##### Bug Fixes
* Fixed issue where docset would contain duplicate files.
[JP Simard](https://github.com/jpsim)
[#204](https://github.com/realm/jazzy/issues/204)
* Fixed installation issues on case-sensitive file systems.
[kishikawakatsumi](https://github.com/kishikawakatsumi)
* Fixed out-of-bounds exception when parsing the declaration in files starting
with a declaration.
[JP Simard](https://github.com/jpsim)
[#30](https://github.com/jpsim/SourceKitten/issues/30)
* Fixed out-of-bounds exception and inaccurate parsed declarations when using
multibyte characters.
[JP Simard](https://github.com/jpsim)
[#35](https://github.com/jpsim/SourceKitten/issues/35)
* Fixed parsing issues with keyword functions such as `subscript`, `init` and
`deinit`.
[JP Simard](https://github.com/jpsim)
[#27](https://github.com/jpsim/SourceKitten/issues/27)
* Fixed issues where USR wasn't accurate because dependencies couldn't be
resolved.
[JP Simard](https://github.com/jpsim)
* Allow using a version of Xcode that is symlinked to
`/Applications/Xcode.app`.
[Samuel Giddins](https://github.com/segiddins)
## 0.1.4
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* No longer count undocumented externally declared tokens as undocumented.
[JP Simard](https://github.com/jpsim)
[#188](https://github.com/realm/jazzy/issues/188)
## 0.1.3
##### Breaking
* None.
##### Enhancements
* Improve the styling of `dl` elements (parsed key-value pairs).
[segiddins](https://github.com/segiddins)
* Raise exceptions if Xcode requirements aren't met.
[JP Simard](https://github.com/jpsim)
##### Bug Fixes
* No longer count initializers with parameters as undocumented.
[JP Simard](https://github.com/jpsim)
[#183](https://github.com/realm/jazzy/issues/183)
* No longer crash when a token is missing a USR.
[JP Simard](https://github.com/jpsim)
[#171](https://github.com/realm/jazzy/issues/171)
* Fixed encoding issues in some environments.
[James Barrow](https://github.com/Baza207)
[#152](https://github.com/realm/jazzy/issues/152)
* No longer count undocumented externally declared tokens as undocumented.
[JP Simard](https://github.com/jpsim)
[#188](https://github.com/realm/jazzy/issues/188)
* Fixed `--source-directory` CLI option.
[JP Simard](https://github.com/jpsim)
[#177](https://github.com/realm/jazzy/issues/177)
## 0.1.2
##### Breaking
* None.
##### Enhancements
* Use Menlo for code everywhere.
[beltex](https://github.com/beltex)
[#137](https://github.com/realm/jazzy/issues/137)
##### Bug Fixes
* (Really) fixes installation as a RubyGem.
[beltex](https://github.com/beltex)
[#159](https://github.com/realm/jazzy/issues/159)
## 0.1.1
##### Breaking
* None.
##### Enhancements
* None.
##### Bug Fixes
* Fixes installation as a RubyGem.
[Samuel Giddins](https://github.com/segiddins)
[#159](https://github.com/realm/jazzy/issues/159)
## 0.1.0
[sourcekitten](https://github.com/jpsim/sourcekitten/compare/0.2.7...0.3.1)
##### Breaking
* None.
##### Enhancements
* Add the ability to document a Pod from just a podspec, which allows jazzy to
run on cocoadocs.org.
[Samuel Giddins](https://github.com/segiddins)
[#58](https://github.com/realm/jazzy/issues/58)
##### Bug Fixes
* De-duplicate the sidebar list of extensions and show all children for an
extension, regardless of how many extensions on a type there are.
[Samuel Giddins](https://github.com/segiddins)
## 0.0.20
[sourcekitten](https://github.com/jpsim/sourcekitten/compare/0.2.6...0.2.7)
##### Breaking
* Don't skip declarations with no documentation comments by default.
Allow skipping using `--skip-undocumented`.
[JP Simard](https://github.com/jpsim)
[#129](https://github.com/realm/jazzy/issues/129)
##### Enhancements
* Combine abstract and discussion in page overview.
[JP Simard](https://github.com/jpsim)
[#115](https://github.com/realm/jazzy/issues/115)
##### Bug Fixes
* Don't show 'Show in Github' link for types declared in system frameworks.
[JP Simard](https://github.com/jpsim)
[#110](https://github.com/realm/jazzy/issues/110)
## 0.0.19
[sourcekitten](https://github.com/jpsim/sourcekitten/compare/0.2.3...0.2.6)
##### Breaking
None.
##### Enhancements
* Added CHANGELOG.md.
[JP Simard](https://github.com/jpsim)
[#125](https://github.com/realm/jazzy/issues/125)
* Include parse errors in the JSON output & print to STDERR.
[JP Simard](https://github.com/jpsim)
[jpsim/sourcekitten#16](https://github.com/jpsim/sourcekitten/issues/16)
##### Bug Fixes
* Fixed crash when files contained a declaration on the first line.
[JP Simard](https://github.com/jpsim)
[jpsim/sourcekitten#14](https://github.com/jpsim/sourcekitten/issues/14)
* Fixed invalid JSON issue when last file in an Xcode project failed to parse.
[JP Simard](https://github.com/jpsim)
* Fixed crash when attempting to parse the declaration of `extension Array`.
[JP Simard](https://github.com/jpsim)
[#126](https://github.com/realm/jazzy/issues/126)
================================================
FILE: CONTRIBUTING.md
================================================
## Code of Conduct
This project adheres to the [Contributor Covenant Code of Conduct](https://realm.io/conduct).
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [info@realm.io](mailto:info@realm.io).
## Tracking changes
All changes should be made via pull requests on GitHub.
When issuing a pull request, please add a summary of your changes to
the `CHANGELOG.md` file.
We follow the same syntax as CocoaPods' CHANGELOG.md:
1. One Markdown unnumbered list item describing the change.
2. Two trailing spaces on the last line describing the change.
3. A list of Markdown hyperlinks to the contributors to the change. One entry
per line (and there's usually just one contributor).
4. A list of Markdown hyperlinks to the issues the change addresses. One entry
per line (and there's usually just one hyperlink). Don't link to PRs here.
5. All CHANGELOG.md content is hard-wrapped at 80 characters.
## Updating the integration specs
Jazzy heavily relies on integration tests, but since they're considerably large
and noisy, we keep them in a separate repo
([realm/jazzy-integration-specs](https://github.com/realm/jazzy-integration-specs)).
If you're making a PR towards jazzy that affects the generated docs, please
update the integration specs using the following process:
```shell
git checkout master
git pull
git checkout -
git rebase master
rake bootstrap
bundle exec rake rebuild_integration_fixtures
cd spec/integration_specs
git checkout -b $jazzy_branch_name
git commit -a -m "update for $jazzy_branch_name"
git push
cd ../../
git commit -a -m "update integration specs"
git push
```
You'll need push access to the integration specs repo to do this. You can
request access from one of the maintainers when filing your PR.
You must have Xcode 26.1 beta 1 installed to build the integration specs.
## Making changes to SourceKitten
When changes are landed in the https://github.com/jpsim/SourceKitten repo the
SourceKitten framework located in jazzy must be updated.
The following may be executed from your `jazzy/` directory.
```
cd SourceKitten
git checkout master
git pull
cd ..
rake sourcekitten
git add .
git commit -m "..."
```
================================================
FILE: Dangerfile
================================================
# frozen_string_literal: true
# Warn when there is a big PR
warn('Big PR') if git.lines_of_code > 500
# Don't let testing shortcuts get into master by accident
(git.modified_files + git.added_files - %w[Dangerfile]).each do |file|
next unless File.file?(file)
contents = File.read(file)
if file.start_with?('spec')
failure("`xit` or `fit` left in tests (#{file})") if contents =~ /^\w*[xf]it/
failure("`fdescribe` left in tests (#{file})") if contents =~ /^\w*fdescribe/
end
end
# Sometimes its a README fix, or something like that - which isn't relevant for
# including in a CHANGELOG for example
has_app_changes = !git.modified_files.grep(/lib/).empty?
has_test_changes = !git.modified_files.grep(/spec/).empty?
# Add a CHANGELOG entry for app changes
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
failure "Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/realm/jazzy/blob/master/CHANGELOG.md)."
message 'Note, we hard-wrap at 80 chars and use 2 spaces after the last line.'
end
# Non-trivial amounts of app changes without tests
if git.lines_of_code > 50 && has_app_changes && !has_test_changes
warn 'This PR may need tests.'
end
================================================
FILE: Gemfile
================================================
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec
group :development do
# Code style
gem 'rubocop', '~> 1.18'
# Tests
gem 'bacon'
gem 'mocha'
gem 'mocha-on-bacon'
gem 'prettybacon'
gem 'webmock'
# Integration tests
gem 'clintegracon', git: 'https://github.com/mrackwitz/CLIntegracon.git'
gem 'diffy'
# Code Review
gem 'danger'
end
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2014 Realm Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: ObjectiveC.md
================================================
This document is about Jazzy's Objective-C documentation generation.
It's intended for users who are having problems after trying to follow the
examples in the [README](README.md#objective-c). It gives some solutions to
common problems and explains how the system works to help users work through
uncommon problems.
* [How it works](#how-objective-c-docs-generation-works)
* Common problems:
* [Apple SDK include failure](#problem-apple-sdk-importinclude-failure)
* [Non-SDK include failure](#problem-non-sdk-include-failure)
* [Argument list too long](#problem-argument-list-too-long-e2big-and-more)
* [Enum cases with wrong doc comment](#problem-enum-cases-have-the-wrong-doc-comment)
* [Swift API versions missing](#problem-swift-api-versions-are-all-missing)
* [Swift API versions use `Any`](#problem-swift-api-versions-have-any-instead-of-type-name)
* [Structural `NS_SWIFT_NAME` not working](#problem-structural-ns_swift_name-not-working)
# How Objective-C docs generation works
Jazzy uses `libclang` to generate docs for Objective-C projects. You can think
of this as running some parts of the `clang` compiler against a header file.
Jazzy refers to this header file as the _umbrella header_ but it does not have
to be the umbrella header from a Clang module: it's just the header file that
includes everything to be documented.
This means there are two problems to solve:
1. What `clang` flags are required; and
2. How to pass them to the tools.
Jazzy has two modes here: a smart mode that covers 90% of projects and a direct mode where the user provides all the flags.
> *Important*: Jazzy does _not_ use any Objective-C build settings from your
Xcode project or `Package.swift`. If your project needs special settings
such as `#define`s then you need to repeat those in the Jazzy invocation.
## Direct mode
Passing a basic set of `clang` flags looks like this:
```shell
jazzy ...
--objc
--build-tool-arguments
--objc,MyProject/MyProject.h,--,-x,objective-c,
-isysroot,$(xcrun --show-sdk-path),
-I,$(pwd),
-fmodules
```
The `--build-tool-arguments` are arguments to `sourcekitten`. Everything after
the `--` are the `clang` flags that will be used with the header file given
before the `--`.
You can try these flags outside of Jazzy's environment:
```shell
clang -c -x objective-c -isysroot $(xcrun --show-sdk-path) -I $(pwd) MyProject/MyProject.h -fmodules
```
(The `-c` stops `clang` from trying to link an executable.)
This is a good method of experimenting with compiler flags to get a working
build without getting bogged down in the Jazzy and SourceKitten layers.
## Smart mode
The smart mode takes the variable parts of the basic set of flags and maps
them from Jazzy flags:
```shell
jazzy ...
--objc
--umbrella-header MyProject/MyProject.h
--framework-root $(pwd)
[--sdk
Jazzy is maintained and funded by Realm Inc. The names and logos for
Realm are trademarks of Realm Inc.
We :heart: open source software!
See [our other open source projects](https://github.com/realm),
read [our blog](https://realm.io/news) or say hi on twitter
([@realm](https://twitter.com/realm)).
[clang]: https://clang.llvm.org "Clang"
[sourcekit]: https://www.jpsim.com/uncovering-sourcekit "Uncovering SourceKit"
[ast]: https://clang.llvm.org/docs/IntroductionToTheClangAST.html "Introduction To The Clang AST"
[xcode]: https://developer.apple.com/xcode "Xcode"
[SourceKitten]: https://github.com/jpsim/SourceKitten "SourceKitten"
[bundler]: https://rubygems.org/gems/bundler
[mustache]: https://mustache.github.io "Mustache"
[spm]: https://swift.org/package-manager/ "Swift Package Manager"
[dash]: https://kapeli.com/dash/ "Dash"
================================================
FILE: Rakefile
================================================
# frozen_string_literal: true
#-- Bootstrap --------------------------------------------------------------#
desc 'Initializes your working copy to run the specs'
task :bootstrap do
if system('which bundle')
title 'Installing gems'
sh 'bundle install'
title 'Updating submodules'
sh 'git submodule update --init --recursive'
else
warn "\033[0;31m" \
"[!] Please install the bundler gem manually:\n" \
' $ [sudo] gem install bundler' \
"\e[0m"
exit 1
end
end
begin
require 'bundler/gem_tasks'
require 'fileutils'
task default: :spec
#-- Specs ------------------------------------------------------------------#
desc 'Run specs'
task :spec do
title 'Running Tests'
Rake::Task['unit_spec'].invoke
Rake::Task['objc_spec'].invoke
Rake::Task['swift_spec'].invoke
Rake::Task['cocoapods_spec'].invoke
Rake::Task['rubocop'].invoke
end
desc 'Run unit specs'
task :unit_spec do
files = FileList['spec/*_spec.rb']
.exclude('spec/integration_spec.rb').shuffle.join(' ')
sh "bundle exec bacon #{files}"
end
desc 'Run objc integration specs'
task :objc_spec do
sh 'JAZZY_SPEC_SUBSET=objc bundle exec bacon spec/integration_spec.rb'
end
desc 'Run swift integration specs'
task :swift_spec do
sh 'JAZZY_SPEC_SUBSET=swift bundle exec bacon spec/integration_spec.rb'
end
desc 'Run cocoapods integration specs'
task :cocoapods_spec do
sh 'JAZZY_SPEC_SUBSET=cocoapods bundle exec bacon spec/integration_spec.rb'
end
desc 'Rebuilds integration fixtures'
task :rebuild_integration_fixtures do
title 'Running Integration tests'
sh 'rm -rf spec/integration_specs/tmp'
puts `bundle exec bacon spec/integration_spec.rb`
title 'Storing fixtures'
# Copy the files to the files produced by the specs to the after folders
FileList['tmp/*'].each do |source|
destination = "spec/integration_specs/#{source.gsub('tmp/', '')}/after"
if File.exist?(destination)
sh "rm -rf #{destination}"
sh "mv #{source}/transformed #{destination}"
end
end
# Remove files not used for the comparison
# To keep the git diff clean
specs_root = 'spec/integration_specs/*/after'
files_glob = "#{specs_root}/{*,.*}"
files_to_delete = FileList[files_glob]
.exclude('**/.', '**/..')
.exclude("#{specs_root}/*docs",
"#{specs_root}/execution_output.txt")
.include("#{specs_root}/**/*.dsidx")
.include("#{specs_root}/**/*.tgz")
files_to_delete.each do |file_to_delete|
sh "rm -rf '#{file_to_delete}'"
end
puts
puts 'Integration fixtures updated, see `spec/integration_specs`'
end
#-- RuboCop ----------------------------------------------------------------#
desc 'Runs RuboCop linter on Ruby files'
task :rubocop do
sh 'bundle exec rubocop'
end
#-- SourceKitten -----------------------------------------------------------#
desc 'Vendors SourceKitten'
task :sourcekitten do
sk_dir = 'SourceKitten'
bin_path = Dir.chdir(sk_dir) do
build_cmd = 'swift build -c release --arch arm64 --arch x86_64'
`#{build_cmd}`
`#{build_cmd} --show-bin-path`.chomp
end
FileUtils.cp_r "#{bin_path}/sourcekitten", 'bin'
end
#-- Theme Dependencies -----------------------------------------------------#
THEME_FILES = {
'jquery/dist/jquery.min.js' => [
'themes/apple/assets/js',
'themes/fullwidth/assets/js',
'themes/jony/assets/js',
],
'lunr/lunr.min.js' => [
'themes/apple/assets/js',
'themes/fullwidth/assets/js',
],
'corejs-typeahead/dist/typeahead.jquery.js' => [
'themes/apple/assets/js',
'themes/fullwidth/assets/js',
],
'katex/dist/katex.min.css' => ['extensions/katex/css'],
'katex/dist/fonts' => ['extensions/katex/css'],
'katex/dist/katex.min.js' => ['extensions/katex/js'],
}.freeze
desc 'Copies theme dependencies (`npm update/install` by hand first)'
task :theme_deps do
THEME_FILES.each_pair do |src, dsts|
dsts.each do |dst|
FileUtils.cp_r "js/node_modules/#{src}", "lib/jazzy/#{dst}"
end
end
end
rescue LoadError, NameError => e
warn "\033[0;31m" \
'[!] Some Rake tasks haven been disabled because the environment' \
' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
"\e[0m"
warn e.message
warn e.backtrace
warn ''
end
#-- Helpers ------------------------------------------------------------------#
def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
puts
puts '-' * 80
puts cyan_title
puts '-' * 80
puts
end
================================================
FILE: bin/jazzy
================================================
#!/usr/bin/env ruby
# frozen_string_literal: true
if $PROGRAM_NAME == __FILE__ && !ENV['JAZZY_NO_BUNDLER']
ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', __dir__)
require 'rubygems'
require 'bundler/setup'
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
elsif ENV['JAZZY_NO_BUNDLER']
require 'rubygems'
gem 'jazzy'
end
require 'jazzy'
Jazzy::DocBuilder.build(Jazzy::Config.instance = Jazzy::Config.parse!)
================================================
FILE: jazzy.gemspec
================================================
# coding: utf-8
# frozen_string_literal: true
require File.expand_path('lib/jazzy/gem_version.rb', File.dirname(__FILE__))
Gem::Specification.new do |spec|
spec.name = 'jazzy'
spec.version = Jazzy::VERSION
spec.authors = ['JP Simard', 'Tim Anglade', 'Samuel Giddins', 'John Fairhurst']
spec.email = ['jp@jpsim.com']
spec.summary = 'Soulful docs for Swift & Objective-C.'
spec.description = 'Soulful docs for Swift & Objective-C. ' \
"Run in your SPM or Xcode project's root directory for " \
'instant HTML docs.'
spec.homepage = 'https://github.com/realm/jazzy'
spec.license = 'MIT'
spec.files = `git ls-files`.split($/)
spec.executables << 'jazzy'
spec.add_dependency 'activesupport', '>= 5.0', '< 8'
spec.add_dependency 'cocoapods', '~> 1.5'
spec.add_dependency 'logger'
spec.add_dependency 'mustache', '~> 1.1'
spec.add_dependency 'open4', '~> 1.3'
spec.add_dependency 'redcarpet', '~> 3.4'
spec.add_dependency 'rexml', ['>= 3.2.7', '< 4.0']
spec.add_dependency 'rouge', ['>= 2.0.6', '< 5.0']
spec.add_dependency 'sassc', '~> 2.1'
spec.add_dependency 'sqlite3', '~> 1.3'
spec.add_dependency 'xcinvoke', '~> 0.3.0'
spec.add_development_dependency 'bundler', '~> 2.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.required_ruby_version = '>= 2.6.3'
spec.metadata['rubygems_mfa_required'] = 'true'
end
================================================
FILE: js/package.json
================================================
{
"name": "jazzy-js",
"version": "1.0.0",
"description": "Jazzy theme dependencies",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"dependencies": {
"corejs-typeahead": "^1.3.1",
"jquery": "^3.7.1",
"katex": "^0.16.8",
"lunr": "^2.3.9"
}
}
================================================
FILE: lib/jazzy/config.rb
================================================
# frozen_string_literal: true
require 'optparse'
require 'pathname'
require 'uri'
require 'jazzy/podspec_documenter'
require 'jazzy/source_declaration/access_control_level'
module Jazzy
# rubocop:disable Metrics/ClassLength
class Config
# rubocop:disable Naming/AccessorMethodName
class Attribute
attr_reader :name, :description, :command_line, :config_file_key,
:default, :parse, :per_module
def initialize(name, description: nil, command_line: nil,
default: nil, parse: ->(x) { x }, per_module: false)
@name = name.to_s
@description = Array(description)
@command_line = Array(command_line)
@default = default
@parse = parse
@config_file_key = full_command_line_name || @name
@per_module = per_module
end
def get(config)
config.method(name).call
end
def set_raw(config, val)
config.method("#{name}=").call(val)
end
def set(config, val, mark_configured: true)
set_raw(config, config.instance_exec(val, &parse))
config.method("#{name}_configured=").call(true) if mark_configured
end
def set_to_default(config)
set(config, default, mark_configured: false) if default
end
def set_if_unconfigured(config, val)
set(config, val) unless configured?(config)
end
def configured?(config)
config.method("#{name}_configured").call
end
def attach_to_option_parser(config, opt)
return if command_line.empty?
opt.on(*command_line, *description) do |val|
set(config, val)
end
end
private
def full_command_line_name
long_option_names = command_line.map do |opt|
Regexp.last_match(1) if opt.to_s =~ %r{
^-- # starts with double dash
(?:\[no-\])? # optional prefix for booleans
([^\s]+) # long option name
}x
end
if long_option_name = long_option_names.compact.first
long_option_name.tr('-', '_')
end
end
end
# rubocop:enable Naming/AccessorMethodName
def self.config_attr(name, **opts)
attr_accessor name
attr_accessor "#{name}_configured"
@all_config_attrs ||= []
@all_config_attrs << Attribute.new(name, **opts)
end
def self.alias_config_attr(name, forward, **opts)
alias_method name.to_s, forward.to_s
alias_method "#{name}=", "#{forward}="
alias_method "#{name}_configured", "#{forward}_configured"
alias_method "#{name}_configured=", "#{forward}_configured="
@all_config_attrs << Attribute.new(name, **opts)
end
class << self
attr_reader :all_config_attrs
end
attr_accessor :base_path
def expand_glob_path(path)
Pathname(path).expand_path(base_path) # nil means Pathname.pwd
end
def expand_path(path)
abs_path = expand_glob_path(path)
Pathname(Dir[abs_path][0] || abs_path) # Use existing filesystem spelling
end
def hide_swift?
hide_declarations == 'swift'
end
def hide_objc?
hide_declarations == 'objc'
end
# ──────── Build ────────
# rubocop:disable Layout/ArgumentAlignment
config_attr :output,
description: 'Folder to output the HTML docs to',
command_line: ['-o', '--output FOLDER'],
default: 'docs',
parse: ->(o) { expand_path(o) }
config_attr :clean,
command_line: ['-c', '--[no-]clean'],
description: ['Delete contents of output directory before running. ',
'WARNING: If --output is set to ~/Desktop, this will ' \
'delete the ~/Desktop directory.'],
default: false
config_attr :objc_mode,
command_line: '--[no-]objc',
description: 'Generate docs for Objective-C.',
default: false,
per_module: true
config_attr :umbrella_header,
command_line: '--umbrella-header PATH',
description: 'Umbrella header for your Objective-C framework.',
parse: ->(uh) { expand_path(uh) },
per_module: true
config_attr :framework_root,
command_line: '--framework-root PATH',
description: 'The root path to your Objective-C framework.',
parse: ->(fr) { expand_path(fr) },
per_module: true
config_attr :sdk,
command_line: '--sdk [iphone|watch|appletv][os|simulator]|macosx',
description: 'The SDK for which your code should be built.',
default: 'macosx',
per_module: true
config_attr :hide_declarations,
command_line: '--hide-declarations [objc|swift] ',
description: 'Hide declarations in the specified language. Given that ' \
'generating Swift docs only generates Swift declarations, ' \
'this is useful for hiding a specific interface for ' \
'either Objective-C or mixed Objective-C and Swift ' \
'projects.',
default: ''
config_attr :keep_property_attributes,
command_line: '--[no-]keep-property-attributes',
description: 'Include the default Objective-C property attributes.',
default: false
config_attr :config_file,
command_line: '--config PATH',
description: ['Configuration file (.yaml or .json)',
'Default: .jazzy.yaml in source directory or ancestor'],
parse: ->(cf) { expand_path(cf) }
config_attr :build_tool_arguments,
command_line: ['-b', '--build-tool-arguments arg1,arg2,…argN', Array],
description: 'Arguments to forward to xcodebuild, swift build, or ' \
'sourcekitten.',
default: [],
per_module: true
config_attr :modules,
command_line: ['--modules Mod1,Mod2,…ModN', Array],
description: 'List of modules to document. Use the config file to set per-module ' \
"build flags, see 'Documenting multiple modules' in the README.",
default: []
alias_config_attr :xcodebuild_arguments, :build_tool_arguments,
command_line: ['-x', '--xcodebuild-arguments arg1,arg2,…argN', Array],
description: 'Back-compatibility alias for build_tool_arguments.'
config_attr :sourcekitten_sourcefile,
command_line: ['-s', '--sourcekitten-sourcefile filepath1,…filepathN',
Array],
description: 'File(s) generated from sourcekitten output to parse',
parse: ->(paths) { [paths].flatten.map { |path| expand_path(path) } },
default: [],
per_module: true
config_attr :source_directory,
command_line: '--source-directory DIRPATH',
description: 'The directory that contains the source to be documented',
default: Pathname.pwd,
parse: ->(sd) { expand_path(sd) },
per_module: true
config_attr :symbolgraph_directory,
command_line: '--symbolgraph-directory DIRPATH',
description: 'A directory containing a set of Swift Symbolgraph files ' \
'representing the module to be documented',
parse: ->(sd) { expand_path(sd) },
per_module: true
config_attr :excluded_files,
command_line: ['-e', '--exclude filepath1,filepath2,…filepathN', Array],
description: 'Source file pathnames to be excluded from documentation. ' \
'Supports wildcards.',
default: [],
parse: ->(files) do
Array(files).map { |f| expand_glob_path(f).to_s }
end
config_attr :included_files,
command_line: ['-i', '--include filepath1,filepath2,…filepathN', Array],
description: 'Source file pathnames to be included in documentation. ' \
'Supports wildcards.',
default: [],
parse: ->(files) do
Array(files).map { |f| expand_glob_path(f).to_s }
end
config_attr :swift_version,
command_line: '--swift-version VERSION',
default: nil,
parse: ->(v) do
if v.to_s.empty?
nil
elsif v.to_f < 2
raise 'jazzy only supports Swift 2.0 or later.'
else
v
end
end
SWIFT_BUILD_TOOLS = %w[spm xcodebuild symbolgraph].freeze
config_attr :swift_build_tool,
command_line: "--swift-build-tool #{SWIFT_BUILD_TOOLS.join(' | ')}",
description: 'Control whether Jazzy uses Swift Package Manager, ' \
'xcodebuild, or swift-symbolgraph to build the module ' \
'to be documented. By default it uses xcodebuild if ' \
'there is a .xcodeproj file in the source directory.',
parse: ->(tool) do
return tool.to_sym if SWIFT_BUILD_TOOLS.include?(tool)
raise "Unsupported swift_build_tool #{tool}, " \
"supported values: #{SWIFT_BUILD_TOOLS.join(', ')}"
end
# ──────── Metadata ────────
config_attr :author_name,
command_line: ['-a', '--author AUTHOR_NAME'],
description: 'Name of author to attribute in docs (e.g. Realm)',
default: ''
config_attr :author_url,
command_line: ['-u', '--author_url URL'],
description: 'Author URL of this project (e.g. https://realm.io)',
default: '',
parse: ->(u) { URI(u) }
config_attr :module_name,
command_line: ['-m', '--module MODULE_NAME'],
description: 'Name of module being documented. (e.g. RealmSwift)',
default: '',
per_module: true
config_attr :version,
command_line: '--module-version VERSION',
description: 'Version string to use as part of the default docs ' \
'title and inside the docset.',
default: '1.0'
config_attr :title,
command_line: '--title TITLE',
description: 'Title to display at the top of each page, overriding the ' \
'default generated from module name and version.',
default: ''
config_attr :copyright,
command_line: '--copyright COPYRIGHT_MARKDOWN',
description: 'copyright markdown rendered at the bottom of the docs pages'
config_attr :readme_path,
command_line: '--readme FILEPATH',
description: 'The path to a markdown README file',
parse: ->(rp) { expand_path(rp) }
config_attr :readme_title,
command_line: '--readme-title TITLE',
description: 'The title for the README in the generated documentation'
config_attr :documentation_glob,
command_line: '--documentation GLOB',
description: 'Glob that matches available documentation',
parse: ->(dg) { Pathname.glob(dg) }
config_attr :abstract_glob,
command_line: '--abstract GLOB',
description: 'Glob that matches available abstracts for categories',
parse: ->(ag) { Pathname.glob(ag) }
config_attr :podspec,
command_line: '--podspec FILEPATH',
description: 'A CocoaPods Podspec that describes the Swift library to ' \
'document',
parse: ->(ps) { PodspecDocumenter.create_podspec(Pathname(ps)) if ps },
default: Dir['*.podspec{,.json}'].first
config_attr :pod_sources,
command_line: ['--pod-sources url1,url2,…urlN', Array],
description: 'A list of sources to find pod dependencies. Used only ' \
'with --podspec when the podspec contains references to ' \
'privately hosted pods. You must include the default pod ' \
'source if public pods are also used.',
default: []
config_attr :docset_icon,
command_line: '--docset-icon FILEPATH',
parse: ->(di) { expand_path(di) }
config_attr :docset_path,
command_line: '--docset-path DIRPATH',
description: 'The relative path for the generated docset'
config_attr :docset_title,
command_line: '--docset-title TITLE',
description: 'The title of the generated docset. A simplified version ' \
'is used for the filenames associated with the docset. If the ' \
'option is not set then the name of the module being documented is ' \
'used as the docset title.'
# ──────── URLs ────────
config_attr :root_url,
command_line: ['-r', '--root-url URL'],
description: 'Absolute URL root where these docs will be stored',
# ensure trailing slash for correct URI.join()
parse: ->(r) { URI(r.sub(%r{/?$}, '/')) }
config_attr :dash_url,
command_line: ['-d', '--dash_url URL'],
description: 'Location of the dash XML feed ' \
'e.g. https://realm.io/docsets/realm.xml)',
parse: ->(d) { URI(d) }
SOURCE_HOSTS = %w[github gitlab bitbucket].freeze
config_attr :source_host,
command_line: "--source-host #{SOURCE_HOSTS.join(' | ')}",
description: ['The source-code hosting site to be linked from documentation.',
'This setting affects the logo image and link format.',
"Default: 'github'"],
default: 'github',
parse: ->(host) do
return host.to_sym if SOURCE_HOSTS.include?(host)
raise "Unsupported source_host '#{host}', " \
"supported values: #{SOURCE_HOSTS.join(', ')}"
end
config_attr :source_host_url,
command_line: ['--source-host-url URL'],
description: ["URL to link from the source host's logo.",
'For example https://github.com/realm/realm-cocoa'],
parse: ->(g) { URI(g) }
alias_config_attr :github_url, :source_host_url,
command_line: ['-g', '--github_url URL'],
description: 'Back-compatibility alias for source_host_url.'
config_attr :source_host_files_url,
command_line: '--source-host-files-url PREFIX',
description: [
"The base URL on the source host of the project's files, to link " \
'from individual declarations.',
'For example https://github.com/realm/realm-cocoa/tree/v0.87.1',
]
alias_config_attr :github_file_prefix, :source_host_files_url,
command_line: '--github-file-prefix PREFIX',
description: 'Back-compatibility alias for source_host_files_url'
config_attr :docset_playground_url,
command_line: '--docset-playground-url URL',
description: 'URL of an interactive playground to demonstrate the ' \
'framework, linked to from the docset.'
# ──────── Doc generation options ────────
config_attr :disable_search,
command_line: '--disable-search',
description: 'Avoid generating a search index. ' \
'Search is available in some themes.',
default: false
config_attr :skip_documentation,
command_line: '--skip-documentation',
description: 'Will skip the documentation generation phase.',
default: false
config_attr :min_acl,
command_line:
'--min-acl [private | fileprivate | internal | package | public | open]',
description: 'minimum access control level to document',
default: 'public',
parse: ->(acl) do
SourceDeclaration::AccessControlLevel.from_human_string(acl)
end
config_attr :skip_undocumented,
command_line: '--[no-]skip-undocumented',
description: "Don't document declarations that have no documentation " \
'comments.',
default: false
config_attr :hide_documentation_coverage,
command_line: '--[no-]hide-documentation-coverage',
description: 'Hide "(X% documented)" from the generated documents',
default: false
config_attr :custom_categories,
description: 'Custom navigation categories to replace the standard ' \
"'Classes', 'Protocols', etc. Types not explicitly named " \
'in a custom category appear in generic groups at the ' \
'end. Example: https://git.io/v4Bcp',
default: []
config_attr :custom_categories_unlisted_prefix,
description: "Prefix for navigation section names that aren't " \
'explicitly listed in `custom_categories`.',
default: 'Other '
config_attr :hide_unlisted_documentation,
command_line: '--[no-]hide-unlisted-documentation',
description: "Don't include documentation in the sidebar from the " \
"`documentation` config value that aren't explicitly " \
'listed in `custom_categories`.',
default: false
config_attr :custom_head,
command_line: '--head HTML',
description: 'Custom HTML to inject into .',
default: ''
BUILTIN_THEME_DIR = Pathname(__dir__) + 'themes'
BUILTIN_THEMES = BUILTIN_THEME_DIR.children(false).map(&:to_s)
config_attr :theme_directory,
command_line: "--theme [#{BUILTIN_THEMES.join(' | ')} | DIRPATH]",
description: "Which theme to use. Specify either 'apple' (default), " \
'one of the other built-in theme names, or the path to ' \
'your mustache templates and other assets for a custom ' \
'theme.',
default: 'apple',
parse: ->(t) do
if BUILTIN_THEMES.include?(t)
BUILTIN_THEME_DIR + t
else
expand_path(t)
end
end
config_attr :use_safe_filenames,
command_line: '--use-safe-filenames',
description: 'Replace unsafe characters in filenames with an encoded ' \
'representation. This will reduce human readability of ' \
'some URLs, but may be necessary for projects that ' \
'expose filename-unfriendly functions such as /(_:_:)',
default: false
config_attr :template_directory,
command_line: ['-t', '--template-directory DIRPATH'],
description: 'DEPRECATED: Use --theme instead.',
parse: ->(_) do
raise '--template-directory (-t) is deprecated: use --theme instead.'
end
config_attr :assets_directory,
command_line: '--assets-directory DIRPATH',
description: 'DEPRECATED: Use --theme instead.',
parse: ->(_) do
raise '--assets-directory is deprecated: use --theme instead.'
end
config_attr :undocumented_text,
command_line: '--undocumented-text UNDOCUMENTED_TEXT',
description: 'Default text for undocumented symbols. The default ' \
'is "Undocumented", put "" if no text is required',
default: 'Undocumented'
config_attr :separate_global_declarations,
command_line: '--[no-]separate-global-declarations',
description: 'Create separate pages for all global declarations ' \
"(classes, structures, enums etc.) even if they don't " \
'have children.',
default: false
config_attr :include_spi_declarations,
command_line: '--[no-]include-spi-declarations',
description: 'Include Swift declarations marked `@_spi` even if ' \
'--min-acl is set to `public` or `open`.',
default: false
MERGE_MODULES = %w[all extensions none].freeze
config_attr :merge_modules,
command_line: "--merge-modules #{MERGE_MODULES.join(' | ')}",
description: 'Control how to display declarations from multiple ' \
'modules. `all`, the default, places all declarations of the ' \
"same kind together. `none` keeps each module's declarations " \
'separate. `extensions` is like `none` but merges ' \
'cross-module extensions into their extended type.',
default: 'all',
parse: ->(merge) do
return merge.to_sym if MERGE_MODULES.include?(merge)
raise "Unsupported merge_modules #{merge}, " \
"supported values: #{MERGE_MODULES.join(', ')}"
end
# rubocop:enable Layout/ArgumentAlignment
def initialize
self.class.all_config_attrs.each do |attr|
attr.set_to_default(self)
end
end
def theme_directory=(theme_directory)
@theme_directory = theme_directory
Doc.template_path = theme_directory + 'templates'
end
def self.parse!
config = new
config.parse_command_line
config.parse_config_file
PodspecDocumenter.apply_config_defaults(config.podspec, config)
config.set_module_configs
config.validate
config
end
def warning(message)
warn "WARNING: #{message}"
end
# rubocop:disable Metrics/MethodLength
def parse_command_line
OptionParser.new do |opt|
opt.banner = 'Usage: jazzy'
opt.separator ''
opt.separator 'Options'
self.class.all_config_attrs.each do |attr|
attr.attach_to_option_parser(self, opt)
end
opt.on('-v', '--version', 'Print version number') do
puts "jazzy version: #{Jazzy::VERSION}"
exit
end
opt.on('-h', '--help [TOPIC]', 'Available topics:',
' usage Command line options (this help message)',
' config Configuration file options',
'...or an option keyword, e.g. "dash"') do |topic|
case topic
when 'usage', nil
puts opt
when 'config'
print_config_file_help
else
print_option_help(topic)
end
exit
end
end.parse!
unless ARGV.empty?
warning "Leftover unused command-line text: #{ARGV}"
end
end
def parse_config_file
config_path = locate_config_file
return unless config_path
self.base_path = config_path.parent
puts "Using config file #{config_path}"
config_file = read_config_file(config_path)
attrs_by_conf_key, attrs_by_name = grouped_attributes
parse_config_hash(config_file, attrs_by_conf_key, attrs_by_name)
end
def parse_config_hash(hash, attrs_by_conf_key, attrs_by_name, override: false)
hash.each do |key, value|
unless attr = attrs_by_conf_key[key]
message = "Unknown config file attribute #{key.inspect}"
if matching_name = attrs_by_name[key]
message +=
" (Did you mean #{matching_name.first.config_file_key.inspect}?)"
end
warning message
next
end
setter = override ? :set : :set_if_unconfigured
attr.first.method(setter).call(self, value)
end
end
# Find keyed versions of the attributes, by config file key and then name-in-code
# Optional block allows filtering/overriding of attribute list.
def grouped_attributes
attrs = self.class.all_config_attrs
attrs = yield attrs if block_given?
%i[config_file_key name].map do |property|
attrs.group_by(&property)
end
end
def validate
if source_host_configured &&
source_host_url.nil? &&
source_host_files_url.nil?
warning 'Option `source_host` is set but has no effect without either ' \
'`source_host_url` or `source_host_files_url`.'
end
if modules_configured && module_name_configured
raise 'Options `modules` and `module` are both set which is not supported. ' \
'To document multiple modules, use just `modules`.'
end
if modules_configured && podspec_configured
raise 'Options `modules` and `podspec` are both set which is not supported.'
end
module_configs.each(&:validate_module)
end
def validate_module
if objc_mode &&
build_tool_arguments_configured &&
(framework_root_configured || umbrella_header_configured)
warning 'Option `build_tool_arguments` is set: values passed to ' \
'`framework_root` or `umbrella_header` may be ignored.'
end
end
# rubocop:enable Metrics/MethodLength
# Module Configs
#
# The user can enter module information in three different ways. This
# consolidates them into one view for the rest of the code.
#
# 1) Single module, back-compatible
# --module Foo etc etc (or not given at all)
#
# 2) Multiple modules, simple, sharing build params
# --modules Foo,Bar,Baz --source-directory Xyz
#
# 3) Multiple modules, custom, different build params but
# inheriting others from the top level.
# This is config-file only.
# - modules
# - module: Foo
# source_directory: Xyz
# build_tool_arguments: [a, b, c]
#
# After this we're left with `config.module_configs` that is an
# array of `Config` objects.
attr_reader :module_configs
attr_reader :module_names
def set_module_configs
@module_configs = parse_module_configs
@module_names = module_configs.map(&:module_name)
@module_names_set = Set.new(module_names)
end
def module_name?(name)
@module_names_set.include?(name)
end
def multiple_modules?
@module_names.count > 1
end
def parse_module_configs
return [self] unless modules_configured
raise 'Config file key `modules` must be an array' unless modules.is_a?(Array)
if modules.first.is_a?(String)
# Massage format (2) into (3)
self.modules = modules.map { |mod| { 'module' => mod } }
end
# Allow per-module overrides of only some config options
attrs_by_conf_key, attrs_by_name =
grouped_attributes { |attr| attr.select(&:per_module) }
modules.map do |module_hash|
mod_name = module_hash['module'] || ''
raise 'Missing `modules.module` config key' if mod_name.empty?
dup.tap do |module_config|
module_config.parse_config_hash(
module_hash, attrs_by_conf_key, attrs_by_name, override: true
)
end
end
end
# For podspec query
def module_name_known?
module_name_configured || modules_configured
end
def locate_config_file
return config_file if config_file
source_directory.ascend do |dir|
candidate = dir.join('.jazzy.yaml')
return candidate if candidate.exist?
end
nil
end
def read_config_file(file)
case File.extname(file)
when '.json'
JSON.parse(File.read(file))
when '.yaml', '.yml'
YAML.safe_load(File.read(file))
else raise "Config file must be .yaml or .json, but got #{file.inspect}"
end
end
def print_config_file_help
puts <<-_EOS_
By default, jazzy looks for a file named ".jazzy.yaml" in the source
directory and its ancestors. You can override the config file location
with --config.
(The source directory is the current working directory by default.
You can override that with --source-directory.)
The config file can be in YAML or JSON format. Available options are:
_EOS_
.gsub(/^ +/, '')
print_option_help
end
def print_option_help(topic = '')
found = false
self.class.all_config_attrs.each do |attr|
match = ([attr.name] + attr.command_line).any? do |opt|
opt.to_s.include?(topic)
end
if match
found = true
puts
puts attr.name.to_s.tr('_', ' ').upcase
puts
puts " Config file: #{attr.config_file_key}"
cmd_line_forms = attr.command_line.select { |opt| opt.is_a?(String) }
if cmd_line_forms.any?
puts " Command line: #{cmd_line_forms.join(', ')}"
end
puts
print_attr_description(attr)
end
end
warn "Unknown help topic #{topic.inspect}" unless found
end
def print_attr_description(attr)
attr.description.each { |line| puts " #{line}" }
if attr.default && attr.default != ''
puts " Default: #{attr.default}"
end
end
#-------------------------------------------------------------------------#
# @!group Singleton
# @return [Config] the current config instance creating one if needed.
#
def self.instance
@instance ||= new
end
# Sets the current config instance. If set to nil the config will be
# recreated when needed.
#
# @param [Config, Nil] the instance.
#
# @return [void]
#
class << self
attr_writer :instance
end
# Provides support for accessing the configuration instance in other
# scopes.
#
module Mixin
def config
Config.instance
end
end
end
# rubocop:enable Metrics/ClassLength
end
================================================
FILE: lib/jazzy/doc.rb
================================================
# frozen_string_literal: true
require 'date'
require 'pathname'
require 'mustache'
require 'jazzy/config'
require 'jazzy/gem_version'
require 'jazzy/jazzy_markdown'
module Jazzy
class Doc < Mustache
include Config::Mixin
self.template_name = 'doc'
def copyright
copyright = config.copyright || (
# Fake date is used to keep integration tests consistent
date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
year = date[0..3]
"© #{year} [#{config.author_name}](#{config.author_url}). " \
"All rights reserved. (Last updated: #{date})"
)
Markdown.render_copyright(copyright).chomp
end
def jazzy_version
# Fake version is used to keep integration tests consistent
ENV['JAZZY_FAKE_VERSION'] || Jazzy::VERSION
end
def objc_first?
config.objc_mode && config.hide_declarations != 'objc'
end
def language_stub
objc_first? ? 'objc' : 'swift'
end
def module_version
config.version_configured ? config.version : nil
end
def docs_title
if config.title_configured
config.title
elsif config.version_configured
# Fake version for integration tests
version = ENV['JAZZY_FAKE_MODULE_VERSION'] || config.version
"#{config.module_configs.first.module_name} #{version} Docs"
else
"#{config.module_configs.first.module_name} Docs"
end
end
def enable_katex
Markdown.has_math
end
end
end
================================================
FILE: lib/jazzy/doc_builder.rb
================================================
# frozen_string_literal: true
require 'fileutils'
require 'mustache'
require 'pathname'
require 'sassc'
require 'jazzy/config'
require 'jazzy/doc'
require 'jazzy/docset_builder'
require 'jazzy/documentation_generator'
require 'jazzy/search_builder'
require 'jazzy/jazzy_markdown'
require 'jazzy/podspec_documenter'
require 'jazzy/source_declaration'
require 'jazzy/source_document'
require 'jazzy/source_module'
require 'jazzy/sourcekitten'
require 'jazzy/symbol_graph'
module Jazzy
# This module handles HTML generation, file writing, asset copying,
# and generally building docs given sourcekitten output
module DocBuilder
# mkdir -p output directory and clean if option is set
def self.prepare_output_dir(output_dir, clean)
FileUtils.rm_r output_dir if clean && output_dir.directory?
FileUtils.mkdir_p output_dir
end
# Generate doc structure to be used in sidebar navigation
# @return [Array] doc structure comprised of
# section names & child names & URLs
def self.doc_structure_for_docs(docs)
docs
.map do |doc|
children = children_for_doc(doc)
{
section: doc.name,
url: doc.url,
children: children,
}
end
.select do |structure|
if Config.instance.hide_unlisted_documentation
unlisted_prefix = Config.instance.custom_categories_unlisted_prefix
structure[:section] != "#{unlisted_prefix}Guides"
else
true
end
end
end
def self.children_for_doc(doc)
doc.children
.sort_by { |c| [c.nav_order, c.name, c.usr || ''] }
.flat_map do |child|
# FIXME: include arbitrarily nested extensible types
[{ name: child.name, url: child.url }] +
Array(child.children.select do |sub_child|
sub_child.type.swift_extensible? || sub_child.type.extension?
end).map do |sub_child|
{ name: "– #{sub_child.name}", url: sub_child.url }
end
end
end
# Build documentation from the given options
# @param [Config] options
def self.build(options)
module_jsons = options.module_configs.map do |module_config|
if module_config.podspec_configured
# Config#validate guarantees not multi-module here
pod_documenter = PodspecDocumenter.new(options.podspec)
pod_documenter.sourcekitten_output(options)
elsif !module_config.sourcekitten_sourcefile.empty?
"[#{module_config.sourcekitten_sourcefile.map(&:read).join(',')}]"
elsif module_config.swift_build_tool == :symbolgraph
SymbolGraph.build(module_config)
else
Dir.chdir(module_config.source_directory) do
arguments = SourceKitten.arguments_from_options(module_config)
SourceKitten.run_sourcekitten(arguments)
end
end
end
build_docs_for_sourcekitten_output(module_jsons, options)
end
# Build & write HTML docs to disk from structured docs array
# @param [String] output_dir Root directory to write docs
# @param [SourceModule] source_module All info to generate docs
def self.build_docs(output_dir, source_module)
each_doc(output_dir, source_module.docs) do |doc, path|
prepare_output_dir(path.parent, false)
depth = path.relative_path_from(output_dir).each_filename.count - 1
path_to_root = '../' * depth
path.open('w') do |file|
file.write(document(source_module, doc, path_to_root))
end
end
end
def self.each_doc(output_dir, docs, &block)
docs.each do |doc|
next unless doc.render_as_page?
# Filepath is relative to documentation root:
path = output_dir + doc.filepath
block.call(doc, path)
each_doc(
output_dir,
doc.children,
&block
)
end
end
def self.build_site(docs, coverage, options)
warn 'building site'
structure = doc_structure_for_docs(docs)
docs << SourceDocument.make_index(options.readme_path)
output_dir = options.output
docset_builder = DocsetBuilder.new(output_dir)
source_module = SourceModule.new(docs, structure, coverage, docset_builder)
build_docs(output_dir, source_module)
unless options.disable_search
warn 'building search index'
SearchBuilder.build(source_module, output_dir)
end
copy_extensions(source_module, output_dir)
copy_theme_assets(output_dir)
docset_builder.build!(source_module.all_declarations)
generate_badge(source_module.doc_coverage, options)
friendly_path = relative_path_if_inside(output_dir, Pathname.pwd)
puts "jam out ♪♫ to your fresh new docs in `#{friendly_path}`"
source_module
end
# Build docs given sourcekitten output
# @param [Array
\n"
end
end
def self.highlight_swift(source)
highlight(source, SWIFT)
end
def self.highlight_objc(source)
highlight(source, OBJC)
end
def self.highlight(source, language)
source && Rouge.highlight(source, language, Formatter.new(language))
end
end
end
================================================
FILE: lib/jazzy/jazzy_markdown.rb
================================================
# frozen_string_literal: true
require 'redcarpet'
require 'rouge'
require 'rouge/plugins/redcarpet'
module Jazzy
module Markdown
# Publish if generated HTML needs math support
class << self; attr_accessor :has_math; end
module Footnotes
# Global unique footnote ID
def self.next_footnote
@next_footnote ||= 0
@next_footnote += 1
end
# Per-render map from user to global ID
attr_accessor :footnotes_hash
def reset
@footnotes_hash = {}
end
def map_footnote(user_num)
footnotes_hash.fetch(user_num) do
footnotes_hash[user_num] = Footnotes.next_footnote
end
end
def footnote_ref(num)
mapped = map_footnote(num)
"" \
"#{num}"
end
# follow native redcarpet: backlink goes before the first "
super
yield "
']
Markdown.has_math = true
when /^\$(.*)\$$/m
o = ["", Regexp.last_match[1], '']
Markdown.has_math = true
else
o = ['', text.to_s, '']
end
o[0] + CGI.escapeHTML(o[1]) + o[2]
end
# List from
# https://github.com/apple/swift/blob/master/include/swift/Markup/SimpleFields.def
UNIQUELY_HANDLED_CALLOUTS = %w[parameters
parameter
returns].freeze
GENERAL_CALLOUTS = %w[attention
author
authors
bug
complexity
copyright
date
experiment
important
invariant
keyword
mutatingvariant
nonmutatingvariant
note
postcondition
precondition
recommended
recommendedover
remark
remarks
requires
see
seealso
since
todo
throws
version
warning].freeze
SPECIAL_LIST_TYPES = (UNIQUELY_HANDLED_CALLOUTS + GENERAL_CALLOUTS).freeze
SPECIAL_LIST_TYPE_REGEX = %r{
\A\s* # optional leading spaces
(
\s*)? # optional opening p tag # any one of our special list types (#{SPECIAL_LIST_TYPES.map(&Regexp.method(:escape)).join('|')}) [\s:] # followed by either a space or a colon }ix.freeze ELIDED_LI_TOKEN = '7wNVzLB0OYPL2eGlPKu8q4vITltqh0Y6DPZf659TPMAeYh49o' def list_item(text, _list_type) if text =~ SPECIAL_LIST_TYPE_REGEX type = Regexp.last_match(2) if UNIQUELY_HANDLED_CALLOUTS.include? type.downcase return ELIDED_LI_TOKEN end return render_list_aside(type, text.sub(/#{Regexp.escape(type)}:\s+/, '')) end "
#{type.underscore.humanize}
#{text}\s*)? # optional opening p tag # any one of the callout names (#{DOCC_CALLOUTS.map(&Regexp.method(:escape)).join('|')}) : # followed directly by a colon }ix.freeze def block_quote(html) if html =~ DOCC_CALLOUT_REGEX type = Regexp.last_match[1] render_aside(type, html.sub(/#{Regexp.escape(type)}:\s*/, '')) else "\n
\n#{html}\n" end end def block_code(code, language) super(code, language || default_language) end def rouge_formatter(lexer) Highlighter::Formatter.new(lexer.tag) end end # rubocop:enable Metrics/ClassLength REDCARPET_OPTIONS = { autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, strikethrough: true, space_after_headers: false, tables: true, lax_spacing: true, footnotes: true, }.freeze # Spot and capture returns & param HTML for separate display. class JazzyDeclarationHTML < JazzyHTML attr_reader :returns, :parameters def reset @returns = nil @parameters = {} super end INTRO_PAT = '\A(?
\s*)?)'
OUTRO_PAT = '(? #{body} ')
# call smartypants for pretty quotes etc.
postprocess(body)
end
end
def self.renderer
@renderer ||= JazzyDeclarationHTML.new
end
def self.markdown
@markdown ||= Redcarpet::Markdown.new(renderer, REDCARPET_OPTIONS)
end
# Produces -delimited block content
def self.render(markdown_text, default_language = nil)
renderer.reset
renderer.default_language = default_language
markdown.render(markdown_text)
end
# Produces -delimited inline content
def self.render_inline(markdown_text, default_language = nil)
render(markdown_text, default_language)
.sub(%r{^ (.*) Deprecated Unavailable {{language}} Swift {{docs_title}}{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}} {{language}} Swift Deprecated Unavailable {{language}} Swift
{{docs_title}}
{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}
{{language}} Swift Deprecated Unavailable {{language}} Swift
{{docs_title}}
{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}
{{language}} Swift', '']
end
/(#{start_tag_re})[ \t]*(#{middle_regex})[ \t]*(#{end_tag_re})/
end
class String
def autolink_block(doc_url, middle_regex, after_highlight)
gsub(autolink_regex(middle_regex, after_highlight)) do
original = Regexp.last_match(0)
start_tag, raw_name, end_tag = Regexp.last_match.captures
link_target, display_name = yield(CGI.unescape_html(raw_name))
if link_target &&
!link_target.type.extension? &&
link_target.url &&
link_target.url != doc_url.split('#').first && # Don't link to parent
link_target.url != doc_url # Don't link to self
"#{start_tag}" \
"#{CGI.escape_html(display_name)}#{end_tag}"
else
original
end
end
end
def unindent(count)
gsub(/^#{' ' * count}/, '')
end
end
module Jazzy
# This module interacts with the sourcekitten command-line executable
module SourceKitten
def self.undocumented_abstract
@undocumented_abstract ||= Markdown.render(
Config.instance.undocumented_text,
).freeze
end
#
# URL assignment
#
def self.sanitize_filename(doc)
unsafe_filename = doc.docs_filename
sanitzation_enabled = Config.instance.use_safe_filenames
if sanitzation_enabled && !doc.type.name_controlled_manually?
CGI.escape(unsafe_filename).gsub('_', '%5F').tr('%', '_')
else
unsafe_filename
end
end
# rubocop:disable Metrics/MethodLength
# Generate doc URL by prepending its parents' URLs
# @return [Hash] input docs with URLs
def self.make_doc_urls(docs)
docs.each do |doc|
if doc.render_as_page?
doc.url = (
subdir_for_doc(doc) +
[sanitize_filename(doc) + '.html']
).map { |path| ERB::Util.url_encode(path) }.join('/')
doc.children = make_doc_urls(doc.children)
else
# Don't create HTML page for this doc if it doesn't have children
# Instead, make its link a hash-link on its parent's page
if doc.typename == '<{{name}}
{{/hide_name}}
{{> deprecation}}
{{#declaration}}
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}
================================================
FILE: lib/jazzy/themes/apple/templates/task.mustache
================================================
{{name}}
{{#items}}
{{#direct_link}}
{{name}}
{{/direct_link}}
{{^direct_link}}
{{^usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#declaration_note}}
{{.}}
{{/declaration_note}}
Default Implementation
Declaration
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}
{{name}}
{{/hide_name}}
{{> deprecation}}
{{#declaration}}
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}
================================================
FILE: lib/jazzy/themes/fullwidth/templates/task.mustache
================================================
{{name}}
{{#items}}
{{#direct_link}}
{{name}}
{{/direct_link}}
{{^direct_link}}
{{^usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#declaration_note}}
{{.}}
{{/declaration_note}}
Default Implementation
Declaration
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}
{{name}}
{{/hide_name}}
{{> deprecation}}
{{#declaration}}
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}
================================================
FILE: lib/jazzy/themes/jony/templates/task.mustache
================================================
{{name}}
{{#items}}
{{#direct_link}}
{{name}}
{{/direct_link}}
{{^direct_link}}
{{^usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#usage_discouraged}}
{{{name_html}}}
{{/usage_discouraged}}
{{#declaration_note}}
{{.}}
{{/declaration_note}}
Default Implementation
Declaration
Parameters
{{#parameters}}
{{> parameter}}
{{/parameters}}
Return Value
{{{return}}}