Skip to content

Commit bd37256

Browse files
committed
CASSJAVA-109, CASSJAVA-117: Manual and API References after donation, Build CI for Java Driver Doc
Patch by Jane He and Łukasz Antoniak; Reviewed by Bret McGuire
1 parent bfacd80 commit bd37256

114 files changed

Lines changed: 852 additions & 520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: publish-docs-gh-pages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-docs:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
12+
steps:
13+
# 1. Checkout doc branch
14+
- name: Checkout current branch
15+
uses: actions/checkout@v4
16+
with:
17+
path: java-driver
18+
19+
# 2. Java 8
20+
- name: Set up Java 8
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: "8"
25+
cache: maven
26+
27+
# 3. Python 3.10.19 + MkDocs + plugins
28+
- name: Set up Python 3.10.19
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.10.19"
32+
33+
- name: Install MkDocs dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install \
37+
mkdocs \
38+
mkdocs-material \
39+
mkdocs-awesome-pages-plugin \
40+
mkdocs-macros-plugin \
41+
mike
42+
43+
# 4. Build docs via build-doc.sh
44+
- name: Build documentation
45+
working-directory: java-driver
46+
run: |
47+
chmod +x ./build-doc.sh
48+
./build-doc.sh
49+
50+
# 5. Checkout gh-pages branch
51+
- name: Checkout GH pages branch
52+
uses: actions/checkout@v4
53+
with:
54+
ref: gh-pages
55+
path: gh-pages
56+
57+
- name: Copy and version documentation
58+
working-directory: gh-pages
59+
run: |
60+
git config --global user.email "gha@cassandra.apache.org"
61+
git config --global user.name "GHA for Apache Cassandra Website"
62+
63+
cd ../java-driver
64+
# lookup current project version
65+
release_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d- -f1)
66+
# update links to contain version prefix
67+
mike deploy --update-aliases $release_version
68+
# copy documentation web page folder
69+
cd ../gh-pages
70+
cp -r ../java-driver/docs ./
71+
rm -rf $release_version
72+
mv docs $release_version
73+
74+
# update latest symlink
75+
rm latest
76+
ln -s $release_version latest
77+
78+
# remove latest tag
79+
sed -i 's/\"latest\"//g' versions.json
80+
# remove already present line if exists
81+
sed -i '/'"$release_version"'/d' versions.json
82+
# insert new version at the beginning
83+
sed -i '2s/^/ { "version": "'"$release_version"'", "title": "'"$release_version"'", "aliases": ["latest"] },\'$'\n/g' versions.json
84+
85+
echo "release_version=$release_version" >> "$GITHUB_ENV"
86+
87+
- name: Commit and push documentation
88+
working-directory: gh-pages
89+
run: |
90+
git config --global user.email "gha@cassandra.apache.org"
91+
git config --global user.name "GHA for Apache Cassandra Website"
92+
93+
git add .
94+
95+
if git diff --cached --quiet; then
96+
echo "No changes to push to gh-pages"
97+
exit 0
98+
fi
99+
100+
git commit -m "Update generated docs for release ${release_version}"
101+
git push origin gh-pages

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ are multiple modules, all prefixed with `java-driver-`.
4343
Note that the query builder is now published as a separate artifact, you'll need to add the
4444
dependency if you plan to use it.
4545

46-
Refer to each module's manual for more details ([core](manual/core/), [query
47-
builder](manual/query_builder/), [mapper](manual/mapper)).
46+
Refer to each module's manual for more details ([core](manual/core/README.md), [query
47+
builder](manual/query_builder/README.md), [mapper](manual/mapper/README.md)).
4848

4949
[org.apache.cassandra]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.cassandra%22
5050

@@ -63,11 +63,11 @@ but DataStax does not officially support these systems.
6363
Java Driver 4 is **not binary compatible** with previous versions. However, most of the concepts
6464
remain unchanged, and the new API will look very familiar to 2.x and 3.x users.
6565

66-
See the [upgrade guide](upgrade_guide/) for details.
66+
See the [upgrade guide](upgrade_guide/README.md) for details.
6767

6868
## Useful links
6969

70-
* [Manual](manual/)
70+
* [Manual](manual/README.md)
7171
* [API docs]
7272
* Bug tracking: [JIRA]
7373
* [Mailing list]
@@ -77,8 +77,8 @@ See the [upgrade guide](upgrade_guide/) for details.
7777
[API docs]: https://docs.datastax.com/en/drivers/java/4.17
7878
[JIRA]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CASSJAVA%20ORDER%20BY%20key%20DESC
7979
[Mailing list]: https://lists.apache.org/list.html?user@cassandra.apache.org
80-
[Changelog]: changelog/
81-
[FAQ]: faq/
80+
[Changelog]: changelog/README.md
81+
[FAQ]: faq/README.md
8282

8383
## License
8484

build-doc.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set -e
2+
# Set up python environment
3+
#pyenv local 3.10.1
4+
#pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin mkdocs-macros-plugin
5+
6+
# In some bash/zsh environments, the locale is not set correctly, which causes mkdocs to fail.
7+
export LC_ALL=en_US.UTF-8
8+
export LANG=en_US.UTF-8
9+
10+
# Build Javadoc
11+
mvn clean install -DskipTests # or guava-shaded can not be found
12+
# mvn javadoc:javadoc -pl core,query-builder,mapper-runtime
13+
mvn javadoc:aggregate
14+
15+
# Build manual with API references
16+
mkdocs build -s # strict, so it fails with warning. You can also use `mkdocs serve` to preview

core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,8 @@ public enum DefaultDriverOption implements DriverOption {
10221022
* }
10231023
* </pre>
10241024
*
1025-
* Note: subnets must be represented as prefix blocks, see {@link
1026-
* inet.ipaddr.Address#isPrefixBlock()}.
1025+
* Note: subnets must be represented as prefix blocks, see <a
1026+
* href="https://seancfoley.github.io/IPAddress/ipaddress.html#parsing-addresses-with-prefix-length">inet.ipaddr.Address.isPrefixBlock()</a>
10271027
*
10281028
* <p>Value type: {@link java.util.Map Map}&#60;{@link String},{@link String}&#62;
10291029
*/

core/src/main/java/com/datastax/oss/driver/api/core/data/CqlVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static <V> CqlVector<V> newInstance(List<V> list) {
8080
* Create a new CqlVector instance from the specified string representation.
8181
*
8282
* @param str a String representation of a CqlVector
83-
* @param subtypeCodec
83+
* @param subtypeCodec the codec to use to parse the individual elements
8484
* @return a new CqlVector built from the String representation
8585
*/
8686
public static <V> CqlVector<V> from(@NonNull String str, @NonNull TypeCodec<V> subtypeCodec) {

faq/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ At any rate, `CompletionStage` has a `toCompletableFuture()` method. In current
6565
### Where is `DowngradingConsistencyRetryPolicy` from driver 3?
6666

6767
**As of driver 4.10, this retry policy was made available again as a built-in alternative to the
68-
default retry policy**: see the [manual](../manual/core/retries) to understand how to use it.
68+
default retry policy**: see the [manual](../manual//core/retries/README.md) to understand how to use it.
6969
For versions between 4.0 and 4.9 inclusive, there is no built-in equivalent of driver 3
7070
`DowngradingConsistencyRetryPolicy`.
7171

@@ -100,7 +100,7 @@ This ability is considered a misfeature and has been removed from driver 4.0 onw
100100
However, due to popular demand, cross-datacenter failover has been brought back to driver 4 in
101101
version 4.10.0.
102102

103-
If you are using a driver version >= 4.10.0, read the [manual](../manual/core/loadbalancing/) to
103+
If you are using a driver version >= 4.10.0, read the [manual](../manual//core/load_balancing/README.md) to
104104
understand how to enable this feature; for driver versions < 4.10.0, this feature is simply not
105105
available.
106106

@@ -109,7 +109,7 @@ available.
109109
The driver now uses Java 8's improved date and time API. CQL type `timestamp` is mapped to
110110
`java.time.Instant`, and the corresponding getter and setter are `getInstant` and `setInstant`.
111111

112-
See [Temporal types](../manual/core/temporal_types/) for more details.
112+
See [Temporal types](../manual//core/temporal_types/README.md) for more details.
113113

114114
### Why do DDL queries have a higher latency than driver 3?
115115

@@ -119,6 +119,6 @@ noticeably higher latency than driver 3 (about 1 second).
119119
This is because those queries are now *debounced*: the driver adds a short wait in an attempt to
120120
group multiple schema changes into a single metadata refresh. If you want to mitigate this, you can
121121
either adjust the debouncing settings, or group your schema updates while temporarily disabling the
122-
metadata; see the [performance](../manual/core/performance/#debouncing) page.
122+
metadata; see the [performance](../manual//core/performance/README.md#debouncing) page.
123123

124124
This only applies to DDL queries; DML statements (`SELECT`, `INSERT`...) are not debounced.

faq/favicon.ico

16.5 KB
Binary file not shown.

faq/logo.png

28.1 KB
Loading

manual/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ under the License.
2121

2222
Driver modules:
2323

24-
* [Core](core/): the main entry point, deals with connectivity and query execution.
25-
* [Query builder](query_builder/): a fluent API to create CQL queries programmatically.
26-
* [Mapper](mapper/): generates the boilerplate to execute queries and convert the results into
24+
* [Core](core/README.md): the main entry point, deals with connectivity and query execution.
25+
* [Query builder](query_builder/README.md): a fluent API to create CQL queries programmatically.
26+
* [Mapper](mapper/README.md): generates the boilerplate to execute queries and convert the results into
2727
application-level objects.
28-
* [Developer docs](developer/): explains the codebase and internal extension points for advanced
28+
* [Developer docs](developer/README.md): explains the codebase and internal extension points for advanced
2929
customization.
3030

3131
Common topics:
3232

33-
* [API conventions](api_conventions/)
34-
* [Case sensitivity](case_sensitivity/)
35-
* [OSGi](osgi/)
36-
* [Cloud](cloud/)
33+
* [API conventions](api_conventions/README.md)
34+
* [Case sensitivity](case_sensitivity/README.md)
35+
* [OSGi](osgi/README.md)
36+
* [Cloud](cloud/README.md)

manual/cloud/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,5 @@ public class Main {
146146
[Create an Astra database - AWS/Azure/GCP]: https://docs.datastax.com/en/astra/docs/creating-your-astra-database.html
147147
[Access an Astra database - AWS/Azure/GCP]: https://docs.datastax.com/en/astra/docs/obtaining-database-credentials.html#_sharing_your_secure_connect_bundle
148148
[Download the secure connect bundle - AWS/Azure/GCP]: https://docs.datastax.com/en/astra/docs/obtaining-database-credentials.html
149-
[minimal project structure]: ../core/integration/#minimal-project-structure
150-
[driver documentation]: ../core/configuration/
149+
[minimal project structure]: ../core/integration/README.md#minimal-project-structure
150+
[driver documentation]: ../core/configuration/README.md

0 commit comments

Comments
 (0)