Skip to content

Commit

Permalink
Merge pull request #1 from Rishit-dagli/docs-setup
Browse files Browse the repository at this point in the history
Setup Docs
  • Loading branch information
Rishit-dagli authored Jan 8, 2023
2 parents 1c6c583 + 651e1a7 commit 701c445
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/sphinx-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Docs

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Free space in hosted agent
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v2

- uses: ammaraskar/sphinx-action@master
with:
pre-build-command: "apt-get install -y pandoc"
docs-folder: "docs/"

- name: Commit documentation changes
run: |
git clone https://${{ secrets.PAT }}@github.com/Rishit-dagli/3d-transforms.git --branch gh-pages --single-branch gh-pages
cp -r docs/build/html/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: ammaraskar/sphinx-action@master
with:
pre-build-command: "apt-get --allow-releaseinfo-change update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended imagemagick"
build-command: "make latexpdf"
docs-folder: "docs/"

# Create an artifact of the html output.
- uses: actions/upload-artifact@v2
if: "contains(github.event.head_commit.message, 'save artifact')"
with:
name: DocumentationHTML
path: docs/build/html/

# Create an artifact out of the previously built pdf.
- uses: actions/upload-artifact@v2
if: "contains(github.event.head_commit.message, 'save artifact')"
with:
name: Documentation
path: docs/build/latex/tensorflow3d-transforms.pdf
20 changes: 20 additions & 0 deletions docs/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 = 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)
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=source
set BUILDDIR=build

if "%1" == "" goto help

%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
)

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

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

:end
popd
6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Sphinx==4.2.0
tensorflow
sphinx-rtd-theme
sphinx-rtd-dark-mode
sphinxemoji
nbsphinx
83 changes: 83 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- 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
sys.path.insert(0, os.path.abspath('../..'))

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

project = 'TensorFlow3d Transforms'
copyright = '2023, Rishit Dagli'
author = 'Rishit Dagli'

# The full version, including alpha/beta/rc tags
release = '0.1.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.coverage",
"sphinx.ext.imgconverter",
"sphinx_rtd_dark_mode",
"sphinxemoji.sphinxemoji",
"nbsphinx",
]

# user starts in light mode
default_dark_mode = False

# Show doc coverage stats
coverage_show_missing_items = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# -- Options for LaTeX output -------------------------------------------------

latex_elements = {"extraclassoptions": "openany,oneside"}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
(
"latexindex",
"tensorflow3d-transforms.tex",
"TensorFlow3d Transforms Documentation",
"Rishit Dagli",
"manual",
),
]
41 changes: 41 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. TensorFlow3d Transforms documentation master file, created by
sphinx-quickstart on Sat Jan 7 23:26:33 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to TensorFlow3d Transforms's documentation!
===================================================

.. image:: https://img.shields.io/github/stars/Rishit-dagli/3d-transforms?style=social.svg
:target: https://github.com/Rishit-dagli/3d-transforms

.. image:: https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FRishit-dagli%2F3d-transforms.svg
:target: https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FRishit-dagli%2F3d-transforms

TensorFlow3d Transforms is a library to easily make 3D transformations and work with 3D data. This library originally started as a few functions here and there for my own work which I then turned into a library.

TensorFlow3d Transforms is designed to integrate smoothly with deep learning methods for predicting and manipulating 3D data. For this reason, all operators in TensorFlow3d Transforms:

- Are implemented using TensorFlow tensors
- Can handle minibatches of hetereogenous data
- Can be differentiated
- Can utilize GPUs for acceleration

Quick Links
------------

* Source: `GitHub <https://github.com/Rishit-dagli/3d-transforms>`_
* `Issue Tracker <https://github.com/Rishit-dagli/3d-transforms/issues>`_

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

tensorflow3d_transforms

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit 701c445

Please sign in to comment.