Skip to content

Commit 9442c56

Browse files
authored
Update README.md (#118)
Updating the README.md file to have instructions on publishing the Kotlin API documentation
1 parent f3dfc0e commit 9442c56

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,86 @@ This repository contains documentation for the MongoDB Kotlin Driver.
66

77
Please file issue reports or requests at the [Documentation Jira Project](https://jira.mongodb.org/browse/DOCS).
88

9+
## Building API Documentation
10+
11+
Build the API documentation docs for any major and minor version releases.
12+
13+
Use [Dokka](https://github.com/Kotlin/dokka) to generate the API documentation and publish it on GitHub Pages.
14+
15+
1. To execute a build, you must have Java JDK 17 or later installed. Use
16+
the following `brew` commands to install `jEnv` and `OpenJDK` to manage your Java versions:
17+
18+
```sh
19+
brew install jenv
20+
brew install openjdk@17
21+
```
22+
23+
2. When you install `OpenJDK`, the log includes a command that starts with
24+
`sudo ln -sfn`. Execute this command to create a symbolic link. Then,
25+
run the following commands to add the JDK to your environment,
26+
modifying the path and version number to match the version of OpenJDK
27+
that you installed. For example, for version 17:
28+
29+
```sh
30+
jenv add /Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home/
31+
jenv global 17.0
32+
```
33+
34+
3. Fork and clone the
35+
[`mongo-java-driver`](https://github.com/mongodb/mongo-java-driver)
36+
repository. Navigate to the repository and run the following `gradle`
37+
command:
38+
39+
```sh
40+
./gradlew dokkaHtml
41+
```
42+
43+
4. If successful, this command generates API docs in `./build/docs/`.
44+
Check out the upstream `gh-pages` branch:
45+
46+
```sh
47+
git checkout gh-pages
48+
```
49+
50+
- To work in a feature branch, create one off of the
51+
`gh-pages` branch by checking out `gh-pages` and then running the
52+
following command:
53+
54+
```sh
55+
git checkout -b my-feature-branch
56+
```
57+
58+
- If a directory for the API docs branch that you're building doesn't
59+
exist, create the directory. For example:
60+
61+
```sh
62+
mkdir -p 4.10/apidocs/
63+
```
64+
65+
5. Move the contents of the `./build/docs/` directory into the target
66+
version directory. For example:
67+
68+
```sh
69+
mv ./build/docs/* 4.10/apidocs/
70+
```
71+
72+
6. Stage the newly-created docs in Git and ensure that the list of
73+
staged files only contains the pages you want. For example:
74+
75+
```sh
76+
git add 4.10/apidocs
77+
git status
78+
```
79+
80+
7. Commit and push your changes to your feature branch. Then, create a
81+
PR against the official repository's `gh-pages`
82+
branch. After it is approved and you merge the PR, your changes will
83+
automatically be published to GitHub Pages.
84+
85+
To build the API documentation for all of the drivers, including the
86+
Kotlin driver, that are based on the Java driver, see the `docs-java-other` [README
87+
file](https://github.com/mongodb/docs-java-other#building-api-documentation).
88+
989
## Licenses
1090

1191
All documentation is available under the terms of a [Creative Commons License](https://creativecommons.org/licenses/by-nc-sa/3.0/).

0 commit comments

Comments
 (0)