diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1aa05c5..983c5e1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8] + python-version: [3.12] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 79ecce7..12d32dc 100644 --- a/.gitignore +++ b/.gitignore @@ -139,4 +139,30 @@ cython_debug/ */_build/ -*/.ipynb_checkpoints/ \ No newline at end of file +*/.ipynb_checkpoints/ + +# Julia stuff - from https://github.com/github/gitignore/blob/main/Julia.gitignore +# Files generated by invoking Julia with --code-coverage +*.jl.cov +*.jl.*.cov + +# Files generated by invoking Julia with --track-allocation +*.jl.mem + +# System-specific files and directories generated by the BinaryProvider and BinDeps packages +# They contain absolute paths specific to the host computer, and so should not be committed +deps/deps.jl +deps/build.log +deps/downloads/ +deps/usr/ +deps/src/ + +# Build artifacts for creating documentation generated by the Documenter package +docs/build/ +docs/site/ + +# File generated by Pkg, the package manager, based on a corresponding Project.toml +# It records a fixed state of all packages used by the project. As such, it should not be +# committed for packages, but should be committed for applications that require a static +# environment. +Manifest.toml \ No newline at end of file diff --git a/LICENSE b/LICENSE index 3290e00..e8b35f6 100755 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ BSD License -Copyright (c) 2021, Jessica A. Nash +Copyright (c) 2024, The Molecular Sciences Software Institute and Lesson Authors All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c0c839d --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ + +.PHONY: book + +html: + jupyter-book build book/ + +clean: book/_build + echo "Removing everything under _build" + rm -rf book/_build \ No newline at end of file diff --git a/README.md b/README.md index fda76eb..63920db 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ This is a Jupyter book template for molssi workshops ### Building the book -If you'd like to develop on and build the Scientific Visualization using Python book, you should: +If you'd like to develop on and build this book, you should: - Clone this repository and run - Run `pip install -r requirements.txt` (it is recommended you do this within a virtual environment) - (Recommended) Remove the existing `book/_build/` directory -- Run `jupyter-book build book/` +- Run `make html` from the root of the repository A fully-rendered HTML version of the book will be built in `book/_build/html/`. @@ -28,7 +28,7 @@ This will automatically push your build to the `gh-pages` branch. More informati ## Contributors -We welcome and recognize all contributions. You can see a list of current contributors in the [contributors tab](https://github.com/janash/molssi_python_visualization/graphs/contributors). +We welcome and recognize all contributions. ## Credits diff --git a/book/_config.yml b/book/_config.yml index 3702004..9990554 100755 --- a/book/_config.yml +++ b/book/_config.yml @@ -31,6 +31,10 @@ html: use_repository_button: true google_analytics_id: G-FHKVGE8HKZ +extra_css: + - https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.6.0/css/fontawesome.min.css + - https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css + sphinx: config: html_js_files: diff --git a/book/_static/custom.css b/book/_static/custom.css index 276d416..718ff60 100644 --- a/book/_static/custom.css +++ b/book/_static/custom.css @@ -1,9 +1,93 @@ -/* Custom CSS * - mostly custom admonitions */ +img { + display: block +} + + +html[data-theme="light"] { + --pst-color-primary: #ed1c24; + --pst-color-warning: #ed1c24; + --pst-heading-color: #ed1c24; + --pst-color-primary-highlight: #bc151b; + --pst-color-secondary: #1A1A1A; + --pst-color-secondary-highlight: #222222; + +} + +html[data-theme="dark"] { + --pst-color-primary: #ed1c24; + --pst-color-warning: #ed1c24; + --pst-color-primary-highlight: #bc151b; + --pst-color-background: #1A1A1A; + --pst-color-on-background: #222222; + --pst-color-surface: #222222; + --pst-color-secondary: #ffffff; + --pst-color-secondary-highlight: #ffffff; + + +} + +html[data-theme="light"] a:hover { + color: #1A1A1A; +} + +html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { + color: #ffffff; +} + + +html[data-theme="dark"] a { + color: #ffffff; +} + +html[data-theme="light"] a { + color: #ed1c24; +} + +html[data-theme="light"] a:visited { + color: #ed1c24; +} + +html[data-theme="dark"] .reference.external { + text-decoration: underline; + +} + +html[data-theme="dark"] p .reference.internal { + text-decoration: underline; + +} + +html[data-theme="dark"] a:hover { + color: #ed1c24; +} + +html[data-theme="dark"] .prev-next-area a p.prev-next-title { + color: white; +} + +html[data-theme="dark"] .prev-next-area:hover a:hover p.prev-next-title:hover { + color: #ed1c24; +} -.bd-main { - flex-grow: 1 !important; +html[data-theme="dark"] dt:target { + background-color: #000000; +} + +html .toctree-wrapper li[class^=toctree-l] { + list-style: circle; +} + +img:not(.logo__image, .footer_logo) { + padding: 20px; +} + + +.footer_logo { + max-height: 60px; } +/* Custom CSS * - mostly custom admonitions */ + /**********************************************************************************/ /* Overview Admonition*/ @@ -18,7 +102,6 @@ } /* Overview admonition left border */ - .adomonition.overview, div.admonition.overview, .adomonition.day-overview, div.admonition.day-overview { margin: 1.5625em auto; @@ -32,17 +115,6 @@ } /* Overview admonition icon */ -.admonition.overview>.admonition-title:before, div.admonition.overview>.admonition-title:before { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; - color: #ffc107; - font-family: Font Awesome\ 5 Free; - font-weight: 900; - content: "\f128"; -} - admonition.overview>.admonition-title:after, div.admonition.overview>.admonition-title:after { color: #ffc107; content: "\f128"; @@ -55,19 +127,29 @@ admonition.overview>.admonition-title:after, div.admonition.overview>.admonition width: 1rem; } +/* Overview admonition icon */ +admonition.overview>.admonition-title:before, div.admonition.overview>.admonition-title:before { + position: absolute; + left: .6rem; + width: 1rem; + height: 1rem; + color: #ffc107; + background-color: #ffc10700; + font-family: Font Awesome\ 5 Free; + font-weight: 900; +} /* day-overview admonition icon */ -.admonition.day-overview>.admonition-title:before, div.admonition.day-overview>.admonition-title:before { +admonition.day-overview>.admonition-title:before, div.admonition.day-overview>.admonition-title:before { position: absolute; left: .6rem; - width: 0rem; - height: 0rem; + width: 1rem; + height: 1rem; color: #ffc107; font-family: Font Awesome\ 5 Free; font-weight: 900; content: "\f5fc"; } - /**********************************************************************************/ /**********************************************************************************/ @@ -83,55 +165,42 @@ admonition.overview>.admonition-title:after, div.admonition.overview>.admonition background-color: #fd7e1433; } -/* Exercise Admonition Icon */ -.admonition.exercise>.admonition-title:before, div.admonition.exercise>.admonition-title:before { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; - color: #fd7e14; - font-family: Font Awesome\ 5 Free; - font-weight: 900; - content: "\f303"; -} - /* Exercise Admonition Icon */ .admonition.exercise>.admonition-title:after, div.admonition.exercise>.admonition-title:after { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; color: #fd7e14; - font-family: Font Awesome\ 5 Free; - font-weight: 900; content: "\f303"; + font: var(--fa-font-solid); + height: 1rem; + left: 0.5rem; + line-height: inherit; + opacity: 1; + position: absolute; + width: 1rem; } -/* Solution Left Icon */ -.admonition.solution>.admonition-title:before, div.admonition.solution>.admonition-title:before { + +.admonition.exercise>.admonition-title:before, div.admonition.exercise>.admonition-title:before, +.admonition.solution>.admonition-title:before, div.admonition.solution>.admonition-title:before{ position: absolute; left: .6rem; - width: 0rem; - height: 0rem; + width: 1rem; + height: 1rem; color: #fd7e14; - font-family: Font Awesome\ 5 Free; - font-weight: 900; - content: "\f06e"; + background-color: #fd7e1400; } - /* Solution Left Icon */ .admonition.solution>.admonition-title:after, div.admonition.solution>.admonition-title:after { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; color: #fd7e14; - font-family: Font Awesome\ 5 Free; - font-weight: 900; content: "\f06e"; -} - + font: var(--fa-font-solid); + height: 1rem; + left: 0.5rem; + line-height: inherit; + opacity: 1; + position: absolute; + width: 1rem; + } /* Overview and Exercise - Left Border */ .adomonition.exercise, div.admonition.exercise, .adomonition.solution, div.admonition.solution { @@ -161,28 +230,26 @@ admonition.overview>.admonition-title:after, div.admonition.overview>.admonition /* Key Admonition Icon*/ .admonition.key>.admonition-title:before, div.admonition.key>.admonition-title:before { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; - color: #00A300; - font-family: Font Awesome\ 5 Free; - font-weight: 900; - content: "\f084"; + position: absolute; + left: .6rem; + width: 1rem; + height: 1rem; + color: #00A300; + background-color: #00A30000; } -/* Key Admonition Icon*/ +/* Key Icon */ .admonition.key>.admonition-title:after, div.admonition.key>.admonition-title:after { - position: absolute; - left: .6rem; - width: 0rem; - height: 0rem; color: #00A300; - font-family: Font Awesome\ 5 Free; - font-weight: 900; content: "\f084"; -} - + font: var(--fa-font-solid); + height: 1rem; + left: 0.5rem; + line-height: inherit; + opacity: 1; + position: absolute; + width: 1rem; + } /* Key Admonition left border */ .adomonition.key, div.admonition.key { margin: 1.5625em auto; @@ -197,97 +264,13 @@ admonition.overview>.admonition-title:after, div.admonition.overview>.admonition /**********************************************************************************/ -@import "../basic.css"; - -html[data-theme="light"] { - --pst-color-primary: #ed1c24; - --pst-color-warning: #ed1c24; - --pst-color-primary-highlight: #bc151b; - --pst-color-secondary: #1d35e7; - --pst-color-secondary-highlight: #3e51e3; - -} - -html[data-theme="dark"] { - --pst-color-primary: #ed1c24; - --pst-color-warning: #ed1c24; - --pst-color-primary-highlight: #bc151b; - --pst-color-background: #1A1A1A; - --pst-color-secondary: #1d35e7; - --pst-color-secondary-highlight: #3e51e3; - - -} - -html[data-theme="light"] a:hover { - color: #1A1A1A; -} - -html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3, html[data-theme="light"] h4, html[data-theme="light"] h5, html[data-theme="light"] h6 { - color: #000000; -} - -html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { - color: #ffffff; -} - - -html[data-theme="dark"] a { - color: #ffffff; -} - -html[data-theme="dark"] .reference.external { - text-decoration: underline; - -} - -html[data-theme="dark"] p .reference.internal { - text-decoration: underline; - -} - -html[data-theme="dark"] a:hover { - color: #ed1c24; -} - -html[data-theme="dark"] .prev-next-area a p.prev-next-title { - color: white; -} - -html[data-theme="dark"] .prev-next-area:hover a:hover p.prev-next-title:hover { - color: #ed1c24; -} - -html[data-theme="dark"] dt:target { - background-color: #000000; -} - -html .toctree-wrapper li[class^=toctree-l] { - list-style: circle; -} - -img:not(.logo__image, .footer_logo) { - padding: 20px; -} - - -.footer_logo { - max-height: 60px; -} - -table.border, .border table, .border caption, .border thead, .border tbody, .border th, .border td { - border: thin solid gray !important; - text-align: center; -} - .footer-items__start { width: 100%; } - - - - - - - +/* Get rid of side bar , based on https://github.com/executablebooks/sphinx-book-theme/issues/732#issuecomment-1752572223 */ +.bd-sidebar-primary div#rtd-footer-container { + bottom:-1rem; + margin:-1rem; + position:fixed; + } \ No newline at end of file diff --git a/book/_toc.yml b/book/_toc.yml index 1678114..f9915cb 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -3,3 +3,4 @@ root: intro sections: - file: setup - file: sample +- file: sample2 diff --git a/book/sample2.ipynb b/book/sample2.ipynb new file mode 100644 index 0000000..3919dc8 --- /dev/null +++ b/book/sample2.ipynb @@ -0,0 +1,81 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Sample Notebook 2\n", + "\n", + "It might be more transferable to use colored divs for special sections.\n", + "\n", + "Blue for overview\n", + "
\n", + "

Overview

\n", + "\n", + "Questions:\n", + "* How do I use colored divs in a notebook?\n", + "\n", + "Objectives:\n", + "* Learn how to use colored divs in a notebook.\n", + "\n", + "
\n", + "\n", + "Green for information\n", + "
\n", + "

Information

\n", + "This is some useful information.\n", + "\n", + "```python\n", + "print(\"Hello, World!\")\n", + "```\n", + "
\n", + "\n", + "
\n", + "

Exercise

\n", + "Orange for exercises.\n", + "
\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mFailed to start the Kernel. \n", + "\u001b[1;31mUnable to start Kernel 'Julia 1.10.4' due to a timeout waiting for the ports to get used. \n", + "\u001b[1;31mView Jupyter log for further details." + ] + } + ], + "source": [ + "print(\"Hello, World!\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "jupyter-book-2024", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.12.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/book/setup.ipynb b/book/setup.ipynb index d9a3797..5cddb66 100644 --- a/book/setup.ipynb +++ b/book/setup.ipynb @@ -5,38 +5,17 @@ "id": "collective-theorem", "metadata": {}, "source": [ - "Set Up\n", - "=====\n", + "# Set Up\n", "\n", + "This page should give directions for setting up the software environment for the lessons. \n", "\n", - "\n", - "## Installing Python through Anaconda\n", - "[Python](https://python.org/) is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be a bit difficult, however, so we recommend the all-in-one installer Anaconda.\n", - "\n", - "1. Navigate to the [download page](https://www.anaconda.com/products/individual) for Anaconda.\n", - "2. Download the appropriate installer for your operating system. **Make sure you get the installer listed under Python 3** (not 2.7).\n", - "3. Double click the installer icon and follow the set-up instructions, keeping most of the default options. If you are Windows, make sure to choose to choose the option **Make Anaconda the default Python** during installation.\n", - "\n", + "## Installing Julia\n", + "Put Directions for installing Julia here.\n", "\n", "## Obtain lesson materials\n", - "\n", - "\n", - "## Start a Jupyter notebook\n", - "From Finder or Spotlight (Mac OS) or the Start Menu (Windows) find the Anaconda Navigator. The icon looks like a green circle. Click Launch under Jupyter Notebook. It may take a few seconds to load the page, especially if it is the first time you have ever used the jupyter notebook, so don't panic if nothing loads for a few seconds. Then a new window should open in your default internet browser. Use the file navigation window to navigate to `Desktop` and then to the `WORKSHOP_NAME` folder. In the upper right hand corner, click New, then choose Python 3 from the dropdown list (shown below)\n", - "\n", - "\n", - "\n", - "This will start a new Jupyter notebook using Python 3. You're ready to go!\n", - "\n" + "Give directions for obtaining any lesson materials here.\n", + "These might be pre-filled notebooks or files to download.\n" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "future-duncan", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/requirements.txt b/requirements.txt index 0fe22df..9937424 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,3 @@ jupyter-book -matplotlib -numpy +jupyter-lab ghp-import -pandas -kaleido \ No newline at end of file