docs/: add sphinx & rtd boilerplate

This commit is contained in:
classabbyamp 2022-12-06 13:31:57 -05:00 committed by Zach Dykstra
parent 525a0f6f5d
commit b378215c2c
9 changed files with 146 additions and 0 deletions

4
.gitignore vendored
View File

@ -1,7 +1,11 @@
*.img
*.swp
*/*.swp
.vscode/
releases/*
build
hostid
zpool.cache
*env/
/docs/_build/

14
.readthedocs.yaml Normal file
View File

@ -0,0 +1,14 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python:
install:
- requirements: docs/requirements.txt
formats:
- pdf
- epub

4
docs/.editorconfig Normal file
View File

@ -0,0 +1,4 @@
[*.rst]
indent_style = space
indent_size = 2
max_line_length = 120

50
docs/Makefile Normal file
View File

@ -0,0 +1,50 @@
.DEFAULT_GOAL := help
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
PYTHON ?= python3
VENV ?= env
PIP_FLAGS ?= -q
SERVEOPTS ?=
SOURCEDIR = .
BUILDDIR = _build
.PHONY: help setup serve envclean requirements.txt Makefile setup-void
help:
@echo "Use \033[94mmake setup\033[m to set up a virtual environment."
@echo "Use \033[94mmake setup-void\033[m to install dependencies on Void Linux."
@echo "Use \033[94mmake serve\033[m to run a simple HTTP server for viewing the html docs."
@echo "Use \033[94mmake envclean\033[m to remove the virtual environment."
ifneq ("$(wildcard $(VENV))","")
@echo
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
endif
setup-void:
@sudo xbps-install -Su python3-rst2ansi python3-sphinx-tabs python3-sphinx_rtd_theme python3-recommonmark
setup: $(VENV)/req_done
serve: html
@$(PYTHON) -m http.server -d "$(BUILDDIR)/html" $(SERVEOPTS)
envclean:
@rm -rf $(VENV)
$(VENV)/success:
ifeq ("$(wildcard $(VENV))","")
@echo "Creating the virtual environment at $(VENV)"
@$(PYTHON) -m venv $(VENV)
@touch $(VENV)/success
endif
$(VENV)/req_done: requirements.txt $(VENV)/success
@echo "Installing dependencies from requirements.txt"
@. $(VENV)/bin/activate && \
pip install $(PIP_FLAGS) -U pip wheel && \
pip install $(PIP_FLAGS) -U -r requirements.txt
@touch $(VENV)/req_done
%:: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)

4
docs/_static/custom.css vendored Normal file
View File

@ -0,0 +1,4 @@
li>ul {
margin-top: 0px !important;
margin-bottom: 0px !important;
}

1
docs/_static/logo.svg vendored Symbolic link
View File

@ -0,0 +1 @@
../logos/LogoMark_White.svg

39
docs/conf.py Normal file
View File

@ -0,0 +1,39 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'ZFSBootMenu'
author = 'Zach Dykstra'
copyright = f'2019 {author}'
release = '2.0.0'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx_toolbox.collapse',
'sphinx_rtd_theme',
'recommonmark',
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '*env', '**/_include']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
smartquotes = False
html_logo = '_static/logo.svg'
html_theme_options = {
'style_external_links': True,
'collapse_navigation': False,
'titles_only': True,
}
html_baseurl = 'https://docs.zfsbootmenu.org'
html_css_files = ['custom.css']

26
docs/index.rst Normal file
View File

@ -0,0 +1,26 @@
ZFSBootMenu
===========
.. toctree::
:maxdepth: 1
:titlesonly:
CHANGELOG
.. toctree::
:caption: Manual Pages
:maxdepth: 3
:glob:
:titlesonly:
man/*
.. toctree::
:caption: Guides
:maxdepth: 3
:titlesonly:
guides/general
guides/debian
guides/void-linux
guides/third-party

4
docs/requirements.txt Normal file
View File

@ -0,0 +1,4 @@
sphinx
sphinx-tabs
sphinx-rtd-theme>=1.1.1
recommonmark