Skip to content

Commit

Permalink
Add required files for docs site: https://py-tes.readthedocs.io
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Nov 5, 2024
1 parent 42edcce commit bd56b51
Show file tree
Hide file tree
Showing 15 changed files with 1,091 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ jobs:
tes
- name: Build docs
run: mkdocs build
run: mkdocs build && mkdocs gh-deploy --force

32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
177 changes: 177 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Snakemake.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Snakemake.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Snakemake"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Snakemake"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
91 changes: 91 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.image-reference img {
display: inline;
background: none !important;
}

.image-reference {
border-bottom: none !important;
}

:root {
--color-links: #047857;
--color-brand: #047857;
}

#content {
overflow-x: auto;
}

.sticky.top-16 {
overflow: unset;
}

/* Light theme styles (default) */
body.dark-theme {
background-color: black !important;
}

/* Dark theme styles */
body.light-theme {
background-color: blue !important;
}

pre.light-theme .kn { color: #2838b0 !important } /* Keyword.Namespace */
pre.light-theme .kp { color: #2838b0 !important } /* Keyword.Pseudo */
pre.light-theme .kr { color: #2838b0 !important } /* Keyword.Reserved */
pre.light-theme .kt { color: #2838b0; font-style: italic !important } /* Keyword.Type */
pre.light-theme .m { color: #444444 !important } /* Literal.Number */
pre.light-theme .s { color: #b83838 !important } /* Literal.String */
pre.light-theme .na { color: #388038 !important } /* Name.Attribute */
pre.light-theme .nb { color: #388038 !important } /* Name.Builtin */
pre.light-theme .nc { color: #287088 !important } /* Name.Class */
pre.light-theme .no { color: #b85820 !important } /* Name.Constant */
pre.light-theme .nd { color: #287088 !important } /* Name.Decorator */
pre.light-theme .ni { color: #709030 !important } /* Name.Entity */
pre.light-theme .ne { color: #908828 !important } /* Name.Exception */
pre.light-theme .nf { color: #785840 !important } /* Name.Function */
pre.light-theme .nl { color: #289870 !important } /* Name.Label */
pre.light-theme .nn { color: #289870 !important } /* Name.Namespace */
pre.light-theme .nt { color: #2838b0 !important } /* Name.Tag */
pre.light-theme .nv { color: #b04040 !important } /* Name.Variable */
pre.light-theme .ow { color: #a848a8 !important } /* Operator.Word */
pre.light-theme .pm { color: #888888 !important } /* Punctuation.Marker */
pre.light-theme .w { color: #a89028 !important } /* Text.Whitespace */
pre.light-theme .mb { color: #444444 !important } /* Literal.Number.Bin */
pre.light-theme .mf { color: #444444 !important } /* Literal.Number.Float */
pre.light-theme .mh { color: #444444 !important } /* Literal.Number.Hex */
pre.light-theme .mi { color: #444444 !important } /* Literal.Number.Integer */
pre.light-theme .mo { color: #444444 !important } /* Literal.Number.Oct */
pre.light-theme .sa { color: #444444 !important } /* Literal.String.Affix */
pre.light-theme .sb { color: #b83838 !important } /* Literal.String.Backtick */
pre.light-theme .sc { color: #a848a8 !important } /* Literal.String.Char */
pre.light-theme .dl { color: #b85820 !important } /* Literal.String.Delimiter */
pre.light-theme .sd { color: #b85820; font-style: italic !important } /* Literal.String.Doc */
pre.light-theme .s2 { color: #b83838 !important } /* Literal.String.Double */
pre.light-theme .se { color: #709030 !important } /* Literal.String.Escape */
pre.light-theme .sh { color: #b83838 !important } /* Literal.String.Heredoc */
pre.light-theme .si { color: #b83838; text-decoration: underline !important } /* Literal.String.Interpol */
pre.light-theme .sx { color: #a848a8 !important } /* Literal.String.Other */
pre.light-theme .sr { color: #a848a8 !important } /* Literal.String.Regex */
pre.light-theme .s1 { color: #b83838 !important } /* Literal.String.Single */
pre.light-theme .ss { color: #b83838 !important } /* Literal.String.Symbol */
pre.light-theme .bp { color: #388038; font-style: italic !important } /* Name.Builtin.Pseudo */
pre.light-theme .fm { color: #b85820 !important } /* Name.Function.Magic */
pre.light-theme .vc { color: #b04040 !important } /* Name.Variable.Class */
pre.light-theme .vg { color: #908828 !important } /* Name.Variable.Global */
pre.light-theme .vi { color: #b04040 !important } /* Name.Variable.Instance */
pre.light-theme .vm { color: #b85820 !important } /* Name.Variable.Magic */
pre.light-theme .il { color: #444444 !important } /* Literal.Number.Integer.Long */
pre.light-theme .n { color: #444444 !important } /* Misc */
pre.light-theme .o { color: #444 !important } /* Misc */
pre.light-theme .p { color: #444 !important } /* Misc */
pre.light-theme .k { color: #a848a8 !important } /* Misc */
pre.light-theme .kc { color: #2838b0 !important } /* Misc */
pre.light-theme .go { color: #546E7A !important } /* Misc */
pre.light-theme .go { color: #546E7A !important } /* Misc */
pre.light-theme .c1 { color: #546E7A !important } /* Misc */
pre.light-theme .copy { background: #BBB !important } /* Misc */


.c1 { color: #EEFFFF !important } /* Misc */
.go { color: #EEFFFF !important } /* Misc */
28 changes: 28 additions & 0 deletions docs/_static/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Select the button using its class, assuming it's the only one with this class
const nav = document.querySelector(".flex.items-center.space-x-1");
console.log(nav);

const themeToggleButton = nav.childNodes[3];
console.log(themeToggleButton);

mode = localStorage.getItem('darkMode');
setTheme(mode);

// Add an event listener to the button
themeToggleButton.addEventListener('click', function() {
mode = mode === 'light' ? 'dark' : 'light'
setTheme(mode);
});

function setTheme(mode) {
var pres = document.body.getElementsByTagName("pre");
for (let pre of pres) {
if (mode === 'dark') {
pre.classList.add('dark-theme');
pre.classList.remove('light-theme');
} else {
pre.classList.add('light-theme');
pre.classList.remove('dark-theme');
}
}
}
Binary file added docs/_static/logo-ga4gh-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/logo-ga4gh-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bd56b51

Please sign in to comment.