generated from VectorInstitute/aieng-template
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup our docs and host to github pages [CU-868byp419] #313
Merged
nerdai
merged 23 commits into
main
from
CU-868byp419_Initial-setup-for-docs_Val-Andrei-Fajardo
Jan 28, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
37b4a90
initial docs folder
nerdai 2520fd2
rm docs contents
nerdai 8d1e538
add docs deps group
nerdai c111ec3
build
nerdai 7421d4d
lock
nerdai 3625a7d
add some new section placeholders
nerdai 5b092e3
workflows
nerdai 43b1921
but actually this time the workflows
nerdai c93a4bd
rm tests
nerdai d5f2c15
add deploy to buid workflow for nwo
nerdai 66d5111
add sphinx-autobuild and serve in makefile
nerdai 9e0f723
DOCS README
nerdai 8015104
README
nerdai 5699d23
rm publish docs in build workflow
nerdai ef64a2c
moving day
nerdai 70d2c86
add section for examples
nerdai 692e683
initial quickstart
nerdai 3bff348
forceful add of missing static assets
nerdai 0cf80e3
cr
nerdai a83105a
cr
nerdai 2d52070
cr
nerdai e666bf1
cr - rm checkpointers
nerdai 6ea4f66
Shortening the quickstart code a bit to the minimum necessary components
emersodb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: docs (build) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- .pre-commit-config.yaml | ||
- .github/workflows/docs_build.yml | ||
- '**.py' | ||
- '**.ipynb' | ||
- '**.js' | ||
- '**.html' | ||
- poetry.lock | ||
- pyproject.toml | ||
- '**.rst' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Install dependencies and build docs | ||
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- run: | | ||
python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
poetry env use '3.10' | ||
source $(poetry env info --path)/bin/activate | ||
poetry install --with docs,test | ||
cd docs && rm -rf source/reference/api/_autosummary && make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .pre-commit-config.yaml | ||
- .github/workflows/code_checks.yml | ||
- .github/workflows/docs_build.yml | ||
- .github/workflows/docs_deploy.yml | ||
- .github/workflows/integration_tests.yml | ||
- '**.py' | ||
- '**.ipynb' | ||
- '**.html' | ||
- '**.js' | ||
- poetry.lock | ||
- pyproject.toml | ||
- '**.rst' | ||
- '**.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: 'true' | ||
- name: Install dependencies and build docs | ||
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- name: Build Docs | ||
run: | | ||
python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
poetry env use '3.10' | ||
source $(poetry env info --path)/bin/activate | ||
poetry install --with docs,test | ||
cd docs && rm -rf source/reference/api/_autosummary && make html | ||
- name: Deploy to Github pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: github_pages | ||
folder: docs/build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
# NOTE: This is not generated from `sphinx-quickstart` and manually added | ||
serve: | ||
sphinx-autobuild $(SOURCEDIR) $(BUILDDIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Documentation | ||
|
||
This section of the repository contains source artifacts for building the docs | ||
for `fl4health`. | ||
|
||
What follow's next in this README is a guide for those who are interested in | ||
building and serving the docs locally. You may be interested to do so if you are | ||
contributing to `fl4health` and need to make appropriate changes to the | ||
documentation. | ||
|
||
## Build Docs | ||
|
||
In order to build the docs, go into the `docs` directory and run the command | ||
below: | ||
|
||
```sh | ||
cd docs/ | ||
make serve | ||
``` | ||
|
||
The above command will build the docs as well as serve them locally, watching | ||
for changes and presenting them in real-time, which is great for development! | ||
|
||
Building the docs will take a couple of minutes, but once completed they will be | ||
served on `http://127.0.0.1:8000`. Enter this address in your browser of choice | ||
to see the docs. | ||
|
||
> [!NOTE] | ||
> We use sphinx to build our docs and api reference. Adjustments to style and | ||
> and additional extensions are done via the appropriate modifications in | ||
> `docs/source/conf.py`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
requirejs.config({ | ||
paths: { | ||
base: '/static/base', | ||
plotly: 'https://cdn.plot.ly/plotly-2.30.0.min.js?noext', | ||
}, | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<!doctype html> | ||
<html class="no-js"{% if language is not none %} lang="{{ language }}"{% endif %}> | ||
<head> | ||
{%- block site_meta -%} | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"/> | ||
<meta name="color-scheme" content="light dark"> | ||
<meta name="google-site-verification" content="i0qQRaR9OA3tSz_9tDocdcXGY27Ox_cy4FrvTHD2C_0" /> | ||
|
||
{%- if metatags %}{{ metatags }}{% endif -%} | ||
|
||
{# Make sure all pages have a description or Bing does not like us #} | ||
{% if 'name="description"' not in metatags %} | ||
<meta name="description" content="aieng-template Python API documentation"> | ||
{% endif %} | ||
|
||
{%- block linktags %} | ||
{%- if hasdoc('about') -%} | ||
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> | ||
{%- endif -%} | ||
{%- if hasdoc('genindex') -%} | ||
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> | ||
{%- endif -%} | ||
{%- if hasdoc('search') -%} | ||
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> | ||
{%- endif -%} | ||
{%- if hasdoc('copyright') -%} | ||
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> | ||
{%- endif -%} | ||
{%- if next -%} | ||
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> | ||
{%- endif -%} | ||
{%- if prev -%} | ||
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> | ||
{%- endif -%} | ||
{#- rel="canonical" (set by html_baseurl) -#} | ||
{%- if pageurl %} | ||
<link rel="canonical" href="{{ pageurl|e }}" /> | ||
{%- endif %} | ||
{%- endblock linktags %} | ||
|
||
{# Favicon #} | ||
{%- if favicon_url -%} | ||
<link rel="shortcut icon" href="{{ favicon_url }}"/> | ||
{%- endif -%} | ||
|
||
{#- Generator banner -#} | ||
<meta name="generator" content="sphinx-{{ sphinx_version }}, furo {{ furo_version }}"/> | ||
|
||
{# Bing webmasters meta tag #} | ||
<meta name="msvalidate.01" content="8D2A5032F006424CAF54C0DDCD16F666" /> | ||
|
||
{%- endblock site_meta -%} | ||
|
||
{#- Site title -#} | ||
{%- block htmltitle -%} | ||
{# See Sphinx monkey patch in conf.py #} | ||
{% if 'title' in metas %} | ||
<title>{{ metas.title }}</title> | ||
{% elif not docstitle %} | ||
<title>{{ title|striptags|e }}</title> | ||
{% elif pagename == master_doc %} | ||
<title>{{ docstitle|striptags|e }}</title> | ||
{% else %} | ||
<title>{{ title|striptags|e }} - {{ docstitle|striptags|e }}</title> | ||
{% endif %} | ||
{%- endblock -%} | ||
|
||
{%- block styles -%} | ||
|
||
{# Custom stylesheets #} | ||
{%- block regular_styles -%} | ||
{%- for css in css_files -%} | ||
{% if css|attr("filename") -%} | ||
{{ css_tag(css) }} | ||
{%- else -%} | ||
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" /> | ||
{%- endif %} | ||
{% endfor -%} | ||
{%- endblock regular_styles -%} | ||
|
||
{#- Theme-related stylesheets -#} | ||
{%- block theme_styles %} | ||
{% include "partials/_head_css_variables.html" with context %} | ||
{%- endblock -%} | ||
|
||
{%- block extra_styles %} | ||
{%- endblock -%} | ||
|
||
{%- endblock styles -%} | ||
|
||
{#- Custom front matter #} | ||
{%- block extrahead -%}{%- endblock -%} | ||
|
||
{# Custom JS #} | ||
{%- block regular_scripts -%} | ||
{% for path in script_files -%} | ||
{{ js_tag(path) }} | ||
{% endfor -%} | ||
{%- endblock regular_scripts -%} | ||
|
||
{# Theme-related JavaScript code #} | ||
{%- block theme_scripts -%} | ||
{%- endblock -%} | ||
|
||
{# Footer icons #} | ||
<script src="https://kit.fontawesome.com/2c1f516901.js" crossorigin="anonymous"></script> | ||
|
||
</head> | ||
<body> | ||
{% block body %} | ||
<script> | ||
document.body.dataset.theme = localStorage.getItem("theme") || "auto"; | ||
</script> | ||
{% endblock %} | ||
|
||
{%- block scripts -%} | ||
{%- endblock scripts -%} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{ fullname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: | ||
:special-members: __call__, __add__, __mul__ | ||
|
||
{% block methods %} | ||
{% if methods %} | ||
.. rubric:: {{ _('Methods') }} | ||
|
||
.. autosummary:: | ||
:nosignatures: | ||
{% for item in methods %} | ||
{%- if not item.startswith('_') %} | ||
~{{ name }}.{{ item }} | ||
{%- endif -%} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: {{ _('Attributes') }} | ||
|
||
.. autosummary:: | ||
{% for item in attributes %} | ||
~{{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bash is so easy to read 😂