Skip to content

Commit

Permalink
#60 Add Read The Docs configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
colinangusmackay committed Jan 9, 2021
1 parent b8f252f commit cb3e825
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yml
# 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 docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
builder: html
fail_on_warning: true

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

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

# Optionally set the version of Python and requirements required to build your docs
# python:
# version: 3.7
# install:
# - requirements: docs/requirements.txt
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cSpell.words": [
"Gedcom",
"Stravaig",
"nuget",
"nupkg",
"pwsh",
"snupkg"
]
}
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, 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
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
63 changes: 63 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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

# -- 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 information -----------------------------------------------------

project = 'Stravaig Gedcom'
copyright = '2021, Stravaig Projects'
author = 'Stravaig Projects'

# The full version, including alpha/beta/rc tags
release = '0.2.0'


# -- 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_rtd_theme'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = [
'_templates'
]

# 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'

# Add any paths that contain custom static files (such as style sheets) here,
# 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']
html_static_path = []
27 changes: 27 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. Stravaig Configuration Diagnostics documentation master file, created by
sphinx-quickstart on Tue Jan 5 16:04:48 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Stravaig Projects: Gedcom documentation
=======================================

The GEDCOM file format is the defacto standard for transmission of genealogy or family-tree data. It has been around since the mid-eighties and was devised by the Church of Latter Day Saints.


.. toctree::
:maxdepth: 2
:caption: Introduction:


.. toctree::
:maxdepth: 2
:caption: advanced


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
47 changes: 47 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
echo Cannot find environment variable for the Sphinx Build.
echo Setting to 'sphinx-build'
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
)

REM python /home/docs/checkouts/readthedocs.org/user_builds/stravaigextensionsconfigurationdiagnostics/envs/latest/bin/sphinx-build
REM -T -E -W --keep-going -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html
echo %SPHINXBUILD% -T -E -W --keep-going -b %1 -d _build/doctrees-readthedocs -D language=en %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
%SPHINXBUILD% -T -E -W --keep-going -b %1 -d _build/doctrees-readthedocs -D language=en %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
if errorlevel 0 (
echo.
echo Done!
) else (
echo.
echo FAILED!
)
goto end

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

:end
popd
34 changes: 34 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Installing the doc generation tools

## Install Python

This is currently using Python 3.9. You can get it here: https://www.python.org/downloads/

## Install Sphinx

From a command/PowerShell prompt:
* `pip install sphinx`
* `python -m pip install --upgrade pip`

## Install the theme

* `pip install sphinx-rtd-theme`


# Building the documentation

Navigate to the `docs` folder and run:
```powershell
./make html
```

## Running a HTTP server

In a separate terminal, navigate to the newly created `docs/_build/html` folder, and run:
```powershell
python -m http.server 8000
```

## More information

For more information see: https://www.sphinx-doc.org/en/1.5.1/tutorial.html

0 comments on commit cb3e825

Please sign in to comment.