set up docs

This commit is contained in:
Tony031218 2021-01-24 09:49:29 +08:00
parent 9bd4f6714f
commit 5dbc7d807f
8 changed files with 192 additions and 0 deletions

20
docs/Makefile Normal file
View file

@ -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
docs/make.bat Normal file
View file

@ -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.http://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

56
docs/source/conf.py Normal file
View file

@ -0,0 +1,56 @@
# 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:
# http://www.sphinx-doc.org/en/master/config
# -- 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 = 'manim'
copyright = '2021, TonyCrane'
author = 'TonyCrane'
release = '0.1'
# -- 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.todo',
'sphinx.ext.githubpages',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx_rtd_theme'
]
autoclass_content = 'both'
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
pygments_style = 'default'
# html_static_path = ['assets']
html_theme = 'sphinx_rtd_theme'
# html_favicon = '../../logo/graph.png'
html_logo = '../../logo/transparent_graph.png'
html_theme_options = {
'logo_only': True,
'style_nav_header_background': '#343131',
}

22
docs/source/index.rst Normal file
View file

@ -0,0 +1,22 @@
Manim's documentation
=====================
.. image:: ../../logo/white_with_name.png
Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as seen in the videos
at `3Blue1Brown <https://www.3blue1brown.com/>`_.
.. toctree::
:maxdepth: 2
install/index
quickstart/index
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View file

@ -0,0 +1,57 @@
Installation
============
Manim runs on Python 3.8.
System requirements are `FFmpeg <https://ffmpeg.org/>`__,
`OpenGL <https://www.opengl.org//>`__ and
`latex <https://www.latex-project.org>`__ (optional, if you want to use
LaTeX).
Directly
--------
If you want to hack on manimlib itself, clone this repository and in
that directory execute:
.. code:: sh
# Install python requirements
pip install -r requirements.txt
# Try it out
python -m manim example_scenes.py OpeningManimExample
Directly (Windows)
------------------
1. `Install
FFmpeg <https://www.wikihow.com/Install-FFmpeg-on-Windows>`__.
2. Install a LaTeX distribution.
`MiKTeX <https://miktex.org/download>`__ is recommended.
3. Install the remaining Python packages.
.. code:: sh
git clone https://github.com/3b1b/manim.git
cd manim
pip install -r requirements.txt
python manim.py example_scenes.py OpeningManimExample
For Anaconda
----------------
- Install latex as above.
- Create a conda environment using
``conda env create -f environment.yml``
Using virtualenv and virtualenvwrapper
----------------------------------------------
After installing virtualenv and virtualenvwrapper
.. code:: sh
git clone https://github.com/3b1b/manim.git
mkvirtualenv -a manim -r requirements.txt manim
python -m manim example_scenes.py OpeningManimExample

View file

@ -0,0 +1,2 @@
Quick Start
===========

BIN
logo/transparent_graph.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
logo/white_with_name.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB