hMRI-group / hMRI-toolbox-docs

Sources for the hMRI Toolbox website
https://hmri-group.github.io/hMRI-toolbox-docs/
1 stars 0 forks source link
hMRI Toolbox Banner

hMRI Toolbox Documentation Website

Build Deploy Site

This repository contains the sources for the (new) hMRI Toolbox website. This website is based on MkDocs with the mkdocs-material theme, and it is built and deployed automatically on every push or commit to the main branch using GitHub's actions.

Therefore, the normal workflow should be to create a branch from main when you work on adding or fixing content. Make a pull request, where you can then check if the site builds without errors before merging your changes. However, it's highly recommended to preview the site locally because it's faster and setting up the environment for preview is easy.

Editing and Building the Site Locally

The easiest way to edit the website is to preview your changes locally before making a commit. With MkDocs this is convenient because you only need a virtual Python environment with necessary packages to run the whole website preview.

Setup and Virtual Environment

MkDocs uses Python to build a static website from Markdown files. Therefore, ensure you have Python 3 and the venv package.

First, clone this repository and inside the repository directory, create a new environment by using

git clone git@github.com:hMRI-group/hMRI-toolbox-docs.git
cd hMRI-toolbox-docs
python3 -m venv venv

Activate the virtual environment with

source venv/bin/activate

Install all required packages

pip install -r requirements.txt

Next time, you only need to activate the virtual environment again.

Local Preview

After activating the Python environment, run from within the repository directory

mkdocs serve

This will serve the site on http://127.0.0.1:8000 and you can preview it in your browser.

Content and Formatting Tips

Todo