Skip to content

Commit a521047

Browse files
committed
Added first part of documentation in sphinx
1 parent 9f2e068 commit a521047

Some content is hidden

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

92 files changed

+4646
-4
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ src/gpumd*
99
src/nep*
1010

1111
.history
12-
.vscode
12+
.vscode
13+
*~
14+
local
15+
public*
16+
\#*

.gitlab-ci.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
image: $CI_REGISTRY/materials-theory/$CI_PROJECT_NAME/cicd
2+
3+
variables:
4+
INSTDIR: "local_installation"
5+
6+
before_script:
7+
- export PATH=$PWD/$INSTDIR:${PATH}
8+
9+
10+
#------------------- build stage -------------------
11+
12+
.build:
13+
stage: build
14+
artifacts:
15+
expire_in: 2 days
16+
paths:
17+
- local_installation/
18+
script:
19+
- mkdir $INSTDIR
20+
- cd src
21+
- make CFLAGS="-std=c++14 -O3 -arch=sm_72 -DDEBUG" -j4
22+
- mv gpumd nep ../$INSTDIR/
23+
build:linux:
24+
extends: .build
25+
tags:
26+
- linux
27+
28+
#------------------- test stage -------------------
29+
30+
test_documentation:
31+
stage: test
32+
tags:
33+
- linux
34+
needs:
35+
- build:linux
36+
except:
37+
- master
38+
artifacts:
39+
expire_in: 1 days
40+
paths:
41+
- public
42+
script:
43+
- mkdir public
44+
- sphinx-build -W doc/ public/
45+
46+
47+
#------------------- deploy stage -------------------
48+
49+
pages:
50+
stage: deploy
51+
tags:
52+
- linux
53+
only:
54+
- master
55+
- tags
56+
except:
57+
- schedules
58+
artifacts:
59+
expire_in: 14 days
60+
paths:
61+
- public
62+
script:
63+
# prepare homepage
64+
- mkdir -p public/dev
65+
# --------------------------
66+
# DEVELOPMENT VERSION
67+
- git checkout master
68+
- tag=$(git describe --tags | tail -1)
69+
- echo "tag= $tag"
70+
- sed -i "s/version = ''/version = '$tag'/" doc/conf.py
71+
- sphinx-build -W doc/ public/dev/
72+
- git checkout -- doc/source/conf.py
73+
# --------------------------
74+
# STABLE VERSION
75+
- tag=$(git tag --tags | tail -1)
76+
- echo "tag= $tag"
77+
- git checkout $tag
78+
- sphinx-build -W doc/ public/
79+
# --------------------------
80+
# clean up
81+
- ls -l public/
82+
- chmod go-rwX -R public/

Dockerfile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Base image
2+
FROM nvidia/cuda:11.7.1-devel-ubuntu20.04
3+
4+
# Base packages
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
ENV TZ=Europe/Gothenburg
7+
RUN \
8+
apt-get update -qy && \
9+
apt-get upgrade -qy && \
10+
apt-get install -qy \
11+
git \
12+
graphviz \
13+
pandoc \
14+
python3-pip \
15+
zip
16+
17+
RUN \
18+
pip3 install --upgrade \
19+
pip \
20+
&& \
21+
pip3 install --upgrade \
22+
coverage \
23+
flake8 \
24+
nbmake \
25+
pytest \
26+
setuptools_scm \
27+
twine \
28+
xdoctest
29+
30+
# Packages needed for calorine (compare setup.py)
31+
RUN \
32+
pip3 install \
33+
ase \
34+
matplotlib \
35+
numpy \
36+
pandas \
37+
pybind11
38+
39+
# Packages for building documentation
40+
RUN \
41+
pip3 install --upgrade \
42+
sphinx_autodoc_typehints \
43+
sphinx-rtd-theme \
44+
sphinx_sitemap \
45+
sphinxcontrib-bibtex \
46+
cloud_sptheme \
47+
nbsphinx \
48+
&& \
49+
pip3 install --upgrade \
50+
jinja2==3.0.3
51+
52+
CMD /bin/bash

doc/_static/custom.css

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@import url("css/theme.css");
2+
3+
.toggle .header {
4+
display: block;
5+
clear: both;
6+
padding-top: -10px;
7+
padding-bottom: 20px;
8+
}
9+
10+
.toggle .header:after {
11+
content: " ▼";
12+
}
13+
14+
.toggle .header.open:after {
15+
content: " ▲";
16+
}
17+
18+
/* Custom colors */
19+
20+
.wy-side-nav-search, .wy-nav-top { /* above navigation, behind logo */
21+
background: #a7c7e9;
22+
}
23+
24+
.icon.icon-home { /* link above logo */
25+
color: #5e81ac;
26+
}
27+
28+
.version { /* version spec under logo */
29+
color: #5e81ac !important;
30+
}
31+
32+
.highlight { /* code blocks */
33+
background: #d5e1cb;
34+
}
35+
36+
.admonition-title { /* notes, title */
37+
background: #5e81ac !important;
38+
}
39+
40+
.admonition { /* notes */
41+
background: #d5e1cb !important;
42+
}
43+
44+
.rst-content dl:not(.docutils) dt { /* class definitions */
45+
background: #e4f3f2;
46+
color: #005248;
47+
border-top: solid 3px #005248;
48+
}
49+
50+
.rst-content dl:not(.docutils) dl dt{ /* functions */
51+
border-left:solid 3px #005248;
52+
background: #e4f3f2;
53+
color: #005248;
54+
}

doc/_static/logo-2x1.png

61.9 KB
Loading

doc/_static/logo-icon.svg

+12
Loading

doc/_static/logo.ico

4.19 KB
Binary file not shown.

doc/_static/logo.png

56.8 KB
Loading

doc/_static/logo.svg

+30
Loading

doc/_templates/breadcrumbs.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div style="text-align: right;">
2+
<a href="https://github.com/brucefan1983/GPUMD" target="_blank">source repo</a>
3+
| <a href="https://gpumd.org/" target="_blank">gpumd.org</a>
4+
</div>

doc/_templates/page.html

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% extends "!page.html" %}
2+
{% block extrahead %}
3+
<meta name="twitter:card" content="summary" />
4+
{% endblock %}
5+
6+
{% block footer %}
7+
<script type="text/javascript">
8+
$(document).ready(function() {
9+
$(".toggle > *").hide();
10+
$(".toggle .header").show();
11+
$(".toggle .header").click(function() {
12+
$(this).parent().children().not(".header").toggle(400);
13+
$(this).parent().children(".header").toggleClass("open");
14+
})
15+
});
16+
</script>
17+
18+
<script>
19+
(function() {
20+
if (!localStorage.getItem('cookieconsent')) {
21+
var banner = document.createElement("div");
22+
banner.innerHTML ='\
23+
<div class="cookieconsent" style="position:fixed;padding:18px;left:0;bottom:0;background-color:#121212;color:#FFF;text-align:center;width:100%;z-index:99999;">\
24+
This website uses cookies to gather general statistics about its usage. \
25+
<a href="#" style="font-size: 90%; border-radius: 5px; background-color: #CCCCCC; padding: 2px 7px; margin-left: 1em; color:black;">Hide</a>\
26+
</div>';
27+
document.body.appendChild(banner);
28+
document.querySelector('.cookieconsent a').onclick = function(e) {
29+
e.preventDefault();
30+
document.querySelector('.cookieconsent').style.display = 'none';
31+
localStorage.setItem('cookieconsent', true);
32+
};
33+
}
34+
})();
35+
</script>
36+
{% endblock %}

doc/_templates/versions.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
2+
<span class="rst-current-version" data-toggle="rst-current-version">
3+
<span class="fa fa-book"> Documentation</span>
4+
v: {{ current_version }}
5+
<span class="fa fa-caret-down"></span>
6+
</span>
7+
<div class="rst-other-versions">
8+
<dl>
9+
<dt>Versions</dt>
10+
{% for slug, url in versions %}
11+
<dd><a href="{{ url }}">{{ slug }}</a></dd>
12+
{% endfor %}
13+
</dl>
14+
</div>
15+
</div>

0 commit comments

Comments
 (0)