Skip to content

Commit

Permalink
Merge pull request #15 from ioannis-vm/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
zsarnoczay authored Dec 5, 2024
2 parents f4ac852 + e9e3c3e commit 6d7505f
Show file tree
Hide file tree
Showing 21 changed files with 3,025 additions and 1,827 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and deploy documentation
on:
push:
branches:
- docs
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
python -m pip install -r requirements.txt
- name: Compute cache key
id: compute-cache-key
run: |
cd doc/source/_extensions
key=$(python compute_global_hash.py)
cd ../../../
echo "key=$key" >> $GITHUB_OUTPUT
- name: Restore cache
uses: actions/cache@v3
with:
path: doc/cache
key: ${{ steps.compute-cache-key.outputs.key }}

- name: Build docs
run: cd doc && make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/build/html
File renamed without changes.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/data_sources/HAZUS_MH_4.2_HU/output/
/data_sources/HAZUS_MH_4.2_HU/session.dill
/doc/build/
*.pyc
/.ropeproject/
/doc/cache/
/doc/source/dl_doc/
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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)
35 changes: 35 additions & 0 deletions doc/make.bat
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
7 changes: 7 additions & 0 deletions doc/source/_extensions/compute_global_hash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from generate_dl_doc import generate_md5, combine_md5_hashes
from pathlib import Path

resource_folder = Path('../../../')
dlmls = resource_folder.rglob('*.csv')
hashes = [generate_md5(dlml) for dlml in dlmls]
print(combine_md5_hashes(hashes))
Loading

0 comments on commit 6d7505f

Please sign in to comment.