Skip to content

docs: single toctree #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions README-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,54 @@ Run the following command to build the docs.

Once the command completes processing, open http://127.0.0.1:5500/ with your preferred browser.

To know more about how docs are generated, see `Sphinx ScyllaDB Theme <https://sphinx-theme.scylladb.com/>`_.

Building multiple documentation versions
========================================

Build Sphinx docs for all the versions defined in ``docs/conf.py``.
Build Sphinx docs for all the versions defined in `docs/conf.py <https://sphinx-theme.scylladb.com/stable/configuration.html#defining-supported-versions>`_.

.. code:: console

cd docs
make multiversion
make multiversionpreview

Then, open ``docs/_build/dirhtml/<version>/index.html`` with your preferred browser.
Once the command completes processing, open http://0.0.0.0:5500/ with your preferred browser.

**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.

Defining supported versions
===========================

This repository mirrors DataStax's `java-driver <https://github.com/datastax/java-driver>`_ with custom features and bug fixes to be compatible with ScyllaDB.

Every time there is a new upstream version, the DataStax repository changes are taken as the base, and the previous custom commits are cherry-picked on top.
This workflow differs from how other forked driver repositories are maintained, where all changes from upstream are integrated into a default branch (typically master or latest).

In practice, we need to port the documentation generator and custom changes done for every new release, as we do with code changes that are not available in the latest upstream version.

**Steps**

Let's say you want to generate docs for the version ``1.0-scylla``.
You have already ported the custom ScyllaDB changes to the target branch, but you want to publish HTML docs for the new version.

1. Copy the next files from ``latest`` to the branch you want to enable docs generation. For our case, this would be a branch named ``1.0-scylla``.

* ``docs``: Contains the documentation generation system and how docs are structured.
* ``README.md``: A custom page describing the specifics for the ScyllaDB plugin.

2. Commit & push the copied files into the target branch. Make sure the docs build without errors:

.. code:: console

cd docs
make preview

3. Move back to the ``latest`` branch. List the target version in ``docs/conf.py``.

.. code:: python

BRANCHES = ['1.0-scylla']
smv_branch_whitelist = multiversion_regex_builder(BRANCHES)

4. Commit & push the changes to the ``latest`` branch.
1 change: 1 addition & 0 deletions docs/_utils/javadoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ fi

# Generate javadoc
mvn javadoc:javadoc
[ -d $OUTPUT_DIR ] && rm -r $OUTPUT_DIR
mkdir -p "$OUTPUT_DIR"
mv -f driver-core/target/site/apidocs/* $OUTPUT_DIR
1 change: 0 additions & 1 deletion docs/source/changelog

This file was deleted.

2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ class DitaaLexer(BashLexer):
# Dictionary of values to pass into the template engine’s context for all pages
html_context = {'html_baseurl': html_baseurl}

# Supress warnings
suppress_warnings = ['autosectionlabel.*']
# -- Options for not found extension -------------------------------------------

# Template used to render the 404.html generated by this extension.
Expand Down
27 changes: 26 additions & 1 deletion docs/source/contents.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: Getting Started

index
api

.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: Manual

manual/*
manual/**

.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: Upgrade Guide

upgrade_guide/*
upgrade_guide/**

.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: FAQ

faq/*
changelog/*
faq/**
3 changes: 0 additions & 3 deletions faq/osgi/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
```eval_rst
:orphan:
```
## Frequently Asked Questions - OSGi

### How to use the Java driver in an OSGi environment?
Expand Down
35 changes: 0 additions & 35 deletions manual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,38 +305,3 @@ simply navigate to each sub-directory.
[SchemaChangeListener]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/SchemaChangeListener.html
[NoHostAvailableException]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/exceptions/NoHostAvailableException.html
[LocalDate]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/LocalDate.html

```eval_rst
.. toctree::
:hidden:
:glob:

address_resolution/*
async/*
auth/*
cloud/*
compression/*
control_connection/*
custom_codecs/*
custom_payloads/*
idempotence/*
load_balancing/*
logging/*
metadata/*
metrics/*
native_protocol/*
object_mapper/*
osgi/*
paging/*
pooling/*
query_timestamps/*
reconnection/*
retries/*
shaded_jar/*
socket_options/*
speculative_execution/*
ssl/*
statements/*
tuples/*
udts/*
```
3 changes: 0 additions & 3 deletions manual/custom_codecs/extras/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
```eval_rst
:orphan:
```
## Optional codecs

The driver's "extras" module provides additional [codec](../) implementations: these codecs are not required by core
Expand Down
9 changes: 0 additions & 9 deletions manual/object_mapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,3 @@ See the child pages for more information:
* [using the mapper](using/)
* [using custom codecs](custom_codecs/)

```eval_rst
.. toctree::
:hidden:
:glob:

creating/*
custom_codecs/*
using/*
```
11 changes: 0 additions & 11 deletions manual/statements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,3 @@ wrap your statements in a custom [StatementWrapper] implementation.
[SpeculativeExecutionPolicy]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.html
[execute]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#execute-com.datastax.driver.core.Statement-
[executeAsync]: https://docs.datastax.com/en/drivers/java/3.10/com/datastax/driver/core/Session.html#executeAsync-com.datastax.driver.core.Statement-

```eval_rst
.. toctree::
:hidden:
:glob:

simple/*
prepared/*
built/*
batch/*
```
7 changes: 0 additions & 7 deletions upgrade_guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,3 @@ exhaustive list of new features in 2.0.
(`ResultSet#getAvailableWithoutFetching` and `ResultSet#isFullyFetched`)
as well as a mean to force the pre-fetching of the next page (`ResultSet#fetchMoreResults`).

```eval_rst
.. toctree::
:hidden:
:glob:

migrating_from_astyanax/*
```
9 changes: 0 additions & 9 deletions upgrade_guide/migrating_from_astyanax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,3 @@ See the child pages for more information:
* [Migrating Astyanax configurations to DataStax Java driver configurations](configuration/)
* [Querying and retrieving results comparisons.](queries_and_results/)

```eval_rst
.. toctree::
:hidden:
:glob:

configuration/*
language_level_changes/*
queries_and_results/*
```