Skip to content

Commit

Permalink
Merge pull request #16 from AyanSinhaMahapatra/add-basic-docs
Browse files Browse the repository at this point in the history
Add basic docs
  • Loading branch information
steven-esser authored Dec 21, 2020
2 parents ef210cd + 7d37af0 commit b6ef568
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Where the Sphinx conf.py file is located
sphinx:
configuration: docs/source/conf.py

# Setting the python version and doc build requirements
python:
install:
- method: pip
path: .
extra_requirements:
- docs
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 = source
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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
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
5 changes: 5 additions & 0 deletions docs/scripts/doc8_style_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# halt script on error
set -e
# Check for Style Code Violations
doc8 --max-line-length 100 source --ignore D000 --quiet
5 changes: 5 additions & 0 deletions docs/scripts/sphinx_build_link_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# halt script on error
set -e
# Build locally, and then check links
sphinx-build -E -W -b linkcheck source build
63 changes: 63 additions & 0 deletions docs/source/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 = 'nexb-skeleton'
copyright = 'nexb Inc.'
author = 'nexb Inc.'


# -- 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 = [
]

# 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 = []


# -- 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_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
],
"display_github": True,
"github_user": "nexB",
"github_repo": "nexb-skeleton",
"github_version": "develop", # branch
"conf_py_path": "/docs/source/", # path in the checkout to the docs root
}
15 changes: 15 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Welcome to nexb-skeleton's documentation!
=========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

skeleton/index

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
15 changes: 15 additions & 0 deletions docs/source/skeleton/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Docs Structure Guide
# Rst docs - https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
#
# 1. Place docs in folders under source for different sections
# 2. Link them by adding individual index files in each section
# to the main index, and then files for each section to their
# respective index files.
# 3. Use `.. include` statements to include other .rst files
# or part of them, or use hyperlinks to a section of the docs,
# to get rid of repetition.
# https://docutils.sourceforge.io/docs/ref/rst/directives.html#including-an-external-document-fragment
#
# Note: Replace these guide/placeholder docs

.. include:: ../../../README.rst
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ testing =
# upstream
pytest >= 6
pytest-xdist >= 2
docs=
Sphinx>=3.3.1
sphinx-rtd-theme>=0.5.0
doc8>=0.8.1
5 changes: 5 additions & 0 deletions src/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Package Module
--------------

Put your python modules in this directory.

0 comments on commit b6ef568

Please sign in to comment.