Skip to content

Commit

Permalink
Merge pull request #421 from DHI/quarto
Browse files Browse the repository at this point in the history
Use Quarto / Quartodoc for documentation
  • Loading branch information
ecomodeller authored Dec 13, 2024
2 parents 22e6c3c + 9a3d923 commit 6378708
Show file tree
Hide file tree
Showing 116 changed files with 10,685 additions and 4,841 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source .venv/bin/activate
28 changes: 0 additions & 28 deletions .github/workflows/build_docs.yml

This file was deleted.

33 changes: 21 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Documentation

on:
on:
push:
branches:
- main
branches: [ main]
pull_request:
branches: [ main]

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -18,14 +18,23 @@ jobs:
python-version: "3.11"

- name: Install modelskill
run: pip install .[dev]

- name: MkDocs
run: mkdocs build
run: |
pip install .[docs]
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
- name: Build documentation
run: |
make docs
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_site/

- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site

publish_dir: docs/_site/

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,8 @@ notebooks/sandbox.ipynb
streamlit_app.py
notes.md

notebooks/Untitled.ipynb
notebooks/Untitled.ipynb

docs/_site/
docs/_extensions/
docs/api/*.qmd
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ coverage:
pytest --cov-report html --cov=$(LIB) tests/

docs: FORCE
mkdocs build
set -e; \
cd docs; \
quartodoc build; \
quarto render; \
if [ ! -f _site/index.html ]; then \
echo "Error: index.html not found. Quarto render failed."; \
exit 1; \
fi; \
cd -

clean:
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .coverage
rm -rf dist
rm -rf docs/_site


FORCE:
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
_sidebar.yml
objects.json
7 changes: 7 additions & 0 deletions docs/_extensions/fontawesome/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Font Awesome support
author: Carlos Scheidegger
version: 1.1.0
quarto-required: ">=1.2.269"
contributes:
shortcodes:
- fontawesome.lua
Loading

0 comments on commit 6378708

Please sign in to comment.