Skip to content

Commit 94912dc

Browse files
authored
Merge pull request #325 from tayloraswift/validate-own-docs
Validate own docs
2 parents cf23c8b + 1b99e98 commit 94912dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+183
-172
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This workflow builds the project under the “starter” configuration, namely, what you would get
2+
# if you ran `swift build` without any arguments. We use this to verify that we can generate the
3+
# documentation for Unidoc itself.
4+
name: documentation
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
linux:
14+
runs-on: ubuntu-24.04
15+
name: Ubuntu 24.04
16+
env:
17+
UNIDOC_ENABLE_INDEXSTORE: "0"
18+
steps:
19+
# Important! We install an Ubuntu 22.04 Swift toolchain, and not the 24.04 one
20+
# because the 24.04 toolchain for some reason is built with assertions enabled,
21+
# which causes the Swift compiler to crash when building the package.
22+
- name: Install Swift
23+
uses: tayloraswift/swift-install-action@master
24+
with:
25+
swift-prefix: "swift-5.10.1-release/ubuntu2204/swift-5.10.1-RELEASE"
26+
swift-id: "swift-5.10.1-RELEASE-ubuntu22.04"
27+
28+
# This installs an older version of Unidoc, not the one we are testing.
29+
- name: Install Unidoc
30+
uses: tayloraswift/swift-unidoc-action@master
31+
with:
32+
unidoc-version: "master"
33+
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
- name: Build documentation
38+
run: |
39+
unidoc compile -I .. \
40+
--swift-toolchain $SWIFT_INSTALLATION \
41+
--ci fail-on-errors \
42+
--package-name swift-unidoc
43+
44+
macos:
45+
runs-on: macos-14
46+
name: macOS
47+
env:
48+
UNIDOC_ENABLE_INDEXSTORE: "0"
49+
DEVELOPER_DIR: "/Applications/Xcode_15.3.app/Contents/Developer"
50+
51+
steps:
52+
- name: Install Unidoc
53+
uses: tayloraswift/swift-unidoc-action@master
54+
with:
55+
unidoc-version: "master"
56+
57+
- name: Checkout repository
58+
uses: actions/checkout@v3
59+
60+
- name: Build documentation
61+
run: |
62+
unidoc compile -I .. \
63+
--ci fail-on-errors \
64+
--package-name swift-unidoc

.github/workflows/ci.yml renamed to .github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This workflow builds the project for production, with IndexStoreDB integration enabled.
2-
3-
name: ci
2+
name: test
43

54
on:
65
push:

Guides/docs.docc/Getting started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ A fresh Unidoc database contains no documentation. Let’s build some now.
9494

9595
The documentation compiler lives in this repository, and is packaged as a normal SwiftPM executable target.
9696

97-
To invoke the compiler, run the `unidoc-build` tool and pass it the name of the package you want to build documentation for. In our case, the “package” is `swift`, which is a special name identifying the standard library itself.
97+
To invoke the compiler, run the `unidoc local` tool and pass it the name of the package you want to build documentation for. In our case, the “package” is `swift`, which is a special name identifying the standard library itself.
9898

9999
@Code(file: load-standard-library.sh, title: load-standard-library.sh)
100100

@@ -130,7 +130,7 @@ git clone https://github.com/apple/swift-nio
130130

131131
**Where** you clone the repository is important, because you will need to tell Unidoc where to find the project. In this example, we cloned the repository inside a directory called `/swift`, which is a plausible place to store Git repositories in a devcontainer.
132132

133-
Next, you can try building `swift-nio` with `unidoc-build`, specifying the path to the search directory (`/swift`) with the `-I` option.
133+
Next, you can try building `swift-nio` with `unidoc local`, specifying the path to the search directory (`/swift`) with the `-I` option.
134134

135135
@Code(file: load-swift-nio.sh, title: load-swift-nio.sh)
136136

Guides/docs.docc/Quickstart.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Previewing documentation locally
22

3-
This guide walks through how to use the `unidoc-preview` tool to preview documentation locally on macOS 14. This guide won’t make any effort to explain how Unidoc itself works, it is merely intended to demonstrate how to preview multi-package documentation as quickly as possible. For a more-detailed Linux-centric tour, see the <doc:Getting-started> guide.
3+
This guide walks through how to use the `unidoc preview` tool to preview documentation locally on macOS 14. This guide won’t make any effort to explain how Unidoc itself works, it is merely intended to demonstrate how to preview multi-package documentation as quickly as possible. For a more-detailed Linux-centric tour, see the <doc:Getting-started> guide.
44

55
In this guide, you will:
66

77
1. Launch and initialize a `mongod` instance in a Docker container,
8-
2. Build and run an instance of `unidoc-preview` on the macOS host,
9-
3. Build the `unidoc-build` tool,
8+
2. Build and run an instance of `unidoc preview` on the macOS host,
9+
3. Build the `unidoc local` tool,
1010
4. Generate documentation for the standard library, and
1111
5. Generate documentation for two SwiftPM packages, one of which depends on the other.
1212

@@ -44,23 +44,23 @@ docker exec -t unidoc-mongod-container /bin/mongosh --file /unidoc-rs-init.js
4444
```
4545

4646

47-
## 3. Running `unidoc-preview`
47+
## 3. Running `unidoc preview`
4848

49-
The `unidoc-preview` tool is an ordinary SwiftPM executable product. You can build and run it directly from your macOS host like this:
49+
The `unidoc preview` tool is an ordinary SwiftPM executable product. You can build and run it directly from your macOS host like this:
5050

5151
```bash
52-
swift run -c release unidoc-preview
52+
swift run -c release unidoc-tools preview
5353
```
5454

55-
The `unidoc-preview` tool will start a web server on [`http://localhost:8080`](http://localhost:8080).
55+
The `unidoc preview` tool will start a web server on [`http://localhost:8080`](http://localhost:8080).
5656

5757
@Image(source: "Start page.png", alt: "Start page") {
58-
> The `unidoc-preview` start page.
58+
> The `unidoc preview` start page.
5959
}
6060

6161
## 4. Generating documentation for the standard library
6262

63-
Generate local documentation using the `unidoc-build local` subcommand. To start off, open a third terminal and generate the documentation for the standard library (`swift`).
63+
Generate local documentation using the `unidoc local` subcommand. To start off, open a third terminal and generate the documentation for the standard library (`swift`).
6464

6565
@Code(file: load-standard-library.sh, title: load-standard-library.sh)
6666

@@ -84,7 +84,7 @@ cd -
8484
Generating documentation for a package is similar to generating documentation for the standard library, except you need to specify a search path to a directory containing the project. Because you downloaded the `swift-collections` repository to a sibling directory, you can use `..` for the search path.
8585

8686
```bash
87-
swift run -c release unidoc-build local swift-collections -I ..
87+
swift run -c release unidoc-tools local swift-collections -I ..
8888
```
8989

9090
You should be able to view the symbol graph and its documentation at [`http://localhost:8080/tags/swift-collections`](http://localhost:8080/tags/swift-collections).
@@ -99,7 +99,7 @@ Finally, let’s generate documentation for a package that depends on `swift-col
9999
cd ..
100100
git clone https://github.com/apple/swift-async-algorithms
101101
cd -
102-
swift run -c release unidoc-build local swift-async-algorithms -I ..
102+
swift run -c release unidoc-tools local swift-async-algorithms -I ..
103103
```
104104

105105

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
swift run -c release unidoc-build local swift
1+
swift run -c release unidoc-tools build local swift
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
swift run -c release unidoc-build local swift-nio -I /swift
1+
swift run -c release unidoc-tools build local swift-nio -I /swift
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
swift --version
2-
swift run -c release unidoc-preview
2+
swift run -c release unidoc-tools preview

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<strong><em><code>unidoc</code></em></strong>
44

5-
[![ci build status](https://github.com/tayloraswift/swift-unidoc/actions/workflows/ci.yml/badge.svg)](https://github.com/tayloraswift/swift-unidoc/actions/workflows/ci.yml)
5+
[![ci build status](https://github.com/tayloraswift/swift-unidoc/actions/workflows/test.yml/badge.svg)](https://github.com/tayloraswift/swift-unidoc/actions/workflows/test.yml)
6+
[![ci build status](https://github.com/tayloraswift/swift-unidoc/actions/workflows/docs.yml/badge.svg)](https://github.com/tayloraswift/swift-unidoc/actions/workflows/docs.yml)
7+
[![ci build status](https://github.com/tayloraswift/swift-unidoc/actions/workflows/package.yml/badge.svg)](https://github.com/tayloraswift/swift-unidoc/actions/workflows/package.yml)
68

79
</div>
810

Sources/GitHubAPI/GitHub.OAuth.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extension GitHub
66
///
77
/// > Note:
88
/// This type would be named `GitHub.OAuthApp`, but then ``GitHub.App`` would have to be
9-
/// named ``GitHub.AppApp``, and that would just be stupid.
9+
/// named `GitHub.AppApp`, and that would just be stupid.
1010
@frozen public
1111
struct OAuth:GitHubApplication
1212
{

0 commit comments

Comments
 (0)