Skip to content

PlasmaControl/GroupWebsite

Repository files navigation

GroupWebsite

This repository contains the source code of the Plasma Control Group's website.

How it works?

It uses MkDocs with the MkDocs-Material theme. MkDocs is a Python package. It takes the website's content (src) and returns it as HTML, CSS, and JavaScript files, which are then deployed to Princeton University's servers.

Whenever something is pushed to the main branch, the website is rebuilt (i.e., HTML, CSS, and JavaScript files are generated using MkDocs) and deployed to Princeton Univerisity's servers with the workflow recipe defined in .github/workflows/deploy.yaml.

The content is written with Markdown syntax, and on top of that, it supports various features such as

  • References with BibteX
  • Auto-numbered L A T E X equations
  • Diagrams written with Mermaid
  • Cross-referencing
  • Figures with captions
  • Many more.

Therefore, updating the content of the website is very easy.

Updating the website

There are two ways of updating the website:

  • Creating a pull request
  • Using the backend app. It is only for updating the "Members" and "Publications" pages.

Creating a pull request

To get started, follow the steps below:

  1. Install Hatch. The installation guide for Hatch can be found here.

    Hatch is a Python project manager. It mainly allows you to define the virtual environments you need in pyproject.toml. Then, it takes care of the rest. Also, you don't need to install Python. Hatch will install it when you follow the steps below.

  2. Fork the repository and clone it with the following command.

    git clone https://github.com/YOURUSERNAME/GroupWebsite.git
    
  3. Go to the GroupWebsite directory.

    cd GroupWebsite
    
  4. Start using one of the virtual environments by activating it in the terminal.

    Default development environment with Python 3.13:

    hatch shell
  5. Finally, activate the virtual environment in your integrated development environment (IDE). In Visual Studio Code:

    • Press Ctrl+Shift+P.
    • Type Python: Select Interpreter.
    • Select the virtual environment created by Hatch.
  6. Run the following command.

    hatch run serve
    
  7. Then, go to http://127.0.0.1:8000 and see your changes in real time. You can now start working on the website.

Adding or editing a new page

All the files with md extensions are the pages. Create new ones or edit the existing ones. To add a new page to the navigation, see the mkdocs.yaml file.

Features

To use inline L A T E X equations:

This is an inline equation $\frac{3}{4}$.

To use block L A T E X equations:

$$
\int_1^2 x^2 dx=\frac{x^3}{3}\Big|_{x=1}^{x=2}
$$

To auto-number the equations:

$$
\begin{equation}
\int_1^2 x^2 dx=\frac{x^3}{3}\Big|_{x=1}^{x=2}
\end{equation}
$$

To cross-reference the equations:

See [Equation 1](#eq:my_label).

$$
\begin{equation}
\int_1^2 x^2 dx=\frac{x^3}{3}\Big|_{x=1}^{x=2}
\end{equation}
$$
{ #eq:my_label }

To see all the available L A T E X commands, see here.

To add a figure without a caption:

![](assets/images/group_photo.jpg){ #group-photo }

To add a figure with a caption:

![This is the caption.](assets/images/group_photo.jpg)

To cross-reference the figures:

See [](#fig:my_label).

![This is the caption.](assets/images/group_photo.jpg){ #fig:my_label }

To use Mermaid diagrams:

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

To cite a reference:

See [@my_reference].

and add the reference to the references.bib file.

Updating the "Members" page

The "Members" page is created automatically from the members.yaml file. CVs and photos are stored in the cvs and photos folders next to the members.yaml file.

Updating the "Publications" page

The "Publications" page is created automatically from the publications.yaml file. All the PDFs are stored in the pdfsfolder next to the publications.yaml file.