Skip to content

Commit 79b00f1

Browse files
Copilotdjw8605
andcommitted
Add complete ReadTheDocs documentation with Sphinx
Co-authored-by: djw8605 <[email protected]>
1 parent fff47ae commit 79b00f1

File tree

97 files changed

+12893
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+12893
-5
lines changed

.readthedocs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ReadTheDocs Configuration File
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.11"
10+
apt_packages:
11+
- doxygen
12+
13+
sphinx:
14+
configuration: docs/conf.py
15+
16+
python:
17+
install:
18+
- requirements: docs/requirements.txt

Doxyfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Doxyfile configuration for SciTokens C++ library
2+
3+
# Project related configuration options
4+
PROJECT_NAME = "SciTokens C++"
5+
PROJECT_NUMBER = "1.0.2"
6+
PROJECT_BRIEF = "A C++ Library to interface to scitokens"
7+
OUTPUT_DIRECTORY = docs/_build/doxygen
8+
9+
# Build related configuration options
10+
EXTRACT_ALL = YES
11+
EXTRACT_PRIVATE = NO
12+
EXTRACT_STATIC = YES
13+
EXTRACT_LOCAL_CLASSES = NO
14+
15+
# Configuration options related to the input files
16+
INPUT = src/scitokens.h
17+
FILE_PATTERNS = *.h *.hpp *.cpp
18+
RECURSIVE = NO
19+
EXCLUDE_PATTERNS = */vendor/* */build/* */_build/*
20+
21+
# Configuration options related to source browsing
22+
SOURCE_BROWSER = YES
23+
INLINE_SOURCES = NO
24+
STRIP_CODE_COMMENTS = YES
25+
26+
# Configuration options related to the alphabetical class index
27+
ALPHABETICAL_INDEX = YES
28+
29+
# Configuration options related to the HTML output
30+
GENERATE_HTML = NO
31+
GENERATE_LATEX = NO
32+
GENERATE_XML = YES
33+
XML_OUTPUT = xml
34+
35+
# Configuration options related to the preprocessor
36+
ENABLE_PREPROCESSING = YES
37+
MACRO_EXPANSION = YES
38+
EXPAND_ONLY_PREDEF = NO
39+
SEARCH_INCLUDES = YES
40+
INCLUDE_PATH = src/
41+
PREDEFINED = __cplusplus
42+
43+
# Configuration options related to external references
44+
TAGFILES =
45+
GENERATE_TAGFILE =
46+
47+
# Configuration options related to the dot tool
48+
HAVE_DOT = NO
49+
50+
# Configuration options related to the search engine
51+
SEARCHENGINE = NO

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SciTokens C++ Documentation
2+
3+
This directory contains the Sphinx documentation for the SciTokens C++ library.
4+
5+
## Building the Documentation
6+
7+
### Prerequisites
8+
9+
1. Install Python dependencies:
10+
```bash
11+
pip install -r requirements.txt
12+
```
13+
14+
2. Install Doxygen (for API extraction):
15+
```bash
16+
# Ubuntu/Debian
17+
sudo apt install doxygen
18+
19+
# CentOS/RHEL
20+
sudo yum install doxygen
21+
```
22+
23+
### Building
24+
25+
From this directory, run:
26+
27+
```bash
28+
make html
29+
```
30+
31+
Or using sphinx-build directly:
32+
33+
```bash
34+
sphinx-build -b html . _build/html
35+
```
36+
37+
The generated documentation will be in `_build/html/`.
38+
39+
## Documentation Structure
40+
41+
- `index.rst` - Main documentation page
42+
- `installation.rst` - Installation and building instructions
43+
- `api.rst` - API reference (auto-generated from source comments)
44+
- `examples.rst` - Usage examples
45+
- `conf.py` - Sphinx configuration
46+
- `requirements.txt` - Python dependencies
47+
48+
## ReadTheDocs Integration
49+
50+
This documentation is configured for ReadTheDocs. See `.readthedocs.yml` in the project root for the configuration.
51+
52+
The documentation will automatically build when pushed to the repository.
53+
54+
## Adding Examples
55+
56+
Examples in `examples.rst` are based on the test cases in the `test/` directory. When adding new functionality, please:
57+
58+
1. Add appropriate docstring comments to the public API functions in `src/scitokens.h`
59+
2. Add usage examples to `examples.rst`
60+
3. Test that the documentation builds without warnings

docs/_build/doxygen/xml/Doxyfile.xml

Lines changed: 354 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- XSLT script to combine the generated output into a single file.
2+
If you have xsltproc you could use:
3+
xsltproc combine.xslt index.xml >all.xml
4+
-->
5+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
6+
<xsl:output method="xml" version="1.0" indent="no" standalone="yes" />
7+
<xsl:template match="/">
8+
<doxygen version="{doxygenindex/@version}" xml:lang="{doxygenindex/@xml:lang}">
9+
<!-- Load all doxygen generated xml files -->
10+
<xsl:for-each select="doxygenindex/compound">
11+
<xsl:copy-of select="document( concat( @refid, '.xml' ) )/doxygen/*" />
12+
</xsl:for-each>
13+
</doxygen>
14+
</xsl:template>
15+
</xsl:stylesheet>

0 commit comments

Comments
 (0)