Skip to content

Commit

Permalink
Merge pull request #163 from ONEcampaign/162-docs
Browse files Browse the repository at this point in the history
162 docs
  • Loading branch information
jm-rivera authored Feb 7, 2023
2 parents 222e3b9 + 369e845 commit 13051af
Show file tree
Hide file tree
Showing 12 changed files with 2,422 additions and 412 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build documentation
name: documentation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
documentation:
runs-on: ubuntu-latest
name: Build documentation
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install package
run: poetry install

- name: Build documentation
run: poetry run make html --directory docs/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ ENV/
# downloaded files
./bblocks/.raw_data/*.csv
./bblocks/.raw_data/*.feather

# Sphinx documentation
docs/_build/
File renamed without changes.
22 changes: 5 additions & 17 deletions README.rst → README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
The bblocks package
===================

|pypi| |python| |Documentation| |codecov|


**bblocks** is a python package with tools to download and analyse
development data. These tools are meant to be the *building blocks* of
Expand All @@ -23,12 +21,11 @@ Installation

bblocks can be installed from PyPI: from the command line:

.. code-block:: python
```{python}
pip install bblocks
```
Alternatively, the source code is available on
`GitHub <https://github.com/ONECampaign/bblocks>`__.
[GitHub](https://github.com/ONECampaign/bblocks>)

Basic usage
-----------
Expand All @@ -41,14 +38,5 @@ about the features that we are planning to add.
Questions?
----------

Please feel free to reach out via GitHub or at data at one.org

.. |pypi| image:: https://img.shields.io/pypi/v/bblocks.svg
:target: https://pypi.org/project/bblocks/
.. |python| image:: https://img.shields.io/pypi/pyversions/bblocks.svg
:target: https://pypi.org/project/bblocks/
.. |codecov| image:: https://codecov.io/gh/ONECampaign/bblocks/branch/main/graph/badge.svg?token=YN8S1719NH
:target: https://codecov.io/gh/ONECampaign/bblocks
.. |Documentation| image:: https://readthedocs.org/projects/bblocks/badge/?version=latest
:target: https://bblocks.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Please feel free to reach out via GitHub or at data at data.one.org

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.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = bblocks
SOURCEDIR = .
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)
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../CHANGELOG.md
```
36 changes: 36 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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

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

project = u"bblocks"
copyright = u"2022, The ONE Campaign"
author = u"ONE Campaign"

# -- 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 = [
"myst_nb",
"autoapi.extension",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]
autoapi_dirs = ["../bblocks"]

# 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 = ["_build", "Thumbs.db", ".DS_Store"]

# -- 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"
11 changes: 11 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```{include} ../README.md
```

```{toctree}
:maxdepth: 1
:hidden:
changelog.md
autoapi/index
```
36 changes: 36 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=unesco_reader

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.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%
goto end

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

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
myst-nb
sphinx-autoapi
sphinx-rtd-theme
Loading

0 comments on commit 13051af

Please sign in to comment.