Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from MemerGamer/4-implement-sphinx-documentatio…
Browse files Browse the repository at this point in the history
…n-creation-action

Resolve "Implement Sphinx documentation creation action"
  • Loading branch information
MemerGamer authored Jan 4, 2024
2 parents 1e37820 + 276ee12 commit 942e62c
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install System Dependencies
run: sudo apt-get install -y libegl1-mesa
- name: Install dependencies
run: |
pip install sphinx furo myst_parser
pip install -r requirements.txt
- name: Sphinx build
run: sphinx-build docs _build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,6 @@ build*/
*.qmlproject.user.*
*.ui.user
*.ui.user.*

# Sphinx documentation
_build/
14 changes: 14 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Minimal makefile for Sphinx documentation

SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = ./
BUILDDIR = _build

help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import sys

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

project = "Manim Studio"
copyright = "Kovács Bálint-Hunor"
author = "Kovács Bálint-Hunor"
release = "0.1"


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

extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
]

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 = "furo"
html_static_path = ["_static"]

# autodoc_mock_imports = ["main", "form_ui"]
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
7 changes: 7 additions & 0 deletions docs/form_ui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
form_ui module
==============

.. automodule:: form_ui
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. Example documentation master file, created by
sphinx-quickstart on Sat Sep 23 20:35:12 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ManimStudio's documentation!
=======================================

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

main
form_ui

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
7 changes: 7 additions & 0 deletions docs/main.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
main module
===========

.. automodule:: main
:members:
:undoc-members:
:show-inheritance:
35 changes: 35 additions & 0 deletions docs/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

0 comments on commit 942e62c

Please sign in to comment.