From 54ceac8f3890be87e91e8e7d84fa7c74748fad98 Mon Sep 17 00:00:00 2001 From: Sajtospoga01 Date: Fri, 15 Dec 2023 16:42:56 +0000 Subject: [PATCH] adds autodoc, main, and projects, gitignore, config for style and pipeline --- .github/workflows/documentation.yml | 77 +++++++++++++++++++++++++++++ .gitignore | 1 + docs/Makefile | 20 ++++++++ docs/make.bat | 35 +++++++++++++ docs/source/conf.py | 43 ++++++++++++++++ docs/source/index.rst | 27 ++++++++++ docs/source/main.md | 15 ++++++ docs/source/projects.md | 12 +++++ docs/source/style/custom.css | 42 ++++++++++++++++ 9 files changed, 272 insertions(+) create mode 100644 .github/workflows/documentation.yml create mode 100644 .gitignore create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst create mode 100644 docs/source/main.md create mode 100644 docs/source/projects.md create mode 100644 docs/source/style/custom.css diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..38d543a --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,77 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy Documentation on Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U sphinx + pip install furo + pip install myst-parser + + - name: Build documentation + run: | + cd docs + sphinx-apidoc -e -M --force -o . ../utilities/ + make html + - name: Upload build data + uses: actions/upload-artifact@v3 + with: + name: documentation + path: ./docs/build/html + + deploy: + needs: build + environment: + name: documentation + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Download built directory + uses: actions/download-artifact@v3 + with: + name: documentation + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 + with: + folder: build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e4469a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/docs/build/ \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -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 = source +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) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..dc1312a --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +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 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..21bc5cf --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,43 @@ +# 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 = 'teamdocs' +copyright = '2023, GU Orbit Software Team' +author = 'GU Orbit Software Team' +release = '0.1.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'myst_parser', +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'furo' +html_static_path = ['style'] +html_css_files = ["custom.css"] + +autodoc_typehints = "signature" +autodoc_typehints_description_target = "documented_params" + +html_theme_options = { + "dark_css_variables": { + "color-api-background": "#202020", + "color-api-background-hover": "#505050", + "color-sidebar-item-background--current": "#303030", + "color-sidebar-item-background--hover": "#303030", + }, +} diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..e6fa637 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,27 @@ +.. teamdocs documentation master file, created by + sphinx-quickstart on Fri Dec 15 16:19:22 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to teamdocs's documentation! +==================================== + + +On this page you find the documentation for the GU Orbit software team. + + + +.. toctree:: + :maxdepth: 2 + :caption: Table of contents: + + + main.md + projects.md + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/main.md b/docs/source/main.md new file mode 100644 index 0000000..2b01db5 --- /dev/null +++ b/docs/source/main.md @@ -0,0 +1,15 @@ +# Hello world + +a lot of other stuf here ... +```python +print("Hello world") +``` + +
+Click to expand + +```python +print("Hello world") +``` + +
diff --git a/docs/source/projects.md b/docs/source/projects.md new file mode 100644 index 0000000..7337305 --- /dev/null +++ b/docs/source/projects.md @@ -0,0 +1,12 @@ +# GU Orbit Software projects + +## Utilities + +Library providing common functionality for GU Orbit Software projects, including: +- Dataloaders +- Image Manipulation + +|Code|Docs|Wiki| +|---|---|---| +|[Utilities](https://github.com/guorbit/utilities)|[Docs](https://guorbit.github.io/utilities/)|[Wiki](https://github.com/guorbit/utilities/wiki)| + diff --git a/docs/source/style/custom.css b/docs/source/style/custom.css new file mode 100644 index 0000000..d583304 --- /dev/null +++ b/docs/source/style/custom.css @@ -0,0 +1,42 @@ +dl.py .field-list dt { + text-transform: none !important; +} + +.title-class { + font-size: 16px; +} + +h1 { + font-size: 32px +} + +h2 { + font-size: 24px; +} +.sidebar-search { + + border-bottom: 0px !important; + border-top: 0px !important; +} + +.sidebar-search-container { + background-color: #303030; + border-radius: .25rem; + margin-right: .5rem; + border-bottom: 0px; + border-top: 0px; +} + +.sidebar-tree { + background-color: #303030; + border-radius: .25rem; + margin-right: .5rem; + border-bottom: 0px; + border-top: 0px; +} + + + +#sidebar li.toctree-l1:not(.current){ + display: none; + } \ No newline at end of file