Skip to content

Commit

Permalink
Added Sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndyashas committed Aug 5, 2020
1 parent 444e1e4 commit 884a427
Show file tree
Hide file tree
Showing 12 changed files with 240 additions and 0 deletions.
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
Empty file added docs/source/_static/.gitkeep
Empty file.
Empty file added docs/source/_templates/.gitkeep
Empty file.
58 changes: 58 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 = 'Dhwani'
copyright = '2020, Yashas ND'
author = 'Yashas ND'

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


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

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

master_doc = 'index'
22 changes: 22 additions & 0 deletions docs/source/dhwani.core.core_utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
dhwani.core.core\_utils package
===============================

Submodules
----------

dhwani.core.core\_utils.converter\_utils module
-----------------------------------------------

.. automodule:: dhwani.core.core_utils.converter_utils
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: dhwani.core.core_utils
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/source/dhwani.core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dhwani core
===================

``Converter`` class
----------------------------

.. autoclass:: dhwani.core.converter.Converter
:members:
:undoc-members:
:show-inheritance:
22 changes: 22 additions & 0 deletions docs/source/dhwani.mappings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
dhwani.mappings package
=======================

Submodules
----------

dhwani.mappings.utils module
----------------------------

.. automodule:: dhwani.mappings.utils
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: dhwani.mappings
:members:
:undoc-members:
:show-inheritance:
19 changes: 19 additions & 0 deletions docs/source/dhwani.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dhwani package
==============

Subpackages
-----------

.. toctree::
:maxdepth: 4

dhwani.core
dhwani.mappings

Module contents
---------------

.. automodule:: dhwani
:members:
:undoc-members:
:show-inheritance:
26 changes: 26 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Examples
========

Convert from English to Kannada
*******************************
.. code-block:: python
# Import the main converter class
from dhwani import Converter
# Make a converter object. The first argument is the
# ISO 639-3 code of the source language, and the second
# argument is the ISO 639-3 code of the destination language.
converter = Converter('eng', 'kan')
src_string = "kannaDa"
# Use the 'convert' method of converter object to get the converter
# string back.
dest_string = converter.convert(src_string)
# Print the result
# Note that the display for standard output needs to support the unicode
# characters.
print(dest_string)
21 changes: 21 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. Dhwani documentation master file, created by
sphinx-quickstart on Wed Aug 5 20:10:49 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Dhwani
==================================

.. toctree::
:maxdepth: 1
:caption: Contents:

dhwani.core
examples

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

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

.. toctree::
:maxdepth: 4

dhwani

0 comments on commit 884a427

Please sign in to comment.