Skip to content

Commit f97dca1

Browse files
Merge pull request #49 from swiftwasm/swift-doc
Generate and publish documentation with `swift-doc`
2 parents 0ac8b37 + 3160ab4 commit f97dca1

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

.github/workflows/documentation.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
swift-doc:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Generate Documentation
14+
uses: MaxDesiatov/swift-doc@prebuilt-image
15+
with:
16+
inputs: "Sources"
17+
module-name: JavaScriptKit
18+
format: html
19+
base-url: "/JavaScriptKit"
20+
output: ./.build/documentation
21+
- run: sudo chmod o+r -R ./.build/documentation
22+
- name: Deploy
23+
uses: peaceiris/actions-gh-pages@v3
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: ./.build/documentation

Sources/JavaScriptKit/BasicObjects/JSError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** A wrapper around the [JavaScript Error
1+
/** A wrapper around [the JavaScript Error
22
class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) that
33
exposes its properties in a type-safe way.
44
*/
@@ -24,7 +24,7 @@ public final class JSError: Error {
2424
jsObject.name.string!
2525
}
2626

27-
/// The JavaScript call trace that led to the creation of this error object.
27+
/// The JavaScript call stack that led to the creation of this error object.
2828
public var stack: String? {
2929
jsObject.stack.string
3030
}

Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ public class JSClosure: JSFunction {
105105
}
106106

107107
@_cdecl("swjs_prepare_host_function_call")
108-
public func _prepare_host_function_call(_ argc: Int32) -> UnsafeMutableRawPointer {
108+
func _prepare_host_function_call(_ argc: Int32) -> UnsafeMutableRawPointer {
109109
let argumentSize = MemoryLayout<RawJSValue>.size * Int(argc)
110110
return malloc(Int(argumentSize))!
111111
}
112112

113113
@_cdecl("swjs_cleanup_host_function_call")
114-
public func _cleanup_host_function_call(_ pointer: UnsafeMutableRawPointer) {
114+
func _cleanup_host_function_call(_ pointer: UnsafeMutableRawPointer) {
115115
free(pointer)
116116
}
117117

118118
@_cdecl("swjs_call_host_function")
119-
public func _call_host_function(
119+
func _call_host_function(
120120
_ hostFuncRef: JavaScriptHostFuncRef,
121121
_ argv: UnsafePointer<RawJSValue>, _ argc: Int32,
122122
_ callbackFuncRef: JavaScriptObjectRef

0 commit comments

Comments
 (0)