Skip to content

Add Sphinx docs #55

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

Merged
merged 7 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 7 additions & 0 deletions doc/CLI.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Command Line Interface
======================

.. argparse::
:module: cgnsutilities.cgns_utils
:func: get_parser
:prog: cgns_utils
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# 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)
25 changes: 25 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from sphinx_mdolab_theme.config import *

# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from unittest.mock import MagicMock

sys.path.insert(0, os.path.abspath("../"))

extensions.extend(["sphinxarg.ext"])

# -- Project information -----------------------------------------------------

project = "CGNS Utilities"


# We have to mock some stuff
# and sphinxarg.ext does NOT use the autodoc mock feature

for mod in ["cgnsutilities.libcgns_utils", "numpy"]:
sys.modules[mod] = MagicMock()
13 changes: 13 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. CGNS Utilities documentation master file, created by
sphinx-quickstart on Mon Mar 29 10:19:14 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to CGNS Utilities's documentation!
==========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

CLI
3 changes: 3 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx_mdolab_theme
sphinx-argparse