Skip to content

Commit

Permalink
Merge pull request #7 from rgrupesh/sphinx-modified
Browse files Browse the repository at this point in the history
Sphinx theme modified
  • Loading branch information
rgrupesh authored Aug 13, 2022
2 parents 29cc796 + 35bd0cb commit 3e6db4e
Show file tree
Hide file tree
Showing 18 changed files with 480 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@

# production
/build
build/

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.venv
.github/

npm-debug.log*
yarn-debug.log*
yarn-error.log*

src/constants.js
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

%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.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
27 changes: 27 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
alabaster==0.7.12
Babel==2.10.3
beautifulsoup4==4.11.1
certifi==2022.6.15
charset-normalizer==2.1.0
docutils==0.17.1
idna==3.3
imagesize==1.4.1
Jinja2==3.1.2
MarkupSafe==2.1.1
packaging==21.3
pydata-sphinx-theme==0.9.0
Pygments==2.12.0
pyparsing==3.0.9
pytz==2022.1
requests==2.28.1
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
Sphinx==4.5.0
sphinx_design==0.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
urllib3==1.26.11
4 changes: 4 additions & 0 deletions docs/source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Building Documentation

- Make changes in api.py
- To build, run `make html` or `make clean html`. To check, run `open build/html/index.html`
Binary file added docs/source/__pycache__/api.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:root {
--pst-font-size-base: 15px;
}
49 changes: 49 additions & 0 deletions docs/source/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
def roots(a, b, c, verbose=False):
"""
Return the two roots in the quadratic equation::
a*x**2 + b*x + c = 0
or written with math typesetting
.. math:: ax^2 + bx + c = 0
The returned roots are real or complex numbers,
depending on the values of the arguments `a`, `b`,
and `c`.
Parameters
----------
a: int, real, complex
coefficient of the quadratic term
b: int, real, complex
coefficient of the linear term
c: int, real, complex
coefficient of the constant term
verbose: bool, optional
prints the quantity ``b**2 - 4*a*c`` and if the
roots are real or complex
Returns
-------
root1, root2: real, complex
the roots of the quadratic polynomial.
See Also
--------
:class:`Quadratic`: which is a class for quadratic polynomials
that also has a :func:`Quadratic.roots` method for computing
the roots of a quadratic polynomial. There is also a class
:class:`~linear.Linear` in the module :mod:`linear`
(i.e., :class:`linear.Linear`).
References
----------
Any textbook on mathematics or
`link <http://en.wikipedia.org/wiki/Quadratic_equation>`_.
"""

return root1, root2
7 changes: 7 additions & 0 deletions docs/source/api_docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API Reference
================

.. automodule:: api

.. autofunction:: roots

56 changes: 56 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

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

project = 'PolyPhy'
copyright = '2022, PolyPhy'
author = 'PolyPhy'

import os
import sys
sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [ 'sphinx_design',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon']

templates_path = ['_templates']
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_css_files = [
'custom.css'
]

html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/PolyPhyHub",
"icon": "fab fa-github-square",
},
{
"name": "Slack",
"url": "https://join.slack.com/t/polyphy/shared_invite/zt-1dn8qqkw2-wzf42hlKcCQb2snqArb2YQ",
"icon": "fab fa-slack",
},
{
"name": "Twitter",
"url": "https://twitter.com",
"icon": "fab fa-twitter",
}
]
}

53 changes: 53 additions & 0 deletions docs/source/contribution/docstring_standard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

Docstring Standard for programmers
#####################################

Class::

class foo(array):

"""
Short/extended class description

Attributes
-----------
attributes_name : type
[attributes description]

Methods
---------
method_name(method_parameters)
[method_description]
"""

Method::

def foo(var1, var2, *args, only_seldom_used_keyword=0, **kwargs):
"""
Summarize the function in one line.
Several sentences providing an extended description.
Parameters
----------------------
var1 : array_like
[description]
var2 : int
[description]
*args : iterable
[description].

Returns
-------
out : type
[description]


See Also
-----------
[list]

References
------------
[list]
"""
21 changes: 21 additions & 0 deletions docs/source/contribution/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
***************
Contribution
***************


.. toctree::
:maxdepth: 2

pull_request
opening_issue
docstring_standard










14 changes: 14 additions & 0 deletions docs/source/contribution/opening_issue.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Opening an issue
##################

* Navigate to the main page of PolyPhy on GitHub.

* Click Issues.

* Click New issue.

* Select the template according to the issue(if available) or open a blank issue.

* Type a title and description for your issue.

* When you're finished, click Submit a new issue.
72 changes: 72 additions & 0 deletions docs/source/contribution/pull_request.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

Making a PR
##############

To submit pull requests, just head over to the PolyPhy repository on GitHub and click the “fork” button. After that, you need to clone the repository you forked using your favourite git client or git CLI.

Creating a Fork
******************

Clone your fork to your local machine::

git clone git@github.com:USERNAME/FORKED-PROJECT.git

Keeping Your Fork Up to Date
********************************

Add 'upstream' repo to list of remotes::

git remote add upstream https://github.com/polyphy/polyphy.git

Verify the new remote named 'upstream'::
git remote -v

Fetch from upstream remote::

git fetch upstream

View all branches, including those from upstream::

git branch -va

Checkout your master branch and merge upstream::

git checkout master
git merge upstream/master

Creating a Branch
**********************

Checkout the master branch - you want your new branch to come from master::

git checkout master

Create a new branch named newfeature or its own simple informative name::

git branch newfeature

Switch to your new branch::

git checkout newfeature

Now, you can make desired changes.

Submitting a Pull Request
******************************

Fetch upstream master and merge with your repo's master branch::

git fetch upstream
git checkout master
git merge upstream/master

If there were any new commits, rebase your development branch::

git checkout newfeature
git rebase master

If required squash some of your smaller commits down into a small number of larger more cohesive commits.

After you have committed and pushed all your changes to GitHub, go to the page of your fork, select your development branch, and click on pull request. Make sure to follow the pull request(PR) template.

Loading

0 comments on commit 3e6db4e

Please sign in to comment.