-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into development
- Loading branch information
Showing
35 changed files
with
13,329 additions
and
250 deletions.
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,52 @@ | ||
name: Publish documentation online | ||
|
||
# build the documentation whenever there are new commits on main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# Alternative: only build for tags. | ||
# tags: | ||
# - '*' | ||
|
||
# security: restrict permissions for CI jobs. | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Build the documentation and upload the static HTML files as an artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
# ADJUST THIS: install all dependencies (including pdoc) | ||
- run: python -m pip install --upgrade pip | ||
- run: python -m pip install pdoc | ||
- run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- run: python -m pip install scikit-learn==1.2.2 | ||
# ADJUST THIS: build your documentation into docs/. | ||
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here. | ||
- run: python docs/make.py | ||
|
||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/ | ||
|
||
# Deploy the artifact to GitHub pages. | ||
# This is a separate job so that only actions/deploy-pages has the necessary permissions. | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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,32 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
# python: | ||
# install: | ||
# - requirements: docs/requirements.txt |
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
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,7 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="refresh" content="0; url=./sslearn.html"/> | ||
</head> | ||
</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,62 @@ | ||
#!/usr/bin/env python3 | ||
from pathlib import Path | ||
import shutil | ||
import textwrap | ||
import base64 | ||
|
||
from jinja2 import Environment | ||
from jinja2 import FileSystemLoader | ||
from markupsafe import Markup | ||
import pygments.formatters.html | ||
import pygments.lexers.python | ||
|
||
import pdoc.render | ||
|
||
here = Path(__file__).parent.parent | ||
|
||
# Ignore set_score_request in the docs | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
favicon = (here / "docs" / "sslearn_mini.webp").read_bytes() | ||
favicon = base64.b64encode(favicon).decode("utf8") | ||
logo = (here / "docs" / "sslearn.webp").read_bytes() | ||
logo = base64.b64encode(logo).decode("utf8") | ||
|
||
# Render main docs | ||
pdoc.render.configure( | ||
|
||
favicon="data:image/webp;base64," + favicon, | ||
logo="data:image/webp;base64," + logo, | ||
logo_link="/sslearn", | ||
footer_text=f"pdoc {pdoc.__version__}", | ||
search=True, | ||
math=True, | ||
include_undocumented=False, | ||
docformat="numpy", | ||
) | ||
|
||
pdoc.pdoc( | ||
here / "sslearn", | ||
output_directory=here / "docs", | ||
) | ||
|
||
|
||
with (here / "sitemap.xml").open("w", newline="\n") as f: | ||
f.write( | ||
textwrap.dedent( | ||
""" | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> | ||
""" | ||
).strip() | ||
) | ||
for file in here.glob("**/*.html"): | ||
if file.name.startswith("_"): | ||
continue | ||
filename = str(file.relative_to(here).as_posix()).replace("index.html", "") | ||
f.write(f"""\n<url><loc>https://pdoc.dev/{filename}</loc></url>""") | ||
f.write("""\n</urlset>""") |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.