Skip to content

Commit

Permalink
updated docs, added rake task to update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Apr 25, 2017
1 parent 6a20ca7 commit 8edb54f
Show file tree
Hide file tree
Showing 62 changed files with 787 additions and 2,444 deletions.
6 changes: 5 additions & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
author: Krzysztof Zabłocki
author_url: https://twitter.com/merowing_
module: Sourcery
module_version: 0.5.9
sourcekitten_sourcefile: docs.json
module_version: 0.6.0
github_url: https://github.com/krzysztofzablocki/Sourcery
copyright: 'Copyright © 2016 Pixle. All rights reserved.'
readme: About.md
documentation: guides/*.md
exclude:
- SourceryFramework/Utils/*
- SourceryFramework/CodeGenerated/*

custom_categories:
- name: Guides
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Paths in config file are now relative to config file path by default, absolute paths should start with `/`
- Improved logging and error reporting, added `--quiet` CLI option, added runtime errors for using invalid types in `implementing` and `inheriting`
- Improved swift templates performance


## 0.6.0
Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def print_info(str)
(red,clr) = (`tput colors`.chomp.to_i >= 8) ? %W(\e[33m \e[m) : ["", ""]
puts red, "== #{str.chomp} ==", clr
end

desc "Update docs"
task :docs do
print_info "Updating docs"
sh "sourcekitten doc --module-name SourceryFramework > docs.json && jazzy --clean --skip-undocumented && rm docs.json"
end

## [ Tests & Clean ] ##########################################################

desc "Run the Unit Tests"
Expand Down
2 changes: 1 addition & 1 deletion SourceryFramework/Models/AccessLevel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Foundation

/// Defines the Access Level
/// :nodoc:
public enum AccessLevel: String {
case `internal` = "internal"
case `private` = "private"
Expand Down
2 changes: 2 additions & 0 deletions SourceryFramework/Models/Attribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Attribute: NSObject, AutoCoding, AutoEquatable, AutoDiffable, AutoJ
// sourcery: skipJSExport
let _description: String

/// :nodoc:
public init(name: String, arguments: [String: NSObject] = [:], description: String? = nil) {
self.name = name
self.arguments = arguments
Expand All @@ -23,6 +24,7 @@ public class Attribute: NSObject, AutoCoding, AutoEquatable, AutoDiffable, AutoJ
return _description
}

/// :nodoc:
public enum Identifier: String {
case convenience
case available
Expand Down
1 change: 1 addition & 0 deletions SourceryFramework/Models/Class.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
/// Returns "class"
public override var kind: String { return "class" }

/// :nodoc:
public override init(name: String = "",
parent: Type? = nil,
accessLevel: AccessLevel = .internal,
Expand Down
5 changes: 5 additions & 0 deletions SourceryFramework/Models/Enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public final class AssociatedValue: NSObject, SourceryModel, AutoDescription, Ty
/// Annotations, that were created with // sourcery: annotation1, other = "annotation value", alterantive = 2
public var annotations: [String: NSObject] = [:]

/// :nodoc:
public init(localName: String?, externalName: String?, typeName: TypeName, type: Type? = nil, annotations: [String: NSObject] = [:]) {
self.localName = localName
self.externalName = externalName
Expand Down Expand Up @@ -82,8 +83,10 @@ public final class EnumCase: NSObject, SourceryModel, AutoDescription, Annotated

// Underlying parser data, never to be used by anything else
// sourcery: skipEquality, skipDescription, skipCoding, skipJSExport
/// :nodoc:
public var __parserData: Any?

/// :nodoc:
public init(name: String, rawValue: String? = nil, associatedValues: [AssociatedValue] = [], annotations: [String: NSObject] = [:]) {
self.name = name
self.rawValue = rawValue
Expand Down Expand Up @@ -136,6 +139,7 @@ public final class Enum: Type {
}

// sourcery: skipDescription, skipEquality
/// :nodoc:
public private(set) var hasRawType: Bool

// sourcery: skipDescription, skipEquality
Expand All @@ -161,6 +165,7 @@ public final class Enum: Type {
return false
}

/// :nodoc:
public init(name: String = "",
parent: Type? = nil,
accessLevel: AccessLevel = .internal,
Expand Down
1 change: 1 addition & 0 deletions SourceryFramework/Models/FileParserResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation

// sourcery: skipJSExport
/// :nodoc:
@objc public final class FileParserResult: NSObject, SourceryModel {
public let path: String?
public let module: String?
Expand Down
5 changes: 5 additions & 0 deletions SourceryFramework/Models/Method.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public final class MethodParameter: NSObject, SourceryModel, Typed, Annotated {

/// Underlying parser data, never to be used by anything else
// sourcery: skipEquality, skipDescription, skipCoding, skipJSExport
/// :nodoc:
public var __parserData: Any?

/// :nodoc:
public init(argumentLabel: String?, name: String = "", typeName: TypeName, type: Type? = nil, defaultValue: String? = nil, annotations: [String: NSObject] = [:]) {
self.typeName = typeName
self.argumentLabel = argumentLabel
Expand All @@ -42,6 +44,7 @@ public final class MethodParameter: NSObject, SourceryModel, Typed, Annotated {
self.annotations = annotations
}

/// :nodoc:
public init(name: String = "", typeName: TypeName, type: Type? = nil, defaultValue: String? = nil, annotations: [String: NSObject] = [:]) {
self.typeName = typeName
self.argumentLabel = name
Expand Down Expand Up @@ -163,8 +166,10 @@ public final class MethodParameter: NSObject, SourceryModel, Typed, Annotated {

// Underlying parser data, never to be used by anything else
// sourcery: skipEquality, skipDescription, skipCoding, skipJSExport
/// :nodoc:
public var __parserData: Any?

/// :nodoc:
public init(name: String,
selectorName: String? = nil,
parameters: [MethodParameter] = [],
Expand Down
2 changes: 2 additions & 0 deletions SourceryFramework/Models/Protocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public final class Protocol: Type {
/// Returns "protocol"
public override var kind: String { return "protocol" }

/// :nodoc:
public override init(name: String = "",
parent: Type? = nil,
accessLevel: AccessLevel = .internal,
Expand Down Expand Up @@ -43,6 +44,7 @@ public final class Protocol: Type {
)
}

/// :nodoc:
override public func extend(_ type: Type) {
type.variables = type.variables.filter({ v in !variables.contains(where: { $0.name == v.name && $0.isStatic == v.isStatic }) })
type.methods = type.methods.filter({ !methods.contains($0) })
Expand Down
1 change: 1 addition & 0 deletions SourceryFramework/Models/Struct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public final class Struct: Type {
/// Returns "struct"
public override var kind: String { return "struct" }

/// :nodoc:
public override init(name: String = "",
parent: Type? = nil,
accessLevel: AccessLevel = .internal,
Expand Down
5 changes: 5 additions & 0 deletions SourceryFramework/Models/TemplateContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Foundation

/// :nodoc:
public final class TemplateContext: NSObject, SourceryModel {
public let types: Types
public let arguments: [String: NSObject]
Expand Down Expand Up @@ -62,6 +63,7 @@ public final class TemplateContext: NSObject, SourceryModel {
}

extension ProcessInfo {
/// :nodoc:
public var context: TemplateContext! {
return NSKeyedUnarchiver.unarchiveObject(withFile: arguments[1]) as? TemplateContext
}
Expand All @@ -70,8 +72,11 @@ extension ProcessInfo {
// sourcery: skipJSExport
/// Collection of scanned types for accessing in templates
public final class Types: NSObject, SourceryModel {

/// :nodoc:
public let types: [Type]

/// :nodoc:
public init(types: [Type]) {
self.types = types
}
Expand Down
7 changes: 7 additions & 0 deletions SourceryFramework/Models/Type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import Foundation
/// Defines Swift type
public class Type: NSObject, SourceryModel, Annotated {

/// :nodoc:
public var module: String?

// All local typealiases
// sourcery: skipJSExport
/// :nodoc:
public var typealiases: [String: Typealias] {
didSet {
typealiases.values.forEach { $0.parent = self }
Expand Down Expand Up @@ -184,6 +186,7 @@ public class Type: NSObject, SourceryModel, Annotated {
}

// sourcery: skipJSExport
/// :nodoc:
public var parentTypes: AnyIterator<Type> {
var next: Type? = self
return AnyIterator {
Expand All @@ -201,11 +204,14 @@ public class Type: NSObject, SourceryModel, Annotated {

// Underlying parser data, never to be used by anything else
// sourcery: skipDescription, skipEquality, skipJSExport
/// :nodoc:
public var __parserData: Any?
// Path to file where the type is defined
// sourcery: skipDescription, skipEquality, skipJSExport
/// :nodoc:
public var __path: String?

/// :nodoc:
public init(name: String = "",
parent: Type? = nil,
accessLevel: AccessLevel = .internal,
Expand Down Expand Up @@ -248,6 +254,7 @@ public class Type: NSObject, SourceryModel, Annotated {
})
}

/// :nodoc:
public func extend(_ type: Type) {
self.variables += type.variables
self.methods += type.methods
Expand Down
5 changes: 5 additions & 0 deletions SourceryFramework/Models/TypeName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public protocol Typed {
/// Describes name of the type used in typed declaration (variable, method parameter or return value etc.)
public final class TypeName: NSObject, AutoCoding, AutoEquatable, AutoDiffable, AutoJSExport {

/// :nodoc:
public init(_ name: String,
actualTypeName: TypeName? = nil,
attributes: [String: Attribute] = [:],
Expand Down Expand Up @@ -205,6 +206,7 @@ public final class TupleElement: NSObject, SourceryModel, Typed {
/// Tuple element type, if known
public var type: Type?

/// :nodoc:
public init(name: String = "", typeName: TypeName, type: Type? = nil) {
self.name = name
self.typeName = typeName
Expand Down Expand Up @@ -237,6 +239,7 @@ public final class TupleType: NSObject, SourceryModel {
/// Tuple elements
public let elements: [TupleElement]

/// :nodoc:
public init(name: String, elements: [TupleElement]) {
self.name = name
self.elements = elements
Expand Down Expand Up @@ -270,6 +273,7 @@ public final class ArrayType: NSObject, SourceryModel {
/// Array element type, if known
public var elementType: Type?

/// :nodoc:
public init(name: String, elementTypeName: TypeName, elementType: Type? = nil) {
self.name = name
self.elementTypeName = elementTypeName
Expand Down Expand Up @@ -313,6 +317,7 @@ public final class DictionaryType: NSObject, SourceryModel {
/// Dictionary key type, if known
public var keyType: Type?

/// :nodoc:
public init(name: String, valueTypeName: TypeName, valueType: Type? = nil, keyTypeName: TypeName, keyType: Type? = nil) {
self.name = name
self.valueTypeName = valueTypeName
Expand Down
1 change: 1 addition & 0 deletions SourceryFramework/Models/Typealias.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation

// sourcery: skipJSExport
/// :nodoc:
public final class Typealias: NSObject, Typed, SourceryModel {
// New typealias name
public let aliasName: String
Expand Down
2 changes: 2 additions & 0 deletions SourceryFramework/Models/Variable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ public final class Variable: NSObject, SourceryModel, Typed, Annotated {

// Underlying parser data, never to be used by anything else
// sourcery: skipEquality, skipDescription, skipCoding, skipJSExport
/// :nodoc:
public var __parserData: Any?

/// :nodoc:
public init(name: String = "",
typeName: TypeName,
type: Type? = nil,
Expand Down
14 changes: 7 additions & 7 deletions docs/Classes/ArrayType.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ <h1>ArrayType</h1>
<li class="item">
<div>
<code>
<a name="/s:vC8Sourcery9ArrayType4nameSS"></a>
<a name="/s:vC17SourceryFramework9ArrayType4nameSS"></a>
<a name="//apple_ref/swift/Property/name" class="dashAnchor"></a>
<a class="token" href="#/s:vC8Sourcery9ArrayType4nameSS">name</a>
<a class="token" href="#/s:vC17SourceryFramework9ArrayType4nameSS">name</a>
</code>
</div>
<div class="height-container">
Expand All @@ -186,9 +186,9 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:vC8Sourcery9ArrayType15elementTypeNameCS_8TypeName"></a>
<a name="/s:vC17SourceryFramework9ArrayType15elementTypeNameCS_8TypeName"></a>
<a name="//apple_ref/swift/Property/elementTypeName" class="dashAnchor"></a>
<a class="token" href="#/s:vC8Sourcery9ArrayType15elementTypeNameCS_8TypeName">elementTypeName</a>
<a class="token" href="#/s:vC17SourceryFramework9ArrayType15elementTypeNameCS_8TypeName">elementTypeName</a>
</code>
</div>
<div class="height-container">
Expand All @@ -213,9 +213,9 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:vC8Sourcery9ArrayType11elementTypeGSqCS_4Type_"></a>
<a name="/s:vC17SourceryFramework9ArrayType11elementTypeGSqCS_4Type_"></a>
<a name="//apple_ref/swift/Property/elementType" class="dashAnchor"></a>
<a class="token" href="#/s:vC8Sourcery9ArrayType11elementTypeGSqCS_4Type_">elementType</a>
<a class="token" href="#/s:vC17SourceryFramework9ArrayType11elementTypeGSqCS_4Type_">elementType</a>
</code>
</div>
<div class="height-container">
Expand All @@ -230,7 +230,7 @@ <h4>Declaration</h4>
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">elementType</span><span class="p">:</span> <span class="k">Type</span><span class="p">?</span></code></pre>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">elementType</span><span class="p">:</span> <span class="k">Type</span><span class="p">?</span></code></pre>

</div>
</div>
Expand Down
Loading

0 comments on commit 8edb54f

Please sign in to comment.