Skip to content

Commit 9cdab99

Browse files
authored
Docs upgrades (neuralmagic#43)
* add version.py and set setup.py and docs conf.py to exec that file in stead of requiring python path * fix docs for version.py * change docs for neural magic styling and enable versioning * add missing template and static files for docs
1 parent c632d15 commit 9cdab99

File tree

116 files changed

+1038
-64
lines changed

Some content is hidden

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

116 files changed

+1038
-64
lines changed

Makefile

+11-5
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ test:
3838

3939
# create docs
4040
docs:
41-
export SPARSEML_IGNORE_TFV1="True"; sphinx-apidoc -o "$(DOCDIR)/source/api" src/sparsify;
42-
export SPARSEML_IGNORE_TFV1="True"; cd $(DOCDIR) && $(MAKE) html && \
43-
cp -r source/userguide/images/ build/html/images/ && \
44-
cp -r source/userguide/images/ build/html/_images/ && \
45-
cp -r source/userguide/images/ build/html/userguide/images/;
41+
@echo "Running docs creation";
42+
export SPARSEML_IGNORE_TFV1="True"; \
43+
python utils/docs_builder.py --src $(DOCDIR) --dest $(DOCDIR)/build/html && \
44+
cp -r $(DOCDIR)/userguide/images/ $(DOCDIR)/build/html/images/ && \
45+
cp -r $(DOCDIR)/userguide/images/ $(DOCDIR)/build/html/_images/ && \
46+
cp -r $(DOCDIR)/userguide/images/ $(DOCDIR)/build/html/userguide/images/;
47+
48+
docsupdate:
49+
@echo "Runnning update to api docs";
50+
find $(DOCDIR)/api | grep .rst | xargs rm -rf;
51+
export SPARSEML_IGNORE_TFV1="True"; sphinx-apidoc -o "$(DOCDIR)/api" src/sparsify;
4652

4753
# creates wheel file
4854
build:

docs/Makefile

-20
This file was deleted.
+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
body,
2+
.wy-side-nav-search,
3+
.wy-nav-side,
4+
.wy-nav-content-wrap,
5+
.wy-nav-content,
6+
.wy-nav-shift {
7+
background: #ffffff;
8+
color: rgb(40, 68, 41);
9+
font-family: "Helvetica Neue";
10+
}
11+
12+
.wy-nav-content {
13+
max-width: 1280px;
14+
min-height: 100vh;
15+
border-left: solid 1px #000000;
16+
}
17+
18+
.highlight {
19+
background: #f5f5f5;
20+
}
21+
22+
a {
23+
color: #062EF5;
24+
font-family: "Helvetica Neue";
25+
}
26+
27+
a:visited {
28+
color: #062EF5;
29+
font-family: "Helvetica Neue";
30+
}
31+
32+
.wy-side-nav-search {
33+
margin: 0;
34+
}
35+
36+
#rtd-search-form {
37+
margin-left: 10px;
38+
margin-right: 10px;
39+
}
40+
41+
.wy-side-nav-search .wy-dropdown>a,
42+
.wy-side-nav-search>a {
43+
color: rgb(40, 68, 41);
44+
font-family: "Helvetica Neue";
45+
}
46+
47+
.rst-content .toctree-wrapper>p.caption, h1, h2, h3, h4, h5, h6, legend {
48+
color: rgb(40, 68, 41);
49+
font-family: "Helvetica Neue";
50+
}
51+
52+
.wy-side-nav-search .icon-home {
53+
display: flex;
54+
justify-content: center;
55+
flex-direction: row-reverse;
56+
align-items: center;
57+
font-size: 1.4rem;
58+
}
59+
60+
.wy-side-nav-search>a.icon img.logo {
61+
padding: 0;
62+
margin: 0 8px 0 0;
63+
width: 28px;
64+
}
65+
66+
.wy-side-nav-search .icon-home::before {
67+
content: "";
68+
}
69+
70+
.wy-side-nav-search>div.version {
71+
display: none;
72+
}
73+
74+
.wy-side-nav-search input[type=text] {
75+
border-radius: 4px;
76+
border: solid 1px #000000;
77+
box-shadow: none;
78+
font-family: "Helvetica Neue";
79+
}
80+
81+
.wy-menu-vertical {
82+
border-top: solid 1px #000000;
83+
margin-top: 10px;
84+
}
85+
86+
.wy-menu-vertical header,
87+
.wy-menu-vertical p.caption {
88+
color: #062EF5;
89+
font-family: "Helvetica Neue";
90+
}
91+
92+
.wy-menu-vertical a {
93+
color: rgb(40, 68, 41);
94+
font-family: "Helvetica Neue";
95+
}
96+
97+
.wy-menu-vertical a {
98+
background-color: #ffffff !important;
99+
}
100+
101+
.wy-menu-vertical a:hover {
102+
color: #f6f7fe !important;
103+
background-color: #062EF5 !important;
104+
}
105+
106+
.wy-menu-vertical li.toctree-l1.current>a {
107+
border-bottom: none;
108+
border-top: none;
109+
}
110+
111+
.rst-versions,
112+
.rst-versions .rst-current-version .fa-book,
113+
.rst-versions .rst-current-version .fa-caret-down,
114+
.rst-versions .rst-other-versions dt,
115+
.rst-versions .rst-other-versions dd {
116+
background: #ffffff;
117+
color: rgb(40, 68, 41);
118+
font-family: "Helvetica Neue";
119+
}
120+
121+
.rst-versions .rst-other-versions dd a {
122+
background: #ffffff;
123+
color: #062EF5;
124+
font-family: "Helvetica Neue";
125+
}
126+
127+
.rst-versions {
128+
border-top: solid 1px #000000;
129+
}
130+
131+
.rst-versions .rst-current-version {
132+
background: #ffffff;
133+
color: #062EF5;
134+
font-family: "Helvetica Neue";
135+
}
136+
137+
.btn, .btn.btn-neutral {
138+
background: #ffffff !important;
139+
color: #062EF5 !important;
140+
box-shadow: none;
141+
border: solid 1px #062EF5;
142+
border-radius: 4px;
143+
}
144+
145+
.btn .fa, .btn.btn-neutral .fa {
146+
color: #062EF5 !important;
147+
}
148+
149+
.btn:hover, .btn.btn-neutral:hover {
150+
background: #062EF5 !important;
151+
color: #f6f7fe !important;
152+
}
153+
154+
.btn:hover .fa, .btn.btn-neutral:hover .fa {
155+
color: #f6f7fe !important;
156+
}

docs/_templates/versions.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{%- if current_version %}
2+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
3+
<span class="rst-current-version" data-toggle="rst-current-version">
4+
<span class="fa fa-book"> Other Versions</span>
5+
v: {{ current_version.name }}
6+
<span class="fa fa-caret-down"></span>
7+
</span>
8+
<div class="rst-other-versions">
9+
{%- if versions.tags %}
10+
<dl>
11+
<dt>Tags</dt>
12+
{%- for item in versions.tags %}
13+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
14+
{%- endfor %}
15+
</dl>
16+
{%- endif %}
17+
{%- if versions.branches %}
18+
<dl>
19+
<dt>Branches</dt>
20+
{%- for item in versions.branches %}
21+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
22+
{%- endfor %}
23+
</dl>
24+
{%- endif %}
25+
</div>
26+
</div>
27+
{%- endif %}

docs/api/modules.rst

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
..
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
sparsify
17+
========
18+
19+
.. toctree::
20+
:maxdepth: 4
21+
22+
sparsify
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
..
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
sparsify.blueprints.code\_samples package
17+
=========================================
18+
19+
Submodules
20+
----------
21+
22+
sparsify.blueprints.code\_samples.pytorch\_\_integration module
23+
---------------------------------------------------------------
24+
25+
.. automodule:: sparsify.blueprints.code_samples.pytorch__integration
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
sparsify.blueprints.code\_samples.pytorch\_\_training module
31+
------------------------------------------------------------
32+
33+
.. automodule:: sparsify.blueprints.code_samples.pytorch__training
34+
:members:
35+
:undoc-members:
36+
:show-inheritance:
37+
38+
sparsify.blueprints.code\_samples.tensorflow\_\_integration module
39+
------------------------------------------------------------------
40+
41+
.. automodule:: sparsify.blueprints.code_samples.tensorflow__integration
42+
:members:
43+
:undoc-members:
44+
:show-inheritance:
45+
46+
Module contents
47+
---------------
48+
49+
.. automodule:: sparsify.blueprints.code_samples
50+
:members:
51+
:undoc-members:
52+
:show-inheritance:

0 commit comments

Comments
 (0)