diff --git a/.github/workflows/mkdocs_build.yml b/.github/workflows/mkdocs_build.yml new file mode 100644 index 0000000..c7d8fb5 --- /dev/null +++ b/.github/workflows/mkdocs_build.yml @@ -0,0 +1,26 @@ +name: Build docs + +on: + pull_request: + branches: main + + # Allows manual run from the Actions tab + workflow_dispatch: + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install packages + run: | + python3 -m pip install --upgrade pip + python3 -m pip install .[docs] + - name: Build static files + run: | + mkdocs build diff --git a/.github/workflows/mkdocs_deploy.yml b/.github/workflows/mkdocs_deploy.yml new file mode 100644 index 0000000..806400b --- /dev/null +++ b/.github/workflows/mkdocs_deploy.yml @@ -0,0 +1,48 @@ +name: Build docs and deploy to GH Pages + +on: + push: + branches: + - 'main' + paths: + - 'mkdocs.yml' + - 'docs/**' + + # Allows manual run from the Actions tab + workflow_dispatch: + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install packages + run: | + python3 -m pip install --upgrade pip + python3 -m pip install .[docs] + - name: Build static files + run: | + mkdocs build -d site + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: site/ + + deploy-docs: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} # Not used + permissions: + id-token: write + pages: write + needs: build-docs + steps: + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 diff --git a/docs/bib.md b/docs/bib.md new file mode 100644 index 0000000..bbc22c7 --- /dev/null +++ b/docs/bib.md @@ -0,0 +1,5 @@ +[emodpy]: https://docs.idmod.org/projects/emodpy/en/latest/index.html +[idmtools]: https://docs.idmod.org/projects/idmtools/en/latest/index.html +[emod-generic]: https://docs.idmod.org/projects/emod-generic/en/latest/parameter-overview.html +[idmod]: https://www.idmod.org/ +[idm_pypi]: https://packages.idmod.org/ diff --git a/docs/customization/css/extra.css b/docs/customization/css/extra.css new file mode 100644 index 0000000..3aa49bc --- /dev/null +++ b/docs/customization/css/extra.css @@ -0,0 +1,6 @@ +div.md-copyright__highlight +{ + display: flex; + flex-direction: row; + gap: 2em; +} \ No newline at end of file diff --git a/docs/customization/javascripts/mathjax.js b/docs/customization/javascripts/mathjax.js new file mode 100644 index 0000000..f0d0ad5 --- /dev/null +++ b/docs/customization/javascripts/mathjax.js @@ -0,0 +1,19 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; + +document$.subscribe(() => { + MathJax.startup.output.clearCache() + MathJax.typesetClear() + MathJax.texReset() + MathJax.typesetPromise() +}) \ No newline at end of file diff --git a/docs/customization/overrides/partials/copyright.html b/docs/customization/overrides/partials/copyright.html new file mode 100644 index 0000000..bd0b005 --- /dev/null +++ b/docs/customization/overrides/partials/copyright.html @@ -0,0 +1,19 @@ +{# base partial from: +github.com/squidfunk/mkdocs-material/material/templates/partials/copyright.html +#} + \ No newline at end of file diff --git a/docs/images/EMOD_logo.png b/docs/images/EMOD_logo.png new file mode 100644 index 0000000..cd04024 Binary files /dev/null and b/docs/images/EMOD_logo.png differ diff --git a/docs/images/IDM_white.png b/docs/images/IDM_white.png new file mode 100644 index 0000000..ee5e454 Binary files /dev/null and b/docs/images/IDM_white.png differ diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000..07607be Binary files /dev/null and b/docs/images/favicon.ico differ diff --git a/docs/images/idm-logo-transparent.png b/docs/images/idm-logo-transparent.png new file mode 100644 index 0000000..d461df7 Binary files /dev/null and b/docs/images/idm-logo-transparent.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..92d652d --- /dev/null +++ b/docs/index.md @@ -0,0 +1,11 @@ +--- +title: Home +--- + +# Welcome to EMOD-Hub + +Homepage for documentation. + +{% + include-markdown "bib.md" +%} diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..27fb432 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,100 @@ +site_name: EMOD-Hub Documentation +site_url: https://emod-hub.github.io/ +repo_name: EMOD-Hub/emod-hub.github.io +repo_url: https://github.com/EMOD-Hub/emod-hub.github.io + +theme: + name: material + custom_dir: docs/customization/overrides + font: + text: Roboto + code: Roboto Mono + logo: images/EMOD_logo.png + favicon: images/favicon.ico + features: + - navigation.footer + - content.code.copy + palette: + - scheme: default + toggle: + icon: material/weather-night + name: Light mode + primary: white + accent: light blue + - scheme: slate + toggle: + icon: material/weather-sunny + name: Dark mode + primary: black + accent: light blue + +nav: + - Home: index.md + - Related Projects: + - emodpy: https://docs.idmod.org/projects/emodpy/ + - EMOD-Generic: https://docs.idmod.org/projects/emod-generic + - idmtools: https://docs.idmod.org/projects/idmtools/ + +plugins: + - search: + - autorefs: + - include-markdown: + - glightbox: + - mkdocstrings: + +markdown_extensions: + - def_list: + - pymdownx.caret: + - pymdownx.mark: + - pymdownx.tilde: + - pymdownx.snippets: + - pymdownx.blocks.details: + - pymdownx.highlight: + linenums: true + default_lang: 'python' + +copyright: Copyright © 2025 Gates Foundation. All rights reserved. + +extra_javascript: + - customization/javascripts/mathjax.js + - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js + +extra_css: + - customization/css/extra.css + +extra: + generator: false # Removes acknowledgement of mkdocs-material + footer_links: + - text: "Privacy and Cookies Notice" + href: "https://www.gatesfoundation.org/Privacy-and-Cookies-Notice" + - text: "Terms of Use" + href: "https://www.gatesfoundation.org/Terms-of-Use" + social: + - icon: fontawesome/brands/github + link: https://github.com/EMOD-Hub/emod-api + - icon: fontawesome/regular/envelope + link: mailto:idm@gatesfoundation.org + - icon: octicons/globe-24 + link: https://idmod.org + - icon: simple/youtube + link: http://www.youtube.com/@institutefordiseasemodelin1987 + - icon: fontawesome/brands/linkedin + link: https://linkedin.com/company/institute-disease-modeling + - icon: fontawesome/brands/slack + link: https://gatesfoundation.enterprise.slack.com/ + analytics: + feedback: + title: Was this page helpful? + ratings: + - icon: material/emoticon-happy-outline + name: This page was helpful + data: 1 + note: >- + Thanks for your feedback! If you like, provide additional information by + using our feedback form. + - icon: material/emoticon-sad-outline + name: This page could be improved + data: 0 + note: >- + Thanks for your feedback! Help us improve this page by + using our feedback form. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d3453a0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "emod-hub.github.io" +version = "0.1.0" +description = "Documentation home for EMOD-Hub" +readme = "README.md" +requires-python = ">=3.9" +authors = [ + {name = "Sharon Chen", email = "sharon.chen@gatesfoundation.org"}, + {name = "Zhaowei Du", email = "zhaowei.du@gatesfoundation.org"}, + {name = "Clark Kirkman IV", email = "clark.kirkmand@gatesfoundation.org"}, + {name = "Daniel Bridenbecker", email = "daniel.bridenbecker@gatesfoundation.org"}, + {name = "Svetlana Titova", email = "svetlana.titova@gatesfoundation.org"}, + {name = "Ye Chen", email = "ye.chen@gatesfoundation.org"}, +] +keywords = ['modeling', 'IDM'] +dependencies = [ +] +license = "MIT" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + "Framework :: IDM-Tools :: models", +] + +[project.optional-dependencies] +docs = [ + "mkdocs-material", + "mkdocs-include-markdown-plugin", + "mkdocstrings-python", + "mkdocs-autoapi", + "mkdocs-glightbox", +] +test = [ +] +packaging = [ +] + +[project.urls] +Repository="https://github.com/EMOD-Hub/emod-hub.github.io" +Issues="https://github.com/EMOD-Hub/emod-hub.github.io/issues"