Homepage link: https://ustc-compiler-principles.github.io/2023
This README is a toturial of how to write and preview the docs.
First install dependencies and init:
# It's recommended to install in a virtual environment.
pip install -r requirements.txt
Then make your modifications. You can preview your changes by running:
# In python environment
mkdocs serve
In order to keep the doc style consistent, we use Prettier and AutoCorrect.
# you need Node.js installed first
npm install # then install Prettier and AutoCorrect
See Prettier Doc: Editor Integration and AutoCorrect: VS Code Extension for editor intergration.
You should format markdown files before commit:
# see .prettierignore for ignoring certain files or folders
npm run test # to see if there is a format error
npm run format # to format all files under docs/
mkdocs.yml
is the configuration file. When you want to add a new page, you need to add it to nav
in mkdocs.yml
.
docs/
is the directory of all Markdown files. You can create subdirectories to organize your files.
Read https://squidfunk.github.io/mkdocs-material/reference/admonitions/ for more details.
All texts are All Rights Reserved by default.