Skip to content

Commit

Permalink
Merge pull request uibcdf#19 from dprada/main
Browse files Browse the repository at this point in the history
Documentation first version
  • Loading branch information
dprada authored Sep 13, 2022
2 parents 007fff9 + 9e483fd commit da16891
Show file tree
Hide file tree
Showing 21 changed files with 470 additions and 11 deletions.
2 changes: 2 additions & 0 deletions devtools/conda-envs/development_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ dependencies:
- sphinx_rtd_theme
- sphinxcontrib-bibtex
- myst-nb
- sphinx-copybutton
- sphinx-remove-toctrees
- jupyterlab
2 changes: 2 additions & 0 deletions devtools/conda-envs/docs_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ dependencies:
- sphinx_rtd_theme
- sphinxcontrib-bibtex
- myst-nb
- sphinx-copybutton
- sphinx-remove-toctrees
2 changes: 2 additions & 0 deletions devtools/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ docs:
- sphinx_rtd_theme
- sphinxcontrib-bibtex
- myst-nb
- sphinx-copybutton
- sphinx-remove-toctrees

development:
channels:
Expand Down
22 changes: 22 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Minimal makefile for Sphinx documentation
#

export SPHINXWORKING=True

# You can set these variables from the command line.
SPHINXOPTS = -j auto
SPHINXBUILD = sphinx-build
SPHINXPROJ = openpocket
SOURCEDIR = .
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)
16 changes: 16 additions & 0 deletions docs/_static/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Static Doc Directory

Add any paths that contain custom static files (such as style sheets) here,
relative to the `conf.py` file's directory.
They are copied after the builtin static files,
so a file named "default.css" will overwrite the builtin "default.css".

The path to this folder is set in the Sphinx `conf.py` file in the line:
```python
templates_path = ['_static']
```

## Examples of file to add to this directory
* Custom Cascading Style Sheets
* Custom JavaScript code
* Static logo images
10 changes: 10 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.wy-nav-content {
max-width: 100% !important;
}

/* To change the left bar of executable cells in markdown and executable cells in jupyter notebooks */
/* See https://github.com/executablebooks/meta/discussions/667 */
div.cell div.cell_input {
border-left-color: #C9C9C9;
}

14 changes: 14 additions & 0 deletions docs/_templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Templates Doc Directory

Add any paths that contain templates here, relative to
the `conf.py` file's directory.
They are copied after the builtin template files,
so a file named "page.html" will overwrite the builtin "page.html".

The path to this folder is set in the Sphinx `conf.py` file in the line:
```python
html_static_path = ['_templates']
```

## Examples of file to add to this directory
* HTML extensions of stock pages like `page.html` or `layout.html`
8 changes: 8 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends '!layout.html' %}
{% block document %}
{{super()}}
<a href="https://github.com/uibcdf/openpocket">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub">
</a>
{% endblock %}

8 changes: 8 additions & 0 deletions docs/api/developers/api_developers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Developers
==========

.. toctree::
:name: developers
:caption: Developers
:maxdepth: 2

8 changes: 8 additions & 0 deletions docs/api/users/api_users.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Users
=====

.. toctree::
:name: users
:caption: Users
:maxdepth: 2

234 changes: 234 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

import os
import sys

# -- 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.
#

# 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 openpocket

# -- Project information -----------------------------------------------------

project = 'OpenPocket'
copyright = ("2022, UIBCDF Lab at the Mexico City Childrens Hospital Federico Gomez and authors."
"Computational Molecular Science Python Cookiecutter version 1.5")
author = 'UIBCDF Lab'

# The short X.Y version
version = openpocket.__version__.split('+')[0]
# The full version, including alpha/beta/rc tags
release = openpocket.__version__

print(f'version {version}, release {release}')

# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.githubpages',
'sphinxcontrib.bibtex',
'sphinx.ext.extlinks',
'sphinx_remove_toctrees',
'sphinx_copybutton',
'myst_nb'
]

autosummary_generate = True
napoleon_google_docstring = False
napoleon_use_param = False
napoleon_use_ivar = True

# sphinxcontrib-bibtex
bibtex_bibfiles = ['bibliography.bib'] # list of *.bib files
bibtex_default_style = 'alpha'
bibtex_encoding = 'utf-8-sig'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:

source_parsers={
}

source_suffix = ['.rst', '.md', '.ipynb']

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
# language was edited to use sphinx-intl
language = 'en'
# These next two variables were incluede to use sphinx-intl
locale_dirs = ['_locale/']
gettext_compact = False

# 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', '**.ipynb_checkpoints', 'old_api', 'freezer']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'default'

# Remove from toctrees
remove_from_toctrees = []
for directory in os.walk('api'):
if directory[0].endswith('/autosummary'):
remove_from_toctrees.append(directory[0]+'/*')

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

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {
'canonical_url': '',
'analytics_id': '',
'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
# Toc options
'collapse_navigation': False,
'sticky_navigation': False,
'navigation_depth': 4,
'includehidden': True,
'titles_only': True
}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = []

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

#### I should check
#### https://github.com/lotharschulz/sphinx-pages/blob/master/conf.py for more
#### options

# Custom css

html_css_files = [
'custom.css',
]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}

html_show_sourcelink = False



# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'openpocketdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
]


# -- 1 for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
]


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

3 changes: 3 additions & 0 deletions docs/contents/about/citation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Citation

To be written soon...
3 changes: 3 additions & 0 deletions docs/contents/about/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Installation

To be written soon...
3 changes: 3 additions & 0 deletions docs/contents/about/showcase/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Showcase

To be written soon...
3 changes: 3 additions & 0 deletions docs/contents/about/what.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# What

To be written soon...
1 change: 1 addition & 0 deletions docs/contents/developer/intro/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Introduction
1 change: 1 addition & 0 deletions docs/contents/user/intro/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Introduction
1 change: 1 addition & 0 deletions docs/contents/user/tools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tools
Loading

0 comments on commit da16891

Please sign in to comment.