Skip to content

Commit 41a6d8c

Browse files
committed
Docs automation
Update README-dev.rst Prefer warnings Updated CHANGELOG Import README from original file Rollback spaces Fix spaces Fix spaces Added 404 Removed pipx
1 parent 3aec70d commit 41a6d8c

File tree

30 files changed

+1412
-21
lines changed

30 files changed

+1412
-21
lines changed

.github/workflows/pages.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "CI Docs"
2+
3+
on:
4+
push:
5+
branches:
6+
- latest
7+
tags:
8+
- '**'
9+
jobs:
10+
release:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
persist-credentials: false
18+
fetch-depth: 0
19+
- name: Set up Python
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.7
23+
- name: Set up Doxygen
24+
run: sudo apt-get install doxygen
25+
- name: Build Sphinx docs
26+
run: |
27+
export PATH=$PATH:~/.local/bin
28+
cd docs
29+
make multiversion
30+
- name: Deploy
31+
run : ./docs/_utils/deploy.sh
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
LATEST_VERSION: latest

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ testing/
44
.settings
55
.classpath
66
.project
7-
doc
8-
docs
7+
docs/_build
8+
docs/_source
9+
html
10+
latex
911
notes
1012
.DS_Store
1113

README-dev.rst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Building the Docs
2+
=================
3+
4+
*Note*: The docs build instructions have been tested with Sphinx 2.4.4 and Fedora 32.
5+
6+
To build and preview the docs locally, you will need to install the following software:
7+
8+
- `Git <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_
9+
- `Python 3.7 <https://www.python.org/downloads/>`_
10+
- `pip <https://pip.pypa.io/en/stable/installing/>`_
11+
- `doxygen <https://www.tutorialspoint.com/how-to-install-doxygen-on-ubuntu/>`_
12+
13+
Run the following command to build the docs.
14+
15+
.. code:: console
16+
17+
cd docs
18+
make preview
19+
20+
Once the command completes processing, open http://127.0.0.1:5500/ with your preferred browser.
21+
22+
Building multiple documentation versions
23+
========================================
24+
25+
Build Sphinx docs for all the versions defined in ``docs/conf.py``.
26+
27+
The multiverson command does not build doxygen docs.
28+
29+
.. code:: console
30+
31+
cd docs
32+
make multiversion
33+
34+
Then, open ``docs/_build/dirhtml/<version>/index.html`` with your preferred browser.
35+
36+
**NOTE:** If you only can see docs generated for the master branch, try to run ``git fetch --tags`` to download the latest tags from remote.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
```eval_rst
2+
:orphan:
3+
```
14
# Datastax Java Driver for Apache Cassandra®
25

36
*If you're reading this on github.com, please note that this is the readme

changelog/README.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
3.x versions get published.
66
-->
77

8-
## 3.10.1
8+
### 3.10.1
99

1010
- [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level.
1111
- [bug] JAVA-2843: Successfully parse DSE table schema in OSS driver.
1212

13-
## 3.10.0
13+
### 3.10.0
1414

1515
- [improvement] JAVA-2676: Don't reschedule flusher after empty runs
1616
- [new feature] JAVA-2772: Support new protocol v5 message format
1717

18-
## 3.9.0
18+
### 3.9.0
1919

2020
- [bug] JAVA-2627: Avoid logging error message including stack trace in request handler.
2121
- [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages.
2222
- [improvement] JAVA-2730: Add support for Cassandra® 4.0 table options
2323
- [improvement] JAVA-2702: Transient Replication Support for Cassandra® 4.0
2424

2525

26-
## 3.8.0
26+
### 3.8.0
2727

2828
- [new feature] JAVA-2356: Support for DataStax Cloud API.
2929
- [improvement] JAVA-2483: Allow to provide secure bundle via URL.
@@ -48,10 +48,9 @@
4848
- [bug] JAVA-2174: Metadata.needsQuote should accept empty strings.
4949
- [bug] JAVA-2193: Fix flaky tests in WarningsTest.
5050

51-
5251
### 3.7.0
5352

54-
- [improvement] JAVA-2025: Include exception message in Abstract\*Codec.accepts(null).
53+
- [improvement] JAVA-2025: Include exception message in Abstract*Codec.accepts(null).
5554
- [improvement] JAVA-1980: Use covariant return types in RemoteEndpointAwareJdkSSLOptions.Builder methods.
5655
- [documentation] JAVA-2062: Document frozen collection preference with Mapper.
5756
- [bug] JAVA-2071: Fix NPE in ArrayBackedRow.toString().
@@ -80,13 +79,13 @@
8079
- [bug] JAVA-1924: StatementWrapper setters should return the wrapping statement.
8180
- [new feature] JAVA-1532: Add Codec support for Java 8's LocalDateTime and ZoneId.
8281
- [improvement] JAVA-1786: Use Google code formatter.
83-
- [bug] JAVA-1871: Change LOCAL\_SERIAL.isDCLocal() to return true.
82+
- [bug] JAVA-1871: Change LOCAL_SERIAL.isDCLocal() to return true.
8483
- [documentation] JAVA-1902: Clarify unavailable & request error in DefaultRetryPolicy javadoc.
8584
- [new feature] JAVA-1903: Add WhiteListPolicy.ofHosts.
8685
- [bug] JAVA-1928: Fix GuavaCompatibility for Guava 26.
8786
- [bug] JAVA-1935: Add null check in QueryConsistencyException.getHost.
8887
- [improvement] JAVA-1771: Send driver name and version in STARTUP message.
89-
- [improvement] JAVA-1388: Add dynamic port discovery for system.peers\_v2.
88+
- [improvement] JAVA-1388: Add dynamic port discovery for system.peers_v2.
9089
- [documentation] JAVA-1810: Note which setters are not propagated to PreparedStatement.
9190
- [bug] JAVA-1944: Surface Read and WriteFailureException to RetryPolicy.
9291
- [bug] JAVA-1211: Fix NPE in cluster close when cluster init fails.
@@ -661,7 +660,7 @@ Merged from 2.2 branch:
661660
- [bug] JAVA-817: TimeCodec does not format values correctly.
662661
- [bug] JAVA-818: TypeCodec.getDataTypeFor() does not handle LocalDate instances.
663662
- [improvement] JAVA-836: Make ResultSet#fetchMoreResult return a
664-
ListenableFuture<ResultSet>.
663+
``ListenableFuture<ResultSet>``.
665664
- [improvement] JAVA-843: Disable frozen checks in mapper.
666665
- [improvement] JAVA-721: Allow user to register custom type codecs.
667666
- [improvement] JAVA-722: Support custom type codecs in mapper.
@@ -683,7 +682,7 @@ Merged from 2.2 branch:
683682
- [bug] JAVA-817: TimeCodec does not format values correctly.
684683
- [bug] JAVA-818: TypeCodec.getDataTypeFor() does not handle LocalDate instances.
685684
- [improvement] JAVA-836: Make ResultSet#fetchMoreResult return a
686-
ListenableFuture<ResultSet>.
685+
``ListenableFuture<ResultSet>``.
687686
- [improvement] JAVA-843: Disable frozen checks in mapper.
688687
- [improvement] JAVA-721: Allow user to register custom type codecs.
689688
- [improvement] JAVA-722: Support custom type codecs in mapper.
@@ -984,7 +983,7 @@ Merged from 2.0 branch:
984983
- [bug] JAVA-595: Fix cluster name mismatch check at startup.
985984
- [bug] JAVA-620: Fix guava dependency when using OSGI.
986985
- [bug] JAVA-678: Fix handling of DROP events when ks name is case-sensitive.
987-
- [improvement] JAVA-631: Use List<?> instead of List<Object> in QueryBuilder API.
986+
- [improvement] JAVA-631: Use ``List<?>`` instead of ``List<Object>`` in QueryBuilder API.
988987
- [improvement] JAVA-654: Exclude Netty POM from META-INF in shaded JAR.
989988
- [bug] JAVA-655: Quote single quotes contained in table comments in asCQLQuery method.
990989
- [bug] JAVA-684: Empty TokenRange returned in a one token cluster.
@@ -1235,7 +1234,7 @@ Merged from 2.0.10_fixes branch:
12351234
- [bug] JAVA-595: Fix cluster name mismatch check at startup.
12361235
- [bug] JAVA-620: Fix guava dependency when using OSGI.
12371236
- [bug] JAVA-678: Fix handling of DROP events when ks name is case-sensitive.
1238-
- [improvement] JAVA-631: Use List<?> instead of List<Object> in QueryBuilder API.
1237+
- [improvement] JAVA-631: Use ``List<?>`` instead of ``List<Object>`` in QueryBuilder API.
12391238
- [improvement] JAVA-654: Exclude Netty POM from META-INF in shaded JAR.
12401239
- [bug] JAVA-655: Quote single quotes contained in table comments in asCQLQuery method.
12411240
- [bug] JAVA-684: Empty TokenRange returned in a one token cluster.

docs/Makefile

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# You can set these variables from the command line.
2+
POETRY = $(HOME)/.poetry/bin/poetry
3+
SPHINXOPTS =
4+
SPHINXBUILD = $(POETRY) run sphinx-build
5+
PAPER =
6+
BUILDDIR = _build
7+
SOURCE_DIR = _source
8+
9+
# Internal variables.
10+
PAPEROPT_a4 = -D latex_paper_size=a4
11+
PAPEROPT_letter = -D latex_paper_size=letter
12+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE_DIR)
13+
# the i18n builder cannot share the environment and doctrees with the others
14+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
15+
16+
.PHONY: all
17+
all: dirhtml
18+
19+
.PHONY: pristine
20+
pristine: clean
21+
git clean -dfX
22+
23+
.PHONY: setup
24+
setup:
25+
./_utils/setup.sh
26+
cp -Tr source $(SOURCE_DIR)
27+
cd $(SOURCE_DIR) && find -name README.md -execdir mv '{}' index.md ';'
28+
.PHONY: clean
29+
clean:
30+
rm -rf $(BUILDDIR)/*
31+
rm -rf $(SOURCE_DIR)/*
32+
33+
.PHONY: preview
34+
preview: setup
35+
cd .. && ./docs/_utils/doxygen.sh
36+
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
37+
38+
.PHONY: dirhtml
39+
dirhtml: setup
40+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
41+
@echo
42+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
43+
44+
.PHONY: singlehtml
45+
singlehtml: setup
46+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
47+
@echo
48+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
49+
50+
.PHONY: epub
51+
epub: setup
52+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
53+
@echo
54+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
55+
56+
.PHONY: epub3
57+
epub3: setup
58+
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
59+
@echo
60+
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
61+
62+
.PHONY: dummy
63+
dummy: setup
64+
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
65+
@echo
66+
@echo "Build finished. Dummy builder generates no files."
67+
68+
.PHONY: linkcheck
69+
linkcheck: setup
70+
$(SPHINXBUILD) -b linkcheck $(SOURCE_DIR) $(BUILDDIR)/linkcheck
71+
72+
.PHONY: multiversion
73+
multiversion: setup
74+
@mkdir -p $(HOME)/.cache/pypoetry/virtualenvs
75+
$(POETRY) run ./_utils/multiversion.sh
76+
@echo
77+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
78+

docs/_utils/deploy.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Clone repo
4+
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" --branch gh-pages --single-branch gh-pages
5+
cp -r docs/_build/dirhtml/* gh-pages
6+
# Redirections
7+
./docs/_utils/redirect.sh > gh-pages/index.html
8+
# Deploy
9+
cd gh-pages
10+
touch .nojekyll
11+
git config --local user.email "[email protected]"
12+
git config --local user.name "GitHub Action"
13+
git add .
14+
git commit -m "Publish docs" || true
15+
git push origin gh-pages --force

docs/_utils/doxygen.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
OUTPUT_DIR="docs/_build/dirhtml/api"
4+
if [[ "$SPHINX_MULTIVERSION_OUTPUTDIR" != "" ]]; then
5+
OUTPUT_DIR="$SPHINX_MULTIVERSION_OUTPUTDIR/api"
6+
echo "HTML_OUTPUT = $OUTPUT_DIR" >> doxyfile
7+
fi
8+
mkdir -p "$OUTPUT_DIR"
9+
doxygen doxyfile

docs/_utils/multiversion.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/bash
2+
3+
cd .. && sphinx-multiversion docs/source docs/_build/dirhtml \
4+
--pre-build './docs/_utils/doxygen.sh' \
5+
--pre-build "find docs/source -name README.md -execdir mv '{}' index.md ';'"

docs/_utils/redirect.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
cat <<- _EOF_
4+
<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<title>Redirecting to Driver</title>
8+
<meta charset="utf-8">
9+
<meta http-equiv="refresh" content="0; URL=./${LATEST_VERSION}/index.html">
10+
<link rel="canonical" href="./${LATEST_VERSION}/index.html">
11+
</head>
12+
</html>
13+
_EOF_

docs/_utils/redirections.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api: /api/classes.html

docs/_utils/setup.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/bash
2+
3+
if pwd | egrep -q '\s'; then
4+
echo "Working directory name contains one or more spaces."
5+
exit 1
6+
fi
7+
8+
which python3 || { echo "Failed to find python3. Try installing Python for your operative system: https://www.python.org/downloads/" && exit 1; }
9+
which poetry || curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/1.1.3/get-poetry.py | python3 - && source ${HOME}/.poetry/env
10+
poetry install

0 commit comments

Comments
 (0)