Skip to content

Commit b6ef568

Browse files
authored
Merge pull request #16 from AyanSinhaMahapatra/add-basic-docs
Add basic docs
2 parents ef210cd + 7d37af0 commit b6ef568

File tree

10 files changed

+185
-0
lines changed

10 files changed

+185
-0
lines changed

.readthedocs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Where the Sphinx conf.py file is located
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Setting the python version and doc build requirements
13+
python:
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- docs

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/scripts/doc8_style_check.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# halt script on error
3+
set -e
4+
# Check for Style Code Violations
5+
doc8 --max-line-length 100 source --ignore D000 --quiet
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# halt script on error
3+
set -e
4+
# Build locally, and then check links
5+
sphinx-build -E -W -b linkcheck source build

docs/source/conf.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'nexb-skeleton'
21+
copyright = 'nexb Inc.'
22+
author = 'nexb Inc.'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = [
31+
]
32+
33+
# Add any paths that contain templates here, relative to this directory.
34+
templates_path = ['_templates']
35+
36+
# List of patterns, relative to source directory, that match files and
37+
# directories to ignore when looking for source files.
38+
# This pattern also affects html_static_path and html_extra_path.
39+
exclude_patterns = []
40+
41+
42+
# -- Options for HTML output -------------------------------------------------
43+
44+
# The theme to use for HTML and HTML Help pages. See the documentation for
45+
# a list of builtin themes.
46+
#
47+
html_theme = 'sphinx_rtd_theme'
48+
49+
# Add any paths that contain custom static files (such as style sheets) here,
50+
# relative to this directory. They are copied after the builtin static files,
51+
# so a file named "default.css" will overwrite the builtin "default.css".
52+
html_static_path = ['_static']
53+
54+
html_context = {
55+
'css_files': [
56+
'_static/theme_overrides.css', # override wide tables in RTD theme
57+
],
58+
"display_github": True,
59+
"github_user": "nexB",
60+
"github_repo": "nexb-skeleton",
61+
"github_version": "develop", # branch
62+
"conf_py_path": "/docs/source/", # path in the checkout to the docs root
63+
}

docs/source/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Welcome to nexb-skeleton's documentation!
2+
=========================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
skeleton/index
9+
10+
Indices and tables
11+
==================
12+
13+
* :ref:`genindex`
14+
* :ref:`modindex`
15+
* :ref:`search`

docs/source/skeleton/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Docs Structure Guide
2+
# Rst docs - https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
3+
#
4+
# 1. Place docs in folders under source for different sections
5+
# 2. Link them by adding individual index files in each section
6+
# to the main index, and then files for each section to their
7+
# respective index files.
8+
# 3. Use `.. include` statements to include other .rst files
9+
# or part of them, or use hyperlinks to a section of the docs,
10+
# to get rid of repetition.
11+
# https://docutils.sourceforge.io/docs/ref/rst/directives.html#including-an-external-document-fragment
12+
#
13+
# Note: Replace these guide/placeholder docs
14+
15+
.. include:: ../../../README.rst

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ testing =
3535
# upstream
3636
pytest >= 6
3737
pytest-xdist >= 2
38+
docs=
39+
Sphinx>=3.3.1
40+
sphinx-rtd-theme>=0.5.0
41+
doc8>=0.8.1

src/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Package Module
2+
--------------
3+
4+
Put your python modules in this directory.
5+

0 commit comments

Comments
 (0)