Skip to content

Commit

Permalink
docs: add myst parser
Browse files Browse the repository at this point in the history
chore: add myst parser
  • Loading branch information
dgarcia360 authored and roydahan committed Jun 13, 2024
1 parent 1263a7f commit fa0f270
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 23 deletions.
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ setup:
$(POETRY) install
$(POETRY) update
cd .. && doxygen Doxyfile.in
cp -TLr source $(SOURCEDIR)
@if [ ! -d "$(SOURCEDIR)" ]; then mkdir -p "$(SOURCEDIR)"; fi
cp -RL source/* $(SOURCEDIR)
cd $(SOURCEDIR) && find . -name README.md -execdir mv '{}' index.md ';'

# Clean commands
Expand Down
2 changes: 1 addition & 1 deletion docs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ breathe="4.35.0"
python = "^3.9"
pyyaml = "6.0.1"
pygments = "2.15.1"
recommonmark = "0.7.1"
redirects_cli ="~0.1.2"
sphinx-scylladb-theme = "~1.7.2"
sphinx-sitemap = "2.5.1"
sphinx-autobuild = "2021.3.14"
Sphinx = "7.2.6"
sphinx-multiversion-scylla = "~0.3.1"
sphinx-scylladb-markdown = "^0.1.2"
[tool.poetry.dev-dependencies]
pytest = "5.2"

Expand Down
23 changes: 8 additions & 15 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import re
import sys
from datetime import date
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser
from sphinx_scylladb_theme.utils import multiversion_regex_builder

# -- General configuration
Expand Down Expand Up @@ -32,16 +30,14 @@
'sphinx_sitemap',
'sphinx_scylladb_theme',
'sphinx_multiversion',
'breathe'
'breathe',
'sphinx_scylladb_markdown'
]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
source_suffix = ['.rst']
autosectionlabel_prefix_document = True

# A list of warning types to suppress arbitrary warning messages.
Expand Down Expand Up @@ -79,6 +75,11 @@
# Prefix added to all the URLs generated in the 404 page.
notfound_urls_prefix = ''

# -- Options for markdown extension
scylladb_markdown_enable = True
scylladb_markdown_recommonmark_versions = []
suppress_warnings = ["myst.header","myst.xref_missing"]

# -- Options for redirect extension
# Read a YAML dictionary of redirections and generate an HTML file for each
redirects_file = "_utils/redirections.yaml"
Expand Down Expand Up @@ -186,14 +187,6 @@ def replace_relative_links(app, docname, source):

# Initialize Sphinx
def setup(app):
# Setup MarkDown
app.add_source_parser(CommonMarkParser)
app.add_config_value('recommonmark_config', {
'enable_eval_rst': True,
'enable_auto_toc_tree': False,
}, True)
app.add_transform(AutoStructify)

# Workaround to replace DataStax links
replacements = [
{"http://datastax.github.io/cpp-driver/api/cassandra.h/": "https://cpp-driver.docs.scylladb.com/" + smv_latest_version + "/api"},
Expand Down
2 changes: 1 addition & 1 deletion topics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ with other drivers. Such features can be found (and requested) on our [GH].
[post]: http://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra
[GH]: https://github.com/scylladb/cpp-driver/issues
```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion topics/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
</tbody>
</table>

```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion topics/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ expensive or long-running future callbacks are used (via
[latency-aware]: http://datastax.github.io/cpp-driver/topics/configuration#token-aware-routing
[paging]: http://datastax.github.io/cpp-driver/topics/basics/handling_results#paging

```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion topics/dse_features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* [DSE plaintext and GSSAPI authentication](authentication)
* [DSE geospatial types](geotypes)

```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion topics/security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int main() {

[`cass_cluster_set_credentials()`]: http://datastax.github.io/cpp-driver/api/struct.CassCluster#function-cass_cluster_set_credentials_n

```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down
2 changes: 1 addition & 1 deletion topics/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Here are some of the items being scheduled for future enhancements.

[build procedures]: http://datastax.github.io/cpp-driver/topics/building#test-dependencies-and-building-tests-not-required

```eval_rst
```{eval-rst}
.. toctree::
:hidden:
:glob:
Expand Down

0 comments on commit fa0f270

Please sign in to comment.