Skip to content

Commit 2bb4dab

Browse files
committed
docs: chore documentation pre-release
* change theme : pydata to read-the-docs * add theme overrides vie css * rename readme.rst to getting_started.rst * add missing torch and pennylane pip install to deploy docs action
1 parent 3c2e1b0 commit 2bb4dab

File tree

7 files changed

+163
-17
lines changed

7 files changed

+163
-17
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ on:
55

66
jobs:
77
docs:
8+
89
runs-on: ubuntu-latest
10+
911
steps:
1012
- uses: actions/checkout@v2
1113
- uses: actions/setup-python@v2
1214
- name: Install dependencies
1315
run: |
1416
sudo apt install pandoc
17+
pip install torch pennylane
1518
pip install -r requirements-dev.txt
1619
- name: Sphinx build
1720
run: |

docs/_static/style.css

Lines changed: 125 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
/* To have blue background of width of the block (instead of width of content) */
2-
dl.class > dt:first-of-type {
3-
display: block !important;
4-
}
5-
6-
.xref.py.py-class,
7-
.xref.py.py-data,
8-
.xref.py.py-obj
9-
{
10-
background-color: #f0f0f0;
11-
}
12-
13-
141
/* To customize thumbnails in tutorials gallery */
2+
153
.sphx-glr-thumbcontainer {
164
min-height: 320px !important;
175
margin: 20px !important;
@@ -26,3 +14,127 @@ dl.class > dt:first-of-type {
2614
.sphx-glr-thumbcontainer a.internal {
2715
padding: 170px 90px 0 !important;
2816
}
17+
18+
19+
/* Custom classes */
20+
21+
.small { font-size:40% }
22+
.smaller, .pr { font-size:70% }
23+
24+
25+
/* Custom classes with bootstrap buttons */
26+
27+
.tutorial,
28+
.tutorial:visited,
29+
.tutorial:hover
30+
{
31+
/* text-decoration: underline; */
32+
font-weight: bold;
33+
padding: 2px 5px;
34+
white-space: nowrap;
35+
max-width: 100%;
36+
background: #EF3270; /* color from the tail of the scampy */
37+
border: solid 1px #EF3270;
38+
border-radius: .25rem;
39+
font-size: 75%;
40+
/* font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace; */
41+
/*color: #404040;*/
42+
overflow-x: auto;
43+
box-sizing: border-box;
44+
}
45+
46+
47+
/* Formatting of RTD markup: rubrics and sidebars and admonitions */
48+
49+
/* rubric */
50+
.rst-content p.rubric {
51+
margin-bottom: 6px;
52+
font-weight: normal;
53+
}
54+
.rst-content p.rubric::after { content: ":" }
55+
56+
/* sidebar */
57+
.rst-content .sidebar {
58+
/* margin: 0px 0px 0px 12px; */
59+
padding-bottom: 0px;
60+
}
61+
.rst-content .sidebar p {
62+
margin-bottom: 12px;
63+
}
64+
.rst-content .sidebar p,
65+
.rst-content .sidebar ul,
66+
.rst-content .sidebar dl {
67+
font-size: 13px;
68+
}
69+
70+
/* less space after bullet lists in admonitions like warnings and notes */
71+
.rst-content .section .admonition ul {
72+
margin-bottom: 6px;
73+
}
74+
75+
76+
/* Code: literals and links */
77+
78+
.rst-content tt.literal,
79+
.rst-content code.literal {
80+
color: #404040;
81+
}
82+
/* slim font weight for non-link code */
83+
.rst-content tt:not(.xref),
84+
.rst-content code:not(.xref),
85+
.rst-content *:not(a) > tt.xref,
86+
.rst-content *:not(a) > code.xref,
87+
.rst-content dl:not(.docutils) code
88+
{
89+
font-weight: normal;
90+
}
91+
.rst-content a > tt.xref,
92+
.rst-content a > code.xref,
93+
.rst-content dl:not(.docutils) a > tt.xref,
94+
.rst-content dl:not(.docutils) a > code.xref
95+
{
96+
font-weight: bold; /* underline looks clumsy, in particular with buttons and
97+
other hyperlinks, which don't come with underlines */
98+
}
99+
100+
101+
/* Just one box for annotation code for a less noisy look */
102+
103+
.rst-content .annotation {
104+
padding: 2px 5px;
105+
background-color: white;
106+
border: 1px solid #e1e4e5;
107+
}
108+
.rst-content .annotation tt,
109+
.rst-content .annotation code {
110+
padding: 0 0;
111+
background-color: transparent;
112+
border: 0 solid transparent;
113+
}
114+
115+
116+
/* Parameter lists */
117+
118+
/* Mimick rubric style used for other headings */
119+
/* TODO: once scanpydoc adds classes, also change return types like this */
120+
.rst-content dl:not(.docutils) dl > dt {
121+
font-weight: bold;
122+
background: none transparent;
123+
border-left: none;
124+
margin: 0 0 12px;
125+
padding: 3px 0 0;
126+
font-size: 111.11%;
127+
}
128+
/* Parameters contain <strong> parts and don’t need bold font */
129+
.rst-content dl.field-list dl > dt { font-weight: unset }
130+
/* Add colon between return tuple element name and type */
131+
.rst-content dl:not(.docutils) dl > dt .classifier::before { content: ' : ' }
132+
133+
/* Function headers */
134+
135+
.rst-content dl:not(.docutils) dt {
136+
background: #edf0f2;
137+
color: #404040;
138+
border-top: solid 3px #343131;
139+
}
140+

docs/_static/theme_override.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* border in tutorial boxes */
2+
.sphx-glr-thumbcontainer {
3+
border-color: #E8E3E3 !important;
4+
}
5+
6+
7+
/* Blue background of width of the block (instead of width of content) */
8+
dl.class > dt:first-of-type {
9+
display: block !important;
10+
}
11+
12+
.xref.py.py-class,
13+
.xref.py.py-data,
14+
.xref.py.py-obj
15+
{
16+
background-color: #f0f0f0;
17+
}
18+
19+
/* ReadTheDocs top left panel color */
20+
21+
.wy-nav-top { background-color: #f07e44 }
22+
23+
/* extend page width*/
24+
.wy-nav-content {
25+
max-width: 1200px;
26+
}
27+
28+
/* left search nav*/
29+
.wy-side-nav-search { background-color: transparent }
30+
.wy-side-nav-search input[type="text"] { border-width: 0 }

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"sphinx.ext.viewcode",
4141
"sphinx_autodoc_typehints",
4242
"jupyter_sphinx",
43+
"sphinx_rtd_theme",
4344
"sphinx_gallery.load_style",
4445
]
4546

@@ -60,7 +61,7 @@
6061
# The theme to use for HTML and HTML Help pages. See the documentation for
6162
# a list of builtin themes.
6263

63-
html_theme = "pydata_sphinx_theme"
64+
html_theme = "sphinx_rtd_theme"
6465

6566
# The suffix of source filenames.
6667
source_suffix = ".rst"
@@ -69,7 +70,7 @@
6970
# relative to this directory. They are copied after the builtin static files,
7071
# so a file named "default.css" will overwrite the builtin "default.css".
7172
html_static_path = ["_static"]
72-
html_css_files = ["style.css"]
73+
html_css_files = ["style.css", "theme_override.css"]
7374

7475
nbsphinx_thumbnails = {
7576
"tutorials/qlstm_tagger": "_static/thumbnail/qlstm.png",
File renamed without changes.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Table of Contents
2222
:maxdepth: 1
2323
:caption: Contents:
2424

25-
Getting Started <readme>
25+
Getting Started <getting_started>
2626
Qlearnkit Module API <apidoc/qlearnkit>
2727
Tutorials <tutorials/index>
2828

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sphinxcontrib-serializinghtml==1.1.5
1818
sphinx-autodoc-typehints==1.14.0
1919
sphinx-gallery
2020
pandoc>=1.1.0
21-
pydata-sphinx-theme>=0.4.1
21+
sphinx-rtd-theme
2222
nbsphinx
2323
nbsphinx-link
2424
matplotlib>=3.3

0 commit comments

Comments
 (0)