You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SymbolKit/SymbolKit.docc/GraphFormatExtensions.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Define custom Symbol or Relationship kinds and store custom information in the g
4
4
5
5
## Overview
6
6
7
-
SymbolKit makes it easy to parse Symbol Graph Files and inspect or edit the resulting graph's _contents_. However, sometimes you migth want to go beyond that by changing the _structure_ of the graph. SymbolKit allows you to define custom Symbol and Relationship kinds and lets you extend nodes and edges with custom properties.
7
+
SymbolKit makes it easy to parse Symbol Graph Files and inspect or edit the resulting graph's _contents_. However, sometimes you might want to go beyond that by changing the _structure_ of the graph. SymbolKit allows you to define custom Symbol and Relationship kinds and lets you extend nodes and edges with custom properties.
Use these constants when manually initializing Symbols/Relationships of the respective kind instead of initilaizing new instances of ``SymbolGraph/Symbol/KindIdentifier`` / ``SymbolGraph/Relationship/Kind-swift.struct`` all the time.
25
+
Use these constants when manually initializing Symbols/Relationships of the respective kind instead of initializing new instances of ``SymbolGraph/Symbol/KindIdentifier`` / ``SymbolGraph/Relationship/Kind-swift.struct`` all the time.
26
26
27
27
After defining a custom Symbol kind, make sure to register it using ``SymbolGraph/Symbol/KindIdentifier/register(_:)``. This ensures all static functionality defined on ``SymbolGraph/Symbol/KindIdentifier`` works as expected.
28
28
@@ -42,7 +42,7 @@ Start out by defining the information you want to capture:
42
42
```swift
43
43
/// Commit metadata of the last commit that modified this Symbol.
44
44
structLastCommit: Mixin, Hashable{
45
-
staticlet mixinKey ="lastCommit"
45
+
staticlet mixinKey ="lastCommit"
46
46
47
47
let hash: String
48
48
let date: Date
@@ -70,7 +70,7 @@ You can now easily edit this information on an existing Symbol Graph.
70
70
71
71
Before you can encode and decode this information, you need to register your custom Mixin on your encoder/decoder using ``SymbolGraph/Symbol/register(mixins:to:onEncodingError:onDecodingError:)`` (for ``SymbolGraph/Symbol``) or ``SymbolGraph/Relationship/register(mixins:to:onEncodingError:onDecodingError:)`` (for ``SymbolGraph/Relationship``). If you forget this step, you custom mixins will be ignored!
72
72
73
-
- Note: There exist handy shorcuts on Foundation's `JSONEncoder` and `JSONDecoder` for all the registration functions.
73
+
- Note: There exist handy shortcuts on Foundation's `JSONEncoder` and `JSONDecoder` for all the registration functions.
74
74
75
75
```swift
76
76
// prepare encoder and decoder to deal with custom mixin
0 commit comments