Skip to content

Commit

Permalink
Add readthedocs support.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackz314 committed Apr 14, 2021
1 parent ff6bc1b commit 8c4a89c
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -142,4 +142,4 @@ dmypy.json
# Cython debug symbols
cython_debug/

/docs/generated/
/doc/generated/
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the doc/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optionally build your doc in additional formats such as PDF
#formats:
# - pdf

# Optionally set the version of Python and requirements required to build your doc
python:
version: 3.8
install:
- requirements: requirements_doc.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eeglabio
# eeglabio [![Documentation Status](https://readthedocs.org/projects/eeglabio/badge/?version=latest)](https://eeglabio.readthedocs.io/en/latest/?badge=latest)

I/O support for EEGLAB files in Python.

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions doc/_static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
generated/
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 13 additions & 2 deletions docs/conf.py → doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@
import sys
currdir = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(currdir, '..')))
sys.path.append(os.path.abspath('..'))

import eeglabio
version = None
with open(os.path.join(currdir, '..', 'eeglabio', '_version.py'), 'r') as fid:
for line in (line.strip() for line in fid):
if line.startswith('__version__'):
version = line.split('=')[1].strip().strip("'")
break
if version is None:
version = "0.0.1"

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

Expand All @@ -24,7 +32,7 @@
author = 'Jack Zhang'

# The full version, including alpha/beta/rc tags
release = eeglabio.__version__
release = version


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -76,3 +84,6 @@
# 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']

print(currdir)
print(sys.path)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 35 additions & 35 deletions docs/make.bat → doc/make.bat
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
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
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
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
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sphinx==3.5.4
numpydoc==1.1.0
pydata-sphinx-theme==0.6.0
sphinx_copybutton
# readthedocs don't work without these
numpy
scipy

0 comments on commit 8c4a89c

Please sign in to comment.