-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate to sphinx-book-theme * Update publish workflow
- Loading branch information
Showing
8 changed files
with
114 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish Documentation on GitHub Pages | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
- name: Dependencies | ||
run: | | ||
if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi | ||
- name: Build Sphinx Documentation | ||
run: | | ||
sphinx-build docs docs/_build/html | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: job.status == 'success' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html | ||
enable_jekyll: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = . | ||
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 | ||
rm -rf _build | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
import os | ||
import sys | ||
|
||
from pathlib import Path | ||
|
||
# -- Project information | ||
project = "REaLTabFormer" | ||
copyright = "2023, World Bank" | ||
author = "Aivin Solatorio" | ||
|
||
# -- General configuration | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.napoleon", | ||
"autoapi.extension", | ||
"myst_nb", | ||
"sphinx_autodoc_typehints", | ||
] | ||
autoapi_dirs = ["../src"] | ||
|
||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3/", None), | ||
"sphinx": ("https://www.sphinx-doc.org/en/master/", None), | ||
} | ||
source_suffix = [".rst", ".md"] | ||
templates_path = ["_templates"] | ||
|
||
html_logo = "../img/REalTabFormer_Final_EQ.png" | ||
html_title = "REaLTabFormer" | ||
|
||
html_theme = "sphinx_book_theme" | ||
html_theme_options = { | ||
"repository_url": "https://github.com/worldbank/realtabformer", | ||
"use_repository_button": True, | ||
"use_issues_button": True, | ||
"use_edit_page_button": True, | ||
"logo": { | ||
"text": f"REaLTabFormer {(Path(__file__).parent.parent / 'src' / 'realtabformer'/ 'VERSION').read_text().strip()}" | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.. REaLTabFormer documentation master file, created by | ||
sphinx-quickstart on Wed Jun 7 18:23:38 2023. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
.. include:: ../README.md | ||
:parser: myst_parser.sphinx_ | ||
|
||
Documentation | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
:caption: Contents | ||
|
||
self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
jupyter-book>=0.12.0 | ||
myst-nb==0.17.2 | ||
Sphinx==5.3.0 | ||
sphinx-autodoc-typehints==1.19.1 | ||
sphinx-autoapi==2.1.0 | ||
sphinx-book-theme==1.0.1 |