Skip to content

Commit abebe0b

Browse files
authored
Merge pull request #13 from sandialabs/dev
pages/docs revamp
2 parents 2cacd62 + c0c9299 commit abebe0b

File tree

77 files changed

+359
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+359
-213
lines changed

.github/workflows/docker.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
release:
8+
types: [ "published" ]
9+
jobs:
10+
test:
11+
if: github.event_name == 'pull_request'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v3
16+
- name: build
17+
uses: docker/build-push-action@v3
18+
with:
19+
push: false
20+
tags: mrbuche/statmechcrack:test
21+
latest:
22+
if: github.event_name == 'push'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v3
27+
- name: login
28+
uses: docker/login-action@v2
29+
with:
30+
username: mrbuche
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
- name: build-push
33+
uses: docker/build-push-action@v3
34+
with:
35+
push: true
36+
tags: mrbuche/statmechcrack:latest
37+
versioned:
38+
if: github.event_name == 'release'
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: tag
42+
id: tag
43+
uses: dawidd6/action-get-tag@v1
44+
with:
45+
strip_v: true
46+
- name: checkout
47+
uses: actions/checkout@v3
48+
- name: login
49+
uses: docker/login-action@v2
50+
with:
51+
username: mrbuche
52+
password: ${{ secrets.DOCKERHUB_TOKEN }}
53+
- name: login
54+
uses: docker/login-action@v2
55+
with:
56+
registry: ghcr.io
57+
username: ${{ github.actor }}
58+
password: ${{ secrets.GITHUB_TOKEN }}
59+
- name: build-push
60+
uses: docker/build-push-action@v3
61+
with:
62+
push: true
63+
tags: |
64+
mrbuche/statmechcrack:${{steps.tag.outputs.tag}}
65+
mrbuche/statmechcrack:latest
66+
ghcr.io/sandialabs/statmechcrack:${{steps.tag.outputs.tag}}
67+
ghcr.io/sandialabs/statmechcrack:latest

.github/workflows/docs.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/package.yml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,4 @@ jobs:
9090
conda list
9191
PATH="/usr/share/miniconda/bin/:$PATH"
9292
python -c 'import statmechcrack'
93-
python -m statmechcrack.tests
94-
docker:
95-
needs: [get-version, pypi]
96-
runs-on: ubuntu-latest
97-
steps:
98-
- uses: actions/checkout@v2
99-
- name: Translate README.rst to .md for description
100-
run: |
101-
sudo apt install -y pandoc
102-
pandoc -s -o README.md README.rst
103-
- name: Login to DockerHub
104-
uses: docker/[email protected]
105-
with:
106-
username: mrbuche
107-
password: ${{ secrets.DOCKERHUB_TOKEN }}
108-
- name: Build Docker and push to Dockerhub
109-
uses: docker/[email protected]
110-
with:
111-
push: true
112-
tags: |
113-
mrbuche/statmechcrack:latest
114-
mrbuche/statmechcrack:${{ needs.get-version.outputs.VERSION }}
115-
- name: Give upload time before downloading
116-
run: sleep 500s
117-
test-docker:
118-
needs: docker
119-
runs-on: ubuntu-latest
120-
container: mrbuche/statmechcrack
121-
steps:
122-
- name: Test the package
123-
run: |
12493
python -m statmechcrack.tests

.github/workflows/pages.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,12 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10-
- name: Install package and docs extras
10+
- name: install
1111
run: pip install .[all]
12-
- name: pylint badge
12+
- name: docs
1313
run: |
14-
python -m pylint --disable=C0103 --output-format=text statmechcrack | tee pylint.log || pylint-exit $?
15-
PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.log)
16-
if (( $(echo "${PYLINT_SCORE} >= 8.0" | bc -l) )); then
17-
COLOR=brightgreen
18-
elif (( $(echo "${PYLINT_SCORE} >= 4.0" | bc -l) )); then
19-
COLOR=yellow
20-
elif (( $(echo "${PYLINT_SCORE} >= 2.0" | bc -l) )); then
21-
COLOR=orange
22-
else
23-
COLOR=red
24-
fi
25-
curl "https://img.shields.io/badge/Pylint-${PYLINT_SCORE}-${COLOR}?logo=python&logoColor=FBE072" -o pylint.svg
26-
- name: Build docs
27-
run: |
28-
sudo apt-get install pandoc
29-
source .github/workflows/docs.sh
30-
sphinx-build -b html source/ build/html/
31-
sed -i -e "s/ module</</g" build/html/*.html
32-
sed -i '/Built with/,/Docs<\/a>./d' build/html/*.html
14+
cd docs/ && make html
3315
mv build/html/ ../public/
34-
mv ../pylint.svg ../public/
3516
- name: Deploy docs to gh-pages
3617
uses: peaceiris/actions-gh-pages@v3
3718
with:

.github/workflows/rtd.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
version: 2
22
build:
3-
os: ubuntu-20.04
3+
os: ubuntu-22.04
44
tools:
5-
python: "3.9"
6-
sphinx:
7-
configuration: docs/source/conf.py
8-
python:
9-
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
13-
- docs
5+
python: "3.11"
6+
commands:
7+
- pip install .[docs]
8+
- pip install -r docs/requirements.txt
9+
- cd docs/ && make html
10+
- mkdir _readthedocs/
11+
- mv docs/build/html/ _readthedocs/

README.rst

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
statMechCrack
33
#############
44

5-
|build| |docs| |codecov| |codefactor| |pylint|
5+
|build| |docs| |codefactor|
66

77
Statistical mechanical models for crack growth.
88

99
************
1010
Installation
1111
************
1212

13-
|pypi| |conda| |docker|
13+
|pypi| |conda|
1414

1515
The package can be installed using ``pip`` via the `Python Package Index <https://pypi.org/project/statmechcrack>`_ (PyPI),
1616

@@ -30,24 +30,7 @@ Alternatively, a branch can be directly installed using
3030

3131
pip install git+https://github.com/sandialabs/statmechcrack.git@<branch-name>
3232

33-
or after cloning a branch and executing ``python setup.py install``.
34-
There are also `Docker images <https://hub.docker.com/r/mrbuche/statmechcrack>`_ available for use.
35-
In all of these cases, a valid installation can be tested by running
36-
37-
::
38-
39-
python -m statmechcrack.tests
40-
41-
***********
42-
Information
43-
***********
44-
45-
- `Contributing <https://github.com/sandialabs/statMechCrack/blob/main/CONTRIBUTING.md>`__
46-
- `Documentation <https://sandialabs.github.io/statMechCrack>`__
47-
- `License <https://github.com/sandialabs/statmechcrack/blob/main/LICENSE>`__
48-
- `Releases <https://github.com/sandialabs/statmechcrack/releases>`__
49-
- `Repository <https://github.com/sandialabs/statmechcrack>`__
50-
- `Tutorial <https://sandialabs.github.io/statMechCrack/tutorial.html>`__
33+
or after cloning a branch and executing ``python setup.py install``. Any installation is tested by executing ``python -m statmechcrack.tests``.
5134

5235
********
5336
Citation
@@ -74,25 +57,16 @@ Copyright 2022 National Technology & Engineering Solutions of Sandia, LLC (NTESS
7457
.. |docs| image:: https://img.shields.io/readthedocs/statmechcrack?logo=readthedocs&label=Read%20the%20Docs
7558
:target: https://statmechcrack.readthedocs.io/en/latest/
7659

77-
.. |codecov| image:: https://img.shields.io/codecov/c/github/sandialabs/statmechcrack?label=Codecov&logo=codecov
78-
:target: https://codecov.io/gh/sandialabs/statmechcrack
79-
8060
.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/sandialabs/statmechcrack?label=Codefactor&logo=codefactor
8161
:target: https://www.codefactor.io/repository/github/sandialabs/statmechcrack
8262

83-
.. |pylint| image:: https://raw.githubusercontent.com/sandialabs/statmechcrack/gh-pages/pylint.svg
84-
:target: https://github.com/sandialabs/statmechcrack
85-
8663
.. |pypi| image:: https://img.shields.io/pypi/v/statmechcrack?logo=pypi&logoColor=FBE072&label=PyPI&color=4B8BBE
8764
:target: https://pypi.org/project/statmechcrack/
8865

8966
.. |conda| image:: https://img.shields.io/conda/v/mrbuche/statmechcrack.svg?logo=anaconda&color=3EB049&label=Anaconda
9067
:target: https://anaconda.org/mrbuche/statmechcrack/
9168

92-
.. |docker| image:: https://img.shields.io/docker/v/mrbuche/statmechcrack?color=0db7ed&label=Docker%20Hub&logo=docker&logoColor=0db7ed
93-
:target: https://hub.docker.com/r/mrbuche/statmechcrack
94-
95-
.. |license| image:: https://img.shields.io/github/license/sandialabs/statmechcrack?label=License
69+
.. |license| image:: https://img.shields.io/github/license/sandialabs/statmechcrack?label=License&color=yellowgreen
9670
:target: https://github.com/sandialabs/statmechcrack/blob/main/LICENSE
9771

9872
.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7008312.svg

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
2+
{% block breadcrumbs_aside %}
3+
<li class="wy-breadcrumbs-aside">
4+
<a style="text-decoration: none; padding: 0" href="https://github.com/sandialabs/statMechCrack">
5+
<iconify-icon icon="fa-brands:github" height="1.6em"></iconify-icon>
6+
</a>
7+
<a style="text-decoration: none; padding: 0" href="https://pypi.org/project/statmechcrack">
8+
<iconify-icon icon="simple-icons:pypi" height="1.6em"></iconify-icon>
9+
</a>
10+
<a style="text-decoration: none; padding: 0" href="https://anaconda.org/mrbuche/statmechcrack">
11+
<iconify-icon icon="simple-icons:anaconda" height="1.6em"></iconify-icon>
12+
</a>
13+
</li>
14+
{% endblock %}

0 commit comments

Comments
 (0)