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: Guides/docs.docc/GeneratingCertificates.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
# Generating TLS certificates
2
2
3
-
To simplify the implementation and facilitate testing, Unidoc uses TLS (HTTPS) everywhere, even when running locally.
4
-
5
3
For a seamless development experience, we recommend using [mkcert](https://github.com/FiloSottile/mkcert) to generate a local certificate authority (CA) for your development environment.
6
4
5
+
> Note:
6
+
> Most Unidoc users do not need to generate their own certificates. As of Unidoc 0.17.0, the preview server can run locally in insecure mode.
The easiest way by far to preview documentation locally is to use Docker. You can download Docker Desktop for macOS from the [official website](https://www.docker.com/products/docker-desktop).
23
17
24
18
25
-
## 2. Launching a `mongod` instance
19
+
## 2. Install Unidoc
20
+
21
+
Today, there are two main ways to install Unidoc — building it from source or downloading a pre-built binary.
22
+
23
+
### Downloading a pre-built binary
24
+
25
+
Pre-built binaries are available for a limited set of platforms.
Please note that the executable as built by SwiftPM is named `unidoc-tools`, which you should rename to `unidoc` when installing it.
45
+
46
+
47
+
> Important:
48
+
> The rest of this guide assumes you have installed Unidoc somewhere on your macOS host that is visible in your `PATH` and allows you to invoke it as `unidoc`.
49
+
50
+
51
+
## 3. Launching a `mongod` instance
52
+
53
+
If you have not already done so, clone the Unidoc project and navigate to the root of the repository:
Use Docker Compose to launch a `mongod` instance in a container. This container is named `unidoc-mongod-container`. It has persistent state which `mongod` stores in a directory called `.mongod` at the root of the repository.
The `unidoc preview` tool is an ordinary SwiftPM executable product. You can build and run it directly from your macOS host like this:
82
+
The `unidoc preview` tool is a simple web server that links and serves documentation for local Swift packages. Run it directly from your macOS host like this:
50
83
51
84
```bash
52
-
swift run -c release unidoc-tools preview
85
+
unidoc preview
53
86
```
54
87
55
88
The `unidoc preview` tool will start a web server on [`http://localhost:8080`](http://localhost:8080).
@@ -62,7 +95,9 @@ The `unidoc preview` tool will start a web server on [`http://localhost:8080`](h
62
95
63
96
Generate local documentation using the `unidoc local` subcommand. To start off, open a third terminal and generate the documentation for the standard library (`swift`).
You should be able to view the symbol graph and its documentation at [`http://localhost:8080/tags/swift`](http://localhost:8080/tags/swift).
68
103
@@ -84,7 +119,7 @@ cd -
84
119
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.
85
120
86
121
```bash
87
-
swift run -c release unidoc-toolslocal swift-collections -I ..
122
+
unidoc local swift-collections -I ..
88
123
```
89
124
90
125
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 +134,7 @@ Finally, let’s generate documentation for a package that depends on `swift-col
0 commit comments