Skip to content

Commit

Permalink
Merge pull request #47 from radionets-project/docs
Browse files Browse the repository at this point in the history
First implementation of docs
  • Loading branch information
aknierim authored Jan 27, 2025
2 parents 17b315a + ef8ca8f commit 230a84d
Show file tree
Hide file tree
Showing 45 changed files with 1,271 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# docs
docs/_build
docs/api
!docs/_static/*.png

pyvisgen/_version_cache.py
pyvisgen/_version.py

#slurm
*.slurm
*.log
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-24.04
apt_packages:
- graphviz
tools:
python: "3.10"

python:
install:
- method: pip
path: .
extra_requirements:
- docs

sphinx:
configuration: docs/conf.py
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 = .
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)
Binary file added docs/_static/favicon/favicon.ico
Binary file not shown.
221 changes: 221 additions & 0 deletions docs/_static/pyvisgen.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans:700|Open+Sans:400');
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap');


:root[data-theme="light"] {
--pst-color-text: #090704;
--pst-color-background: #f5f5f5;
--pst-color-on-background: #ffffff;
--pst-color-primary: #52ba66;
--pst-color-secondary: #325e8d;
--pst-color-primary-highlight: #6EC87F;
--pst-color-secondary-highlight: #547cae;
--pst-color-inline-code: var(--pst-color-primary-highlight);
--bd-header-announcement-color: var(--pst-color-background);
--bd-header-announcement-background: var(--pst-color-primary);
--table-hover-background: var(--pst-color-primary-highlight);
--hl-pre-code-background: var(--pst-color-background);
}
:root[data-theme="dark"] {
--pst-color-text: #faf8f4;
--pst-color-background: #181f28;
--pst-color-on-background: #222832;
--pst-color-primary: #52ba66;
--pst-color-secondary: #b8dc2e;
--pst-color-primary-highlight: #83c39c;
--pst-color-secondary-highlight: #ece520;
--pst-color-inline-code: var(--pst-color-primary-highlight);
--bd-header-announcement-color: var(--pst-color-background);
--bd-header-announcement-background: var(--pst-color-primary-highlight);
--table-hover-background: #279544;
--hl-pre-code-background: var(--pst-color-background);
}


body {
font-family: 'Open Sans';
font-weight: 400;
}

:root {
--pst-font-family-monospace: "Fira Mono";
}


h1, h2, h3, h4, h5 {
font-family: 'Open Sans';
font-weight: 700;
}

html {font-size: 100%;} /* 16px */

h1 {
font-size: 2.489rem;
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(0.03, var(--pst-color-primary)),
color-stop(0.40, var(--pst-color-secondary)),
color-stop(0.97, var(--pst-color-primary-highlight))
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

h1 .docutils {
-webkit-text-fill-color: var(--pst-color-inline-code);
}

h2 {font-size: 2.074rem; /* 33.12px */}

h3 {font-size: 1.728rem; /* 27.68px */}

h4 {font-size: 1.440rem; /* 23.04px */}

h5 {font-size: 1.200rem; /* 19.2px */}

small {font-size: 0.833rem; /* 13.28px */}

dt:target {
background-color: var(--pst-color-surface);
border-radius: 10px;
padding: 5px 5px 5px 5px;
}

/* code blocks */
div.highlight {
background-color: var(--hl-pre-code-background) !important;
}
.highlight pre {
border-radius: 20px;
background-color: var(--pst-color-on-background);
}
.highlight pre .gp {
color: var(--pst-color-primary);
}

.bd-header-announcement {
color: var(--bd-header-announcement-color);
background-color: var(--bd-header-announcement-background);
}

.admonition {
border-radius: 10px !important;
}

/* sphinx-design */
.sd-card {
background-color: var(--pst-color-on-background);
border-radius: 10px;
padding: 30px 10px 20px 10px;
margin: 10px 0px;
}

.sd-card .sd-card-header .sd-card-text {
margin: 0px;
}

.sd-card .sd-card-header {
border: none;
text-align: center;
font-size: var(--pst-font-size-h4);
font-weight: bold;
padding: 0.5rem 0rem 0.5rem 0rem;
}

.sd-card .sd-card-footer {
border: none;
}

.sd-card .sd-card-footer .sd-card-text {
max-width: 220px;
margin-left: auto;
margin-right: auto;
}

.sd-card .sd-btn {
border-radius: 20px;
}

.sd-card:hover {
border-color: var(--pst-color-secondary);
transform: scale(1.05);
-webkit-transition: all .2s;
-moz-transition: all .2s;
transition: all .2s;
}

.sd-card .sd-btn:hover {
-webkit-animation: pulse 2s infinite;
animation: pulse512 1.5s infinite;
background-size: 200% auto;
}

.search-button-field:hover {
border-color: var(--pst-color-primary-highlight);
border-width: 2pt;
-webkit-animation: pulse 2s infinite;
animation: pulse512 1.5s infinite;
background-size: 200% auto;
}

@keyframes pulse512 {
0% {
box-shadow: 0 0 0 0 var(--pst-color-primary-highlight);
}

70% {
box-shadow: 0 0 0 10px rgb(255 255 255 / 0%);
}

100% {
box-shadow: 0 0 0 0 rgb(255 255 255 / 0%);
}
}

/* sphinx gallery */
.sphx-glr-thumbcontainer {
border-radius: 10px;
transition: 0.3s;
border-color: var(--pst-color-primary);
}

.sphx-glr-thumbcontainer:hover {
border-color: var(--pst-color-secondary);
transform: scale(1.05);
}

.sphx-glr-thumbcontainer::after {
border-radius: 10px !important;
}

.reference.download.internal {
--pst-color-inline-code-links: white;
background-color: var(--pst-color-primary);
background-image: none !important;
border-radius: 40px;
}

.reference.download.internal::before {
color: white;
text-decoration: none;
}

.reference.download.internal:hover {
background-color: var(--pst-color-secondary) !important;
transition: 0.3s;
-webkit-animation: pulse 2s infinite;
animation: pulse512 1.5s infinite;
background-size: 200% auto;
}

/* tables */
.table tbody tr:hover td, .table tbody tr:hover th {
background: var(--table-hover-background) !important;
}

/* buttons */
#pst-back-to-top: {
background-color: var(--pst-color-secondary-highlight);
}
Binary file added docs/_static/pyvisgen.webp
Binary file not shown.
Binary file added docs/_static/pyvisgen_dark.webp
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/_templates/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/base.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
2 changes: 2 additions & 0 deletions docs/_templates/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/class.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
2 changes: 2 additions & 0 deletions docs/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/module.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
16 changes: 16 additions & 0 deletions docs/api-reference/fits/data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _data:

********************************
Data (:mod:`pyvisgen.fits.data`)
********************************

.. currentmodule:: pyvisgen.fits.data

Data submodule of :mod:`pyvisgen.fits`.


Reference/API
=============

.. automodapi:: pyvisgen.fits.data
:inherited-members:
31 changes: 31 additions & 0 deletions docs/api-reference/fits/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _fits:

***********************************
FITS Handler (:mod:`pyvisgen.fits`)
***********************************

.. currentmodule:: pyvisgen.fits


Introduction
============

This module include all the functions and classes needed for handling FITS files.


Submodules
==========

.. toctree::
:maxdepth: 1
:glob:

data
writer


Reference/API
=============

.. automodapi:: pyvisgen.fits
:no-inheritance-diagram:
16 changes: 16 additions & 0 deletions docs/api-reference/fits/writer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _writer:

*****************************************
FITS Writer (:mod:`pyvisgen.fits.writer`)
*****************************************

.. currentmodule:: pyvisgen.fits.writer

FITS writer submodule of :mod:`pyvisgen.fits`.


Reference/API
=============

.. automodapi:: pyvisgen.fits.writer
:inherited-members:
16 changes: 16 additions & 0 deletions docs/api-reference/gridding/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _gridding:

***********************************
Gridding (:mod:`pyvisgen.gridding`)
***********************************

.. currentmodule:: pyvisgen.gridding

Gridding module of pyvisgen.


Reference/API
=============

.. automodapi:: pyvisgen.gridding
:inherited-members:
9 changes: 9 additions & 0 deletions docs/api-reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*************
API Reference
*************

.. toctree::
:maxdepth: 1
:glob:

*/index
16 changes: 16 additions & 0 deletions docs/api-reference/layouts/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _layouts:

*********************************
Layouts (:mod:`pyvisgen.layouts`)
*********************************

.. currentmodule:: pyvisgen.layouts

Layouts module of pyvisgen.


Reference/API
=============

.. automodapi:: pyvisgen.layouts
:inherited-members:
Loading

0 comments on commit 230a84d

Please sign in to comment.