Contributing
Installation guide
This website is hosted by Github pages and built by mkdocs
. Under the hood it
uses github action to build the static page to gh-pages
branch whenever a
new commit is found on the the master
branch. This is done by
.github/workflows/ci.yml
. In anycase if a deploy failed, please check the logs
of github action.
To contribute to the website, you need to install mkdocs
and
mkdocs-material
by following the instructions below:
Create and activate your virtual environment by:
1 2 |
|
Then install the following packages:
1 2 |
|
Now you are ready to clone the repository:
1 |
|
Finally, go to the repo dir and spawn the server using:
1 |
|
http://127.0.0.1:8000
.
Any change you make to the markdown files will be automatically updated in the
website so there's no need to re-do mkdocs server
.
Now it's time to edit the files. The syntax is shown in the next section.
When you are done editing the files. Save the changes and deploy the website by:
1 2 3 4 |
|
Before pushing the changes, make sure that you have the latest version of the
master
branch by:
1 |
|
Finally, push the changes to the remote repository by:
1 2 |
|
Writing guide
The following information is a shorter version of the official documentation of mkdocs-material. You can also find a similar one on our Group wiki.
- Standard Markdown Syntax:
1 2 3 4 5 6 7 8 |
|
-
Adding a Hyperlink:
1
[something](assets/test.in)
-
In-line code:
1
this is a `line`.
-
Code blocks:
1 2 3
```python import numpy as np ```
-
In-line math:
1
this is inline $\phi$ math
-
Math blocks:
1 2 3
$$ \psi = \sum_a \phi_a $$
-
Numbered list:
1 2
1. test 2. test
- test
- test
-
Dot list:
1 2
- something - something
- something
- something
-
Table:
1 2 3 4 5
| Method | Description | | ----------- | ------------------------------------ | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | | `DELETE` | :material-close: Delete resource |
Method Description GET
Fetch resource PUT
Update resource DELETE
Delete resource -
Admonition (the indentation level N of admonition is determined by N*four spaces):
1 2 3 4 5
!!! note "show up" something. ??? note "hide, click to show up" something
show up
something.
hide, click to show up
something
-
Code annotation:
1 2 3 4 5
```python some code #(1)! ``` 1. annotation
1
some code #(1)!
- annotation
-
Code highlight (highlight frist and second line):
1 2 3 4 5 6
```python hl_lines="1-2" some code some code highlighted some other code highlighted some code ```
1 2 3 4
some code some code highlighted some other code highlighted some code
-
Emojis (https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/?h=emoji)
1
:link:
-
Images:
-
Center aligned (different syntax due to technical issues):
1 2 3
<figure markdown="span"> ![Diamond primitive cell](assets/Iron_bands.png) </figure>
-
Right aligned:
1
![MO](https://dummyimage.com/600x400/){ align=right}
Some text.
-
Resize:
1
![Image title](https://dummyimage.com/600x400/){ width="300" }
-
PNG files are prefered when showing structures of a material. You can export PNG with transparent background using VESTA.