Skip to content

Commit

Permalink
Generate sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Aug 11, 2024
1 parent 801e4ec commit e074bde
Show file tree
Hide file tree
Showing 30 changed files with 16,572 additions and 9 deletions.
75 changes: 66 additions & 9 deletions doc_gen/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,82 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import pathlib
import sys

# Since pytest and docs run parallely, change the current dir and insert it to sys.path at index 0
os.chdir(pathlib.Path(__file__).parent.parent)
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'PyNinja'
copyright = '2024, Vignesh Rao'
author = 'Vignesh Rao'
project = "PyNinja"
copyright = "2024, Vignesh Rao"
author = "Vignesh Rao"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
# 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.ext.napoleon", # certain styles of doc strings
"sphinx.ext.autodoc", # generates from doc strings
"recommonmark", # supports markdown integration
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#configuration
napoleon_google_docstring = True
napoleon_use_param = False

# 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 -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# https://www.sphinx-doc.org/en/master/usage/theming.html#builtin-themes
html_theme = "classic"
html_theme_options = {"body_max_width": "80%"}

# 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"]

# Add docstrings from __init__ method
# This will also include __init__ docs from 'pydantic.BaseModel' and 'pydantic.BaseSettings'
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
# autoclass_content = "both"

# Include private methods/functions
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options
autodoc_default_options = {
"members": True,
"undoc-members": True,
"private-members": True,
}

# Add support to mark down files in sphinx documentation
# Reference: https://www.sphinx-doc.org/en/1.5.3/markdown.html
source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}

# Retain the function/member order
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_member_order
autodoc_member_order = "bysource"

# Make left pane scroll
html_css_files = ["static.css"]
3 changes: 3 additions & 0 deletions doc_gen/static.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.sphinxsidebarwrapper {
overflow-y: scroll;
}
Empty file added docs/.nojekyll
Empty file.
216 changes: 216 additions & 0 deletions docs/README.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

<title>PyNinja &#8212; PyNinja documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/classic.css" />
<link rel="stylesheet" type="text/css" href="_static/static.css" />

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>

<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Welcome to PyNinja’s documentation!" href="index.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to PyNinja’s documentation!"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PyNinja documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">PyNinja</a></li>
</ul>
</div>

<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">

<section id="pyninja">
<h1>PyNinja<a class="headerlink" href="#pyninja" title="Permalink to this heading"></a></h1>
<p>Light weight OS agnostic service monitoring API</p>
<p><img alt="Python" src="https://img.shields.io/badge/python-3.10%20%7C%203.11-blue" /></p>
<p><strong>Platform Supported</strong></p>
<p><img alt="Platform" src="https://img.shields.io/badge/Platform-Linux%7CmacOS%7CWindows-1f425f.svg" /></p>
<p><strong>Deployments</strong></p>
<p><a class="reference external" href="https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment"><img alt="pages" src="https://github.com/thevickypedia/PyNinja/actions/workflows/pages/pages-build-deployment/badge.svg" /></a>
<a class="reference external" href="https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml"><img alt="pypi" src="https://github.com/thevickypedia/PyNinja/actions/workflows/python-publish.yaml/badge.svg" /></a>
<a class="reference external" href="https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml"><img alt="markdown" src="https://github.com/thevickypedia/PyNinja/actions/workflows/markdown.yaml/badge.svg" /></a></p>
<p><a class="reference external" href="https://pypi.org/project/PyNinja"><img alt="Pypi" src="https://img.shields.io/pypi/v/PyNinja" /></a>
<a class="reference external" href="https://pypi.org/project/PyNinja/#files"><img alt="Pypi-format" src="https://img.shields.io/pypi/format/PyNinja" /></a>
<a class="reference external" href="https://pypi.org/project/PyNinja"><img alt="Pypi-status" src="https://img.shields.io/pypi/status/PyNinja" /></a></p>
<section id="kick-off">
<h2>Kick off<a class="headerlink" href="#kick-off" title="Permalink to this heading"></a></h2>
<p><strong>Recommendations</strong></p>
<ul class="simple">
<li><p>Install <code class="docutils literal notranslate"><span class="pre">python</span></code> <a class="reference external" href="https://docs.python.org/3/whatsnew/3.10.html">3.10</a> or <a class="reference external" href="https://docs.python.org/3/whatsnew/3.11.html">3.11</a></p></li>
<li><p>Use a dedicated <a class="reference external" href="https://docs.python.org/3/tutorial/venv.html">virtual environment</a></p></li>
</ul>
<p><strong>Install PyNinja</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pyninja
</pre></div>
</div>
<p><strong>Initiate - IDE</strong></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pyninja</span>


<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
<span class="n">pyninja</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
</pre></div>
</div>
<p><strong>Initiate - CLI</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pyninja<span class="w"> </span>start
</pre></div>
</div>
<blockquote>
<div><p>Use <code class="docutils literal notranslate"><span class="pre">pyninja</span> <span class="pre">--help</span></code> for usage instructions.</p>
</div></blockquote>
</section>
<section id="environment-variables">
<h2>Environment Variables<a class="headerlink" href="#environment-variables" title="Permalink to this heading"></a></h2>
<details>
<summary><strong>Sourcing environment variables from an env file</strong></summary><blockquote>
<div><p><em>By default, <code class="docutils literal notranslate"><span class="pre">PyNinja</span></code> will look for a <code class="docutils literal notranslate"><span class="pre">.env</span></code> file in the current working directory.</em></p>
</div></blockquote>
</details><ul class="simple">
<li><p><strong>NINJA_HOST</strong> - Hostname for the API server.</p></li>
<li><p><strong>NINJA_PORT</strong> - Port number for the API server.</p></li>
<li><p><strong>WORKERS</strong> - Number of workers for the uvicorn server.</p></li>
<li><p><strong>APIKEY</strong> - API Key for authentication.</p></li>
</ul>
</section>
<section id="coding-standards">
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
<p>Docstring format: <a class="reference external" href="https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings"><code class="docutils literal notranslate"><span class="pre">Google</span></code></a> <br>
Styling conventions: <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/"><code class="docutils literal notranslate"><span class="pre">PEP</span> <span class="pre">8</span></code></a> and <a class="reference external" href="https://pycqa.github.io/isort/"><code class="docutils literal notranslate"><span class="pre">isort</span></code></a></p>
</section>
<section id="release-notes">
<h2><a class="reference external" href="https://github.com/thevickypedia/PyNinja/blob/master/release_notes.rst">Release Notes</a><a class="headerlink" href="#release-notes" title="Permalink to this heading"></a></h2>
<p><strong>Requirement</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>gitverse
</pre></div>
</div>
<p><strong>Usage</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>gitverse-release<span class="w"> </span>reverse<span class="w"> </span>-f<span class="w"> </span>release_notes.rst<span class="w"> </span>-t<span class="w"> </span><span class="s1">&#39;Release Notes&#39;</span>
</pre></div>
</div>
</section>
<section id="linting">
<h2>Linting<a class="headerlink" href="#linting" title="Permalink to this heading"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">pre-commit</span></code> will ensure linting, run pytest, generate runbook &amp; release notes, and validate hyperlinks in ALL
markdown files (including Wiki pages)</p>
<p><strong>Requirement</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="nv">sphinx</span><span class="o">==</span><span class="m">5</span>.1.1<span class="w"> </span>pre-commit<span class="w"> </span>recommonmark
</pre></div>
</div>
<p><strong>Usage</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pre-commit<span class="w"> </span>run<span class="w"> </span>--all-files
</pre></div>
</div>
</section>
<section id="pypi-package">
<h2>Pypi Package<a class="headerlink" href="#pypi-package" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://packaging.python.org/tutorials/packaging-projects/"><img alt="pypi-module" src="https://img.shields.io/badge/Pypi%20Package-pyninja-blue?style=for-the-badge&amp;logo=Python" /></a></p>
<p><a class="reference external" href="https://pypi.org/project/PyNinja">https://pypi.org/project/PyNinja/</a></p>
</section>
<section id="runbook">
<h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html"><img alt="made-with-sphinx-doc" src="https://img.shields.io/badge/Made%20with-Sphinx-blue?style=for-the-badge&amp;logo=Sphinx" /></a></p>
<p><a class="reference external" href="https://thevickypedia.github.io/PyNinja/">https://thevickypedia.github.io/PyNinja/</a></p>
</section>
<section id="license-copyright">
<h2>License &amp; copyright<a class="headerlink" href="#license-copyright" title="Permalink to this heading"></a></h2>
<p>© Vignesh Rao</p>
<p>Licensed under the <a class="reference external" href="https://github.com/thevickypedia/PyNinja/blob/master/LICENSE">MIT License</a></p>
</section>
</section>


<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">PyNinja</a><ul>
<li><a class="reference internal" href="#kick-off">Kick off</a></li>
<li><a class="reference internal" href="#environment-variables">Environment Variables</a></li>
<li><a class="reference internal" href="#coding-standards">Coding Standards</a></li>
<li><a class="reference internal" href="#release-notes">Release Notes</a></li>
<li><a class="reference internal" href="#linting">Linting</a></li>
<li><a class="reference internal" href="#pypi-package">Pypi Package</a></li>
<li><a class="reference internal" href="#runbook">Runbook</a></li>
<li><a class="reference internal" href="#license-copyright">License &amp; copyright</a></li>
</ul>
</li>
</ul>

</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to PyNinja’s documentation!</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/README.md.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to PyNinja’s documentation!"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PyNinja documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">PyNinja</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2024, Vignesh Rao.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
</body>
</html>
File renamed without changes.
Loading

0 comments on commit e074bde

Please sign in to comment.