Skip to content

Commit

Permalink
doc: basic sphinx setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sehoffmann committed Oct 23, 2024
1 parent 453a841 commit 3458cab
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/data
/slurm-*.out
/wandb
/doc/_build

############################ Auto Generated ############################

Expand Down
1 change: 1 addition & 0 deletions ci_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ wheel
build
pre-commit
pytest
sphinx
7 changes: 6 additions & 1 deletion dmlcloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from dmlcloud.stage import Stage, TrainValStage

__version__ = "0.3.3"

__all__ = []
__all__ = [
'Stage',
'TrainValStage',
]
4 changes: 4 additions & 0 deletions dmlcloud/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from .util.distributed import is_root
from .util.logging import DevNullIO, flush_log_handlers

__all__ = [
'Stage',
'TrainValStage',
]

class Stage:
"""
Expand Down
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)
32 changes: 32 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'dmlcloud'
copyright = '2024, Sebastian Hoffmann'
author = 'Sebastian Hoffmann'
release = 'v0.3.3'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'classic'
html_static_path = ['_static']
19 changes: 19 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. dmlcloud documentation master file, created by
sphinx-quickstart on Wed Oct 23 17:33:47 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
dmlcloud
======================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.

.. toctree::
:caption: Contents:

reference



35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions doc/reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Reference
=========

.. autosummary::
:toctree: generated

dmlcloud

0 comments on commit 3458cab

Please sign in to comment.