Skip to content

Commit 5080ff9

Browse files
authored
Merge pull request #157 from afshin/sphinx
Add Sphinx Documentation
2 parents e29f3c7 + 58ed89d commit 5080ff9

File tree

42 files changed

+933
-40
lines changed

Some content is hidden

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

42 files changed

+933
-40
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: yarn-cache-dir-path
2222
run: echo "::set-output name=dir::$(yarn cache dir)"
2323
- name: Cache yarn
24-
uses: actions/cache@v1
24+
uses: actions/cache@v2
2525
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
2626
with:
2727
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -52,5 +52,6 @@ jobs:
5252
yarn test
5353
5454
- name: Docs
55+
if: ${{ matrix.os == 'ubuntu-latest' }}
5556
run: |
5657
yarn docs

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ build
99
review/api/temp
1010
*.tsbuildinfo
1111

12+
# copied changelog file
13+
docs/source/changelog.md
14+
15+
# generated api files
16+
docs/api
17+
1218
# jetbrains ide stuff
1319
*.iml
1420
.idea/
@@ -17,4 +23,3 @@ review/api/temp
1723
*.code-workspace
1824
.history
1925
.vscode
20-

.readthedocs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 2
2+
sphinx:
3+
configuration: docs/source/conf.py
4+
conda:
5+
environment: docs/environment.yml

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)

docs/environment.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
name: lumino_documentation
3+
channels:
4+
- conda-forge
5+
dependencies:
6+
- python=3.8
7+
- sphinx>=1.8
8+
- sphinx-copybutton
9+
- sphinx_rtd_theme
10+
- pytest
11+
- pip
12+
- nodejs
13+
- pip:
14+
- jsx-lexer
15+
- pytest-check-links[cache]>=0.4.3
16+
- myst_parser
17+
- requests_cache

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/_static/css/custom.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
h4 {
2+
font-size: 100%;
3+
}
4+
5+
.wy-nav-side p.caption {
6+
color: #f5f5f5;
7+
}
8+
9+
div.wy-side-nav-search {
10+
background: #f37626;
11+
}
12+
13+
.wy-nav-content iframe {
14+
margin: auto;
15+
display: block;
16+
}
17+
18+
.wy-breadcrumbs-aside img {
19+
height: 1em !important;
20+
}
21+
22+
/* Elevation
23+
*
24+
* We style box-shadows using Material Design's idea of elevation. These particular numbers are taken from here:
25+
*
26+
* https://github.com/material-components/material-components-web
27+
* https://material-components-web.appspot.com/elevation.html
28+
*/
29+
30+
.rst-content img.jp-screenshot {
31+
border: none;
32+
/* MD Elevation 8 */
33+
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2),
34+
0px 8px 10px 1px rgba(145, 145, 145, 0.14),
35+
0px 3px 14px 2px rgba(0, 0, 0, 0.12);
36+
margin-bottom: 24px;
37+
}
38+
39+
/*
40+
* The div.jp-youtube-video styling is done to get the YouTube video to size dynamically
41+
* to 100% of the content width.
42+
*/
43+
44+
.rst-content div.jp-youtube-video {
45+
position: relative;
46+
width: 100%;
47+
height: 0px;
48+
/* This must be equal to the inverse of the aspect ratio of the video */
49+
/* The current value is: 56.25% = 315/560 */
50+
padding-bottom: 56.25%;
51+
border: none;
52+
/* MD Elevation 8 */
53+
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2),
54+
0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
55+
margin-bottom: 24px;
56+
}
57+
58+
.rst-content div.jp-youtube-video iframe {
59+
position: absolute;
60+
left: 0px;
61+
top: 0px;
62+
width: 100%;
63+
height: 100%;
64+
}

docs/source/_static/jupyter_logo.svg

Lines changed: 42 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{% extends '!breadcrumbs.html' %}
2+
3+
{% block breadcrumbs %}
4+
<li><a href="{{ pathto(master_doc) }}">{{ _('Docs') }}</a> &raquo;</li>
5+
{% for doc in parents %}
6+
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
7+
{% endfor %}
8+
<li>{{ title }}</li>
9+
{% endblock %}
10+
{% block breadcrumbs_aside %}
11+
<li class="wy-breadcrumbs-aside">
12+
{% if hasdoc(pagename) %}
13+
{% if display_github %}
14+
{% if check_meta and 'github_url' in meta %}
15+
<!-- User defined GitHub URL -->
16+
<a href="{{ meta['github_url'] }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
17+
{% else %}
18+
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
19+
{% endif %}
20+
{% elif display_bitbucket %}
21+
{% if check_meta and 'bitbucket_url' in meta %}
22+
<!-- User defined Bitbucket URL -->
23+
<a href="{{ meta['bitbucket_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
24+
{% else %}
25+
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ suffix }}?mode={{ theme_vcs_pageview_mode or "view" }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
26+
{% endif %}
27+
{% elif display_gitlab %}
28+
{% if check_meta and 'gitlab_url' in meta %}
29+
<!-- User defined GitLab URL -->
30+
<a href="{{ meta['gitlab_url'] }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
31+
{% else %}
32+
<a href="https://{{ gitlab_host|default("gitlab.com") }}/{{ gitlab_user }}/{{ gitlab_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ gitlab_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
33+
{% endif %}
34+
{% elif show_source and source_url_prefix %}
35+
<a href="{{ source_url_prefix }}{{ pagename }}{{ suffix }}">{{ _('View page source') }}</a>
36+
{% elif show_source and has_source and sourcename %}
37+
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> {{ _('View page source') }}</a>
38+
{% endif %}
39+
{% endif %}
40+
</li>
41+
<li class="wy-breadcrumbs-aside">
42+
<a href="https://jupyter.org/documentation">
43+
<img src="{{ pathto('_static/jupyter_logo.svg', 1) }}"></img>
44+
{{ _('Jupyter') }}
45+
</a>
46+
&vert;
47+
&nbsp;
48+
</li>
49+
{% endblock %}

docs/source/_templates/footer.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<footer>
2+
{% if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
3+
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
4+
{% if next %}
5+
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right"></span></a>
6+
{% endif %}
7+
{% if prev %}
8+
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> {{ _('Previous') }}</a>
9+
{% endif %}
10+
</div>
11+
{% endif %}
12+
13+
<hr/>
14+
15+
<div role="contentinfo">
16+
<p>
17+
{%- if show_copyright %}
18+
{%- if hasdoc('copyright') %}
19+
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
20+
{%- else %}
21+
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.<br/>
22+
The Jupyter Trademark is registered with the U.S. Patent &amp Trademark Office.
23+
{% endtrans %}
24+
{%- endif %}
25+
{%- endif %}
26+
27+
{%- if build_id and build_url %}
28+
{% trans build_url=build_url, build_id=build_id %}
29+
<span class="build">
30+
Build
31+
<a href="{{ build_url }}">{{ build_id }}</a>.
32+
</span>
33+
{% endtrans %}
34+
{%- elif commit %}
35+
{% trans commit=commit %}
36+
<span class="commit">
37+
Revision <code>{{ commit }}</code>.
38+
</span>
39+
{% endtrans %}
40+
{%- elif last_updated %}
41+
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
42+
{%- endif %}
43+
44+
</p>
45+
</div>
46+
47+
{%- if show_sphinx %}
48+
{% trans %}Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}.
49+
{%- endif %}
50+
51+
{%- block extrafooter %} {% endblock %}
52+
53+
</footer>
54+

docs/source/api.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Lumino API Reference
2+
========================
3+
4+
.. this doc exists as a resolvable link target
5+
.. which statically included files are not
6+
7+
.. meta::
8+
:http-equiv=refresh: 0;url=./api/index.html
9+
10+
The Lumino API reference docs are `here <./api/index.html>`_
11+
if you are not redirected automatically.

0 commit comments

Comments
 (0)