Skip to content

Commit

Permalink
doxygen for readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Apr 11, 2024
1 parent e324c20 commit 02389a6
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 8 deletions.
37 changes: 37 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
<!-- [![Coveralls](https://coveralls.io/repos/github/biojppm/rapidyaml/badge.svg?branch=master)](https://coveralls.io/github/biojppm/rapidyaml) -->
[![Codecov](https://codecov.io/gh/biojppm/rapidyaml/branch/master/graph/badge.svg?branch=master)](https://codecov.io/gh/biojppm/rapidyaml)

Expand Down
12 changes: 10 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 15 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -57,6 +69,7 @@
extensions += ['doxyrest', 'cpplexer']
# commands to run
"""
set -xe ; \
cd ~/proj/rapidyaml ; \
Expand All @@ -69,6 +82,7 @@
doxyrest -c doxyrest-config.lua ; \
make html
"""
'''


# ----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion doc/include/parse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ Parse utilities
Parser
------

.. doxygenclass:: c4::yml::Parser
4 changes: 4 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx-rtd-theme
myst_parser
breathe
exhale
2 changes: 1 addition & 1 deletion ext/c4core
2 changes: 1 addition & 1 deletion samples/quickstart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 02389a6

Please sign in to comment.