diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..20e226b6e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,37 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + commands: + - pip install -r doc/requirements.txt + - make -C doc html + - mkdir -p _readthedocs + - mv -v doc/_build/html _readthedocs/ + +# Build documentation in the "docs/" directory with Sphinx +#sphinx: +# configuration: doc/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: doc/requirements.txt diff --git a/README.md b/README.md index 8be614084..dcb80da19 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # Rapid YAML [![MIT Licensed](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/biojppm/rapidyaml/blob/master/LICENSE.txt) [![release](https://img.shields.io/github/v/release/biojppm/rapidyaml?color=g&include_prereleases&label=release%20&sort=semver)](https://github.com/biojppm/rapidyaml/releases) +[![Documentation Status](https://readthedocs.org/projects/rapidyaml/badge/?version=latest)](https://rapidyaml.readthedocs.io/en/latest/?badge=latest) + [![PyPI](https://img.shields.io/pypi/v/rapidyaml?color=g)](https://pypi.org/project/rapidyaml/) [![Gitter](https://badges.gitter.im/rapidyaml/community.svg)](https://gitter.im/rapidyaml/community) -[![test](https://github.com/biojppm/rapidyaml/workflows/test/badge.svg?branch=master)](https://github.com/biojppm/rapidyaml/actions) [![Codecov](https://codecov.io/gh/biojppm/rapidyaml/branch/master/graph/badge.svg?branch=master)](https://codecov.io/gh/biojppm/rapidyaml) diff --git a/doc/Makefile b/doc/Makefile index 479716e2b..12b031254 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -16,8 +16,16 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +%: Makefile doxy + @echo "building from the makefile" + #$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @echo "overwrite doxygen files" + mkdir -p "$(BUILDDIR)" + cp -favr doxygen/html "$(BUILDDIR)/html" doxy: doxygen Doxyfile + +clean: + rm -rf doxygen/ + if [ ! -z "$(BUILDDIR)" ] ; then rm -rf "$(BUILDDIR)" ; fi diff --git a/doc/conf.py b/doc/conf.py index 3b55b97c8..f89145906 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,7 +20,7 @@ ] templates_path = ['_templates'] -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ['_build', 'doxygen', 'Thumbs.db', '.DS_Store'] # Tell sphinx what the primary language being documented is. primary_domain = 'cpp' @@ -37,11 +37,23 @@ html_static_path = ['_static'] +# ---------------------------------------------------------------------------- +# Overwrite with the Doxygen documentation +# https://stackoverflow.com/a/41199722 + +exclude_patterns += ["main.md", "include/*rst"] +import subprocess +this_dir = os.path.dirname(__file__) +subprocess.check_call(['doxygen', 'Doxyfile'], cwd=this_dir) +html_extra_path = ['./doxygen/html'] + + # ---------------------------------------------------------------------------- # Setup the doxyrest extension # https://vovkos.github.io/doxyrest/manual/basic.html # https://github.com/vovkos/doxyrest +''' # To get the binary: # git clone --recursive https://github.com/vovkos/doxyrest_b # cd doxyrest_b @@ -57,6 +69,7 @@ extensions += ['doxyrest', 'cpplexer'] +# commands to run """ set -xe ; \ cd ~/proj/rapidyaml ; \ @@ -69,6 +82,7 @@ doxyrest -c doxyrest-config.lua ; \ make html """ +''' # ---------------------------------------------------------------------------- diff --git a/doc/include/parse.rst b/doc/include/parse.rst index e1c4a5469..b259ee2b1 100644 --- a/doc/include/parse.rst +++ b/doc/include/parse.rst @@ -7,4 +7,3 @@ Parse utilities Parser ------ -.. doxygenclass:: c4::yml::Parser diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..5db0a0633 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,4 @@ +sphinx-rtd-theme +myst_parser +breathe +exhale diff --git a/ext/c4core b/ext/c4core index def5320ca..d2c1452c2 160000 --- a/ext/c4core +++ b/ext/c4core @@ -1 +1 @@ -Subproject commit def5320cad62b23c145e61192ad7cb4d1156d77c +Subproject commit d2c1452c28612a0745f99ef9a0dd24373f05e152 diff --git a/samples/quickstart.cpp b/samples/quickstart.cpp index bc9ec6c21..18c664c3f 100644 --- a/samples/quickstart.cpp +++ b/samples/quickstart.cpp @@ -2441,7 +2441,7 @@ void sample_fundamental_types() //----------------------------------------------------------------------------- -/** Shows how to deal with empty/null values. See also @ref Tree::val_is_null() */ +/** Shows how to deal with empty/null values. See also @ref c4::yml::Tree::val_is_null */ void sample_empty_null_values() { // reading empty/null values - see also sample_formatting() diff --git a/tbump.toml b/tbump.toml index 0f47f935f..6513a2092 100644 --- a/tbump.toml +++ b/tbump.toml @@ -36,7 +36,7 @@ src = "test/test_singleheader/CMakeLists.txt" search = "c4_project\\(VERSION {current_version}" [[file]] src = "doc/conf.py" -search = "release = ['\"]{current_version}['\"]" +search = "release\\s*=\\s*['\"]{current_version}['\"]" [[file]] src = "doc/Doxyfile" search = "PROJECT_NUMBER\\s*=\\s*{current_version}"