Skip to content

Commit e7b80b0

Browse files
authored
Add docc and CI for pages (#10)
This PR adds docc documentation and CI for deploying the documentations to GitHub pages
1 parent 3b8d5de commit e7b80b0

File tree

8 files changed

+123
-3
lines changed

8 files changed

+123
-3
lines changed

.github/workflows/deploy-docc.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy DocC
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: true
13+
jobs:
14+
build:
15+
name: Build DocC Documentation
16+
runs-on: macOS-26
17+
env:
18+
DEVELOPER_DIR: "/Applications/Xcode_26.1.app/Contents/Developer"
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Swift Version
23+
run: xcrun swift --version
24+
- name: Build DocC
25+
run: |
26+
xcrun swift build
27+
xcrun swift package --allow-writing-to-directory ./docs \
28+
generate-documentation \
29+
--target BinaryParseKit \
30+
--output-path ./docs \
31+
--transform-for-static-hosting
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v4
34+
with:
35+
path: ./docs
36+
deploy:
37+
name: Deploy to GitHub Pages
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ fastlane/report.xml
6969
fastlane/Preview.html
7070
fastlane/screenshots/**/*.png
7171
fastlane/test_output
72+
73+
docs/

Package.resolved

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let package = Package(
2525
url: "https://github.com/apple/swift-collections.git",
2626
.upToNextMinor(from: "1.1.0"),
2727
),
28+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.5"),
2829
],
2930
targets: [
3031
.macro(

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A declarative Swift package for parsing binary data using macros, built on top of Apple's [`swift-binary-parsing`](https://github.com/apple/swift-binary-parsing) framework.
44

55
> [!IMPORTANT]
6-
> This package is currently under active development and its APIs are subjected to drastic changes.
6+
> Warning: This package is currently under active development and its APIs are subjected to drastic changes.
77
88
## Features
99

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../README.md
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ``BinaryParseKit``
2+
3+
A powerful Swift package for binary data parsing using macros and protocols.
4+
5+
## Overview
6+
7+
BinaryParseKit provides a convenient and type-safe way to parse binary data in Swift. It leverages Swift macros and protocols to automatically generate parsing logic for your data structures, making it easy to work with binary file formats, network protocols, and other binary data sources.
8+
9+
## Topics
10+
11+
### Articles
12+
13+
- <doc:Guide>
14+
15+
### Struct Parsing Macros
16+
17+
- ``ParseStruct()``
18+
- ``parse()``
19+
- ``parse(byteCount:)``
20+
- ``parse(endianness:)``
21+
- ``parse(byteCount:endianness:)``
22+
- ``parse(byteCountOf:)``
23+
- ``parse(byteCountOf:endianness:)``
24+
- ``parseRest()``
25+
- ``parseRest(endianness:)``
26+
- ``skip(byteCount:because:)``
27+
28+
### Enum Parsing Macros
29+
30+
- ``ParseEnum()``
31+
- ``match()``
32+
- ``match(byte:)``
33+
- ``match(bytes:)``
34+
- ``matchAndTake()``
35+
- ``matchAndTake(byte:)``
36+
- ``matchAndTake(bytes:)``
37+
- ``matchDefault()``
38+
39+
### Parsable Protocols
40+
41+
- ``Parsable``
42+
- ``EndianParsable``
43+
- ``SizedParsable``
44+
- ``EndianSizedParsable``
45+
46+
### Matchable Protocols
47+
48+
- ``Matchable``
49+
- ``MatchableRawRepresentable``
50+
51+
### Error
52+
53+
- ``BinaryParserKitError``

Sources/BinaryParseKit/MatchableProtocols.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public protocol Matchable {
1212

1313
/// A protocol for types that conform to `RawRepresentable` and `Matchable`.
1414
/// It provides a default implementation for `RawRepresentable` whose `RawValue` conforms to `Matchable`.
15-
/// - SeeAlso: ``bytesToMatch()-1kmth``
1615
public protocol MatchableRawRepresentable: RawRepresentable, Matchable {}
1716

1817
/// Default implementation of `bytesToMatch()` for `MatchableRawRepresentable` where `RawValue` conforms to `Matchable`.

0 commit comments

Comments
 (0)