Skip to content

Commit

Permalink
Setup Subete for ReadTheDocs Documentation (#2)
Browse files Browse the repository at this point in the history
* Mimicked SnakeMD setup.py

* Added conf.py and index.rst for docs

* Added logos

* Updated index homepage

* Setup automodule
  • Loading branch information
jrg94 authored Aug 4, 2021
1 parent 4b1399a commit cf6a434
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ dmypy.json

# Pyre type checker
.pyre/

# Sphinx
dirhtml/
doctrees/
Binary file added docs/_static/favicon.ico
Binary file not shown.
Binary file added docs/_static/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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 = 'subete'
copyright = '2021, The Renegade Coder'
author = 'The Renegade Coder'

# -- 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.ext.autodoc', "sphinx_issues"]

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

github_url = "https://github.com/TheRenegadeCoder/subete"
html_logo = "_static/icon.png"
html_favicon = '_static/favicon.ico'
issues_github_path = "TheRenegadeCoder/subete"

html_theme_options = {
"display_version": True
}
18 changes: 18 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Welcome to subete's Documentation!
===================================

Subete is a library for interacting with the code found
in the Sample Programs repository. Use the links below to
navigate the docs.

.. toctree::
:maxdepth: 1

subete

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
20 changes: 20 additions & 0 deletions docs/subete.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Documentation
=============

The documentation page lists out all of the relevant classes
and functions for generating markdown documents in Python.

subete
-------------------

The subete module contains all the classes need to represent the Sample Programs repo.
This module was designed with the intent of creating read-only objects that fully
represent the underlying repo. Ideally, classes that make use of these objects
should not need to know how they were generated. For example, we do not want users
to poke around the source directory that was used to generate these files. As a result,
users should make use of the public fields only.

.. automodule:: subete.repo
:members:
:undoc-members:
:show-inheritance:
37 changes: 32 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
import setuptools

cmdclass = {}

try:
from sphinx.setup_command import BuildDoc
cmdclass['build_sphinx'] = BuildDoc
except ImportError:
print("WARNING: sphinx not available")

with open("README.md", "r") as fh:
long_description = fh.read()

MAJOR = 0
MINOR = 2
PATCH = 0

name = "subete"
version = f"{MAJOR}.{MINOR}"
release = f"{MAJOR}.{MINOR}.{PATCH}"
setuptools.setup(
name="subete",
version="0.1.0",
name=name,
version=release,
author="The Renegade Coder",
author_email="[email protected]",
description="The Sample Programs API",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/TheRenegadeCoder/subete",
packages=setuptools.find_packages(),
install_requires=[],
classifiers=(
install_requires=[
],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
),
],
cmdclass=cmdclass,
command_options={
'build_sphinx': {
'project': ('setup.py', name),
'version': ('setup.py', version),
'release': ('setup.py', release),
'source_dir': ('setup.py', 'docs'),
'build_dir': ('setup.py', 'docs'),
'builder': ("setup.py", "dirhtml")
}
}
)
17 changes: 5 additions & 12 deletions subete/repo.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
"""
The repo module contains all the classes need to represent the Sample Programs repo.
This file was designed with the intent of creating read-only objects that fully
represent the underlying repo. Ideally, classes that make use of these objects
should not need to know how they were generated. For example, we do not want users
to poke around the source directory that was used to generate these files. As a result,
users should make use of the public fields only.
"""

import os
import re
import yaml
Expand Down Expand Up @@ -140,9 +131,11 @@ def _organize_collection(self):
def get_readable_name(self) -> str:
"""
Generates as close to the proper language name as possible given a language
name in plain text separated by hyphens
EX: google-apps-script -> Google Apps Script
EX: c-sharp -> C#
name in plain text separated by hyphens.
| Example: google-apps-script -> Google Apps Script
| Example: c-sharp -> C#
:return: a readable representation of the language name
"""
text_to_symbol = {
Expand Down

0 comments on commit cf6a434

Please sign in to comment.