This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Description
Thanks this looks awesome! I did a quick test and I think I found some bugs.
I created a new Swift package and put the following in the source file:
/// Says hello
public func sayHello() {
print("Hello!")
}
public extension NSNumber {
/// Does this number represent a Bool
public var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) }
}
public extension Result where Failure == Error {
/// Converts a throwing block into a Result
/// If any error is thrown a failure result is returned with the error. Otherwise success with the blocks return value.
public static func of(_ block: () throws -> Success) -> Result<Success, Error> {
do {
return try .success(block())
} catch {
return .failure(error)
}
}
}
/**
The default generated struct!
*/
struct spm_test {
var text = "Hello, World!"
}
When I run the generator via swift doc generate Sources --module-name spm-test I get the following:
Home.md
# Types
- [NSNumber.Result.spm\_test](NSNumber_Result_spm_test)
# Operators
- [sayHello()](sayHello\(\))
NSNumber_Result_spm_test.md
# NSNumber.Result.spm\_test
The default generated struct\!
``` swift
struct spm_test
```
## Properties
## text
``` swift
var text = "Hello, World!"
```
sayHello().md
# sayHello()
## sayHello()
Says hello
``` swift
public func sayHello()
```
I think there are three bugs here:
- Notice how the
spm_test struct is nested under the NSNumber and Result types.
- I don't get any docs for the public extensions.
- The top level
sayHello function is documented as an operator.