Skip to content

Commit 3c46258

Browse files
authored
Add docs (#37)
1 parent ad7de05 commit 3c46258

Some content is hidden

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

75 files changed

+3013
-1087
lines changed

.github/workflows/docs_build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: docs (build)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- .pre-commit-config.yaml
9+
- .github/workflows/docs_build.yml
10+
- '**.py'
11+
- '**.ipynb'
12+
- '**.js'
13+
- '**.html'
14+
- poetry.lock
15+
- pyproject.toml
16+
- '**.rst'
17+
- '**.md'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4.2.2
24+
- name: Install dependencies, build docs and coverage report
25+
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
26+
- uses: actions/setup-python@v5.3.0
27+
with:
28+
python-version: '3.10'
29+
cache: 'poetry'
30+
- run: |
31+
python3 -m pip install --upgrade pip && python3 -m pip install poetry
32+
poetry env use '3.10'
33+
source $(poetry env info --path)/bin/activate
34+
poetry install --with docs,test
35+
cd docs && rm -rf source/reference/api && make html

.github/workflows/docs_deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .pre-commit-config.yaml
9+
- .github/workflows/code_checks.yml
10+
- .github/workflows/docs_build.yml
11+
- .github/workflows/docs_deploy.yml
12+
- .github/workflows/integration_tests.yml
13+
- '**.py'
14+
- '**.ipynb'
15+
- '**.html'
16+
- '**.js'
17+
- poetry.lock
18+
- pyproject.toml
19+
- '**.rst'
20+
- '**.md'
21+
22+
jobs:
23+
deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4.2.2
27+
with:
28+
submodules: 'true'
29+
- name: Install dependencies, build docs and coverage report
30+
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
31+
- uses: actions/setup-python@v5.3.0
32+
with:
33+
python-version: '3.10'
34+
cache: 'poetry'
35+
- run: |
36+
python3 -m pip install --upgrade pip && python3 -m pip install poetry
37+
poetry env use '3.10'
38+
source $(poetry env info --path)/bin/activate
39+
poetry install --with docs,test
40+
cd docs && rm -rf source/reference/api && make html
41+
- name: Deploy to Github pages
42+
uses: JamesIves/github-pages-deploy-action@v4.7.2
43+
with:
44+
branch: github_pages
45+
folder: docs/build/html

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ coverage.xml
5656
*.pot
5757

5858
# Sphinx documentation
59-
docs/_build/
59+
docs/build/
60+
docs/source/reference/api/
6061

6162
# PyBuilder
6263
target/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ One can add a path to `hydra.searchpath` either as a package (`pkg://path.to.con
108108
`path/to/config/directory/__init__.py` which is only interpreted when the config directory is added as a package.
109109
Hence, please refrain from using the `file://` notation.
110110

111-
Hydra also allows for overriding configurations parameters from the command line. To see the available options and other information, run:
111+
Hydra also allows for overriding configuration parameters from the command line. To see the available options and other information, run:
112112
```bash
113113
mmlearn_run 'hydra.searchpath=[pkg://path.to.config.directory]' +experiment=<name_of_experiment_yaml_file> --help
114114
```

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/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+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
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/custom.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
requirejs.config({
2+
paths: {
3+
base: '/static/base',
4+
plotly: 'https://cdn.plot.ly/plotly-2.30.0.min.js?noext',
5+
},
6+
});
94.3 KB
Loading

docs/source/_static/require.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/_templates/base.html

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<!doctype html>
2+
<html class="no-js"{% if language is not none %} lang="{{ language }}"{% endif %}>
3+
<head>
4+
{%- block site_meta -%}
5+
<meta charset="utf-8"/>
6+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
7+
<meta name="color-scheme" content="light dark">
8+
<meta name="google-site-verification" content="i0qQRaR9OA3tSz_9tDocdcXGY27Ox_cy4FrvTHD2C_0" />
9+
10+
{%- if metatags %}{{ metatags }}{% endif -%}
11+
12+
{# Make sure all pages have a description or Bing does not like us #}
13+
{% if 'name="description"' not in metatags %}
14+
<meta name="description" content="mmlearn Python API documentation">
15+
{% endif %}
16+
17+
{%- block linktags %}
18+
{%- if hasdoc('about') -%}
19+
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
20+
{%- endif -%}
21+
{%- if hasdoc('genindex') -%}
22+
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
23+
{%- endif -%}
24+
{%- if hasdoc('search') -%}
25+
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
26+
{%- endif -%}
27+
{%- if hasdoc('copyright') -%}
28+
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
29+
{%- endif -%}
30+
{%- if next -%}
31+
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
32+
{%- endif -%}
33+
{%- if prev -%}
34+
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
35+
{%- endif -%}
36+
{#- rel="canonical" (set by html_baseurl) -#}
37+
{%- if pageurl %}
38+
<link rel="canonical" href="{{ pageurl|e }}" />
39+
{%- endif %}
40+
{%- endblock linktags %}
41+
42+
{# Favicon #}
43+
{%- if favicon_url -%}
44+
<link rel="shortcut icon" href="{{ favicon_url }}"/>
45+
{%- endif -%}
46+
47+
{#- Generator banner -#}
48+
<meta name="generator" content="sphinx-{{ sphinx_version }}, furo {{ furo_version }}"/>
49+
50+
{# Bing webmasters meta tag #}
51+
<meta name="msvalidate.01" content="8D2A5032F006424CAF54C0DDCD16F666" />
52+
53+
{%- endblock site_meta -%}
54+
55+
{#- Site title -#}
56+
{%- block htmltitle -%}
57+
{# See Sphinx monkey patch in conf.py #}
58+
{% if 'title' in metas %}
59+
<title>{{ metas.title }}</title>
60+
{% elif not docstitle %}
61+
<title>{{ title|striptags|e }}</title>
62+
{% elif pagename == master_doc %}
63+
<title>{{ docstitle|striptags|e }}</title>
64+
{% else %}
65+
<title>{{ title|striptags|e }} - {{ docstitle|striptags|e }}</title>
66+
{% endif %}
67+
{%- endblock -%}
68+
69+
{%- block styles -%}
70+
71+
{# Custom stylesheets #}
72+
{%- block regular_styles -%}
73+
{%- for css in css_files -%}
74+
{% if css|attr("filename") -%}
75+
{{ css_tag(css) }}
76+
{%- else -%}
77+
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
78+
{%- endif %}
79+
{% endfor -%}
80+
{%- endblock regular_styles -%}
81+
82+
{#- Theme-related stylesheets -#}
83+
{%- block theme_styles %}
84+
{% include "partials/_head_css_variables.html" with context %}
85+
{%- endblock -%}
86+
87+
{%- block extra_styles %}
88+
{%- endblock -%}
89+
90+
{%- endblock styles -%}
91+
92+
{#- Custom front matter #}
93+
{%- block extrahead -%}{%- endblock -%}
94+
95+
{# Custom JS #}
96+
{%- block regular_scripts -%}
97+
{% for path in script_files -%}
98+
{{ js_tag(path) }}
99+
{% endfor -%}
100+
{%- endblock regular_scripts -%}
101+
102+
{# Theme-related JavaScript code #}
103+
{%- block theme_scripts -%}
104+
{%- endblock -%}
105+
106+
{# Footer icons #}
107+
<script src="https://kit.fontawesome.com/2c1f516901.js" crossorigin="anonymous"></script>
108+
109+
</head>
110+
<body>
111+
{% block body %}
112+
<script>
113+
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
114+
</script>
115+
{% endblock %}
116+
117+
{%- block scripts -%}
118+
{%- endblock scripts -%}
119+
</body>
120+
</html>

0 commit comments

Comments
 (0)