Skip to content

Commit

Permalink
Merge pull request #68 from materialsproject/jb_docs
Browse files Browse the repository at this point in the history
update docs to jupyter book
  • Loading branch information
jmmshn authored Dec 19, 2022
2 parents f049b6c + bb958f8 commit d2f90b7
Show file tree
Hide file tree
Showing 40 changed files with 826 additions and 396 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Install pandoc
run: sudo apt-get install pandoc

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
Expand All @@ -52,7 +52,7 @@ jobs:
pip install -e .[strict]
pip install -e .[docs]
- name: Build
run: sphinx-build docs/source docs_build
run: jupyter-book build --path-output docs docs/source

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
57 changes: 25 additions & 32 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ on:
push:
branches:
- main

tags:
- 'v*'
- "v*"

pull_request:
branches:
Expand All @@ -18,10 +17,9 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -32,7 +30,6 @@ jobs:
pip install -e .[dev]
pre-commit install
- name: Lint
run: |
pre-commit run --all-files --show-diff-on-failure
Expand All @@ -41,34 +38,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10' ]
python-version: ["3.8", "3.9", "3.10"]

env:
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[strict]
pip install -e .[tests]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[strict]
pip install -e .[tests]
- name: Test
run: pytest --cov=pymatgen --cov-report=xml
- name: Test
run: pytest --cov=pymatgen --cov-report=xml

- uses: codecov/codecov-action@v1
if: matrix.python-version == 3.10
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
- uses: codecov/codecov-action@v1
if: matrix.python-version == 3.10
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml

docs:
runs-on: ubuntu-latest
Expand All @@ -82,9 +79,9 @@ jobs:
- name: Install pandoc
run: sudo apt-get install pandoc

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -93,8 +90,4 @@ jobs:
pip install -e .[strict]
pip install -e .[docs]
- name: Build
run: sphinx-build docs/source docs_build

- name: Test Jupyter Notebooks
run: |
pytest --nbmake --nbmake-kernel=python3 tutorials
run: jupyter-book build --path-output docs docs/source
2 changes: 1 addition & 1 deletion .github/workflows/update-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ 3.10 }}
cache: pip
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,7 @@ examples/wip*
.vscode/

pymatgen/analysis/defects/corrections/kumagai_old.py

docs.old/_build/

docs.old/
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

43 changes: 43 additions & 0 deletions docs/source/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: pymatgen-analysis-defects
author: Jimmy-Xuan Shen

# Patterns to skip when building the book. Can be glob-style (e.g. "*skip.ipynb")
exclude_patterns : [_build, Thumbs.db, .DS_Store, "**.ipynb_checkpoints"]

# Cache re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: cache

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# Information about where the book exists on the web
repository:
url: https://github.com/materialsproject/pymatgen-analysis-defects # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: main # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
home_page_in_navbar: false
use_edit_page_button: true
baseurl: https://materialsproject.github.io/pymatgen-analysis-defects


sphinx:
config:
extra_extensions:
- IPython.sphinxext.ipython_console_highlighting
70 changes: 0 additions & 70 deletions docs/source/_static/custom.css

This file was deleted.

Binary file removed docs/source/_static/fonts/lato-bold-italic.woff
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-bold-italic.woff2
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-bold.woff
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-bold.woff2
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-normal-italic.woff
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-normal-italic.woff2
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-normal.woff
Binary file not shown.
Binary file removed docs/source/_static/fonts/lato-normal.woff2
Binary file not shown.
File renamed without changes
8 changes: 8 additions & 0 deletions docs/source/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro
chapters:
- file: content/quickstart
- file: content/defining-defects
Loading

0 comments on commit d2f90b7

Please sign in to comment.