microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e8acaefba35969bbca0ffae96452cd05b47aa621

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Guide/src/dev_guide/contrib/guide.md

92lines · modecode

1# Updating this Guide
2
3We gladly welcome PRs that improve the quality of the OpenVMM guide!
4
5The OpenVMM Guide is written in Markdown, and rendered to HTML using
6[mdbook](https://github.com/rust-lang/mdBook). You can find the source-code of
7this Guide in the main OpenVMM GitHub repo, in the
8[`Guide/`](https://github.com/microsoft/openvmm/tree/main/Guide) folder.
9
10## Guide conventions
11
12* Line Length: Wrap lines at 80 characters.
13
14## Editing the Guide
15
16### Small Changes
17
18For small changes, you can simply click the "Suggest an Edit" button in the
19top-right corner of any page to automatically open up a GitHub Edit page.
20
21### Medium Changes
22
23For medium changes, we suggest cloning the repo locally, and previewing changes
24to Markdown in your editor (Visual Studio Code has good support for this).
25
26### Large Changes
27
28For large changes, we suggest cloning the repo locally, and building a fully
29rendered copy of the Guide using `mdbook`.
30
31This is very useful when making changes that leverage mdbook preprocessors, such
32as using mermaid diagrams, or previewing admonishments.
33
34```admonish info
35For example, the `mdbook-admonish` preprocessor is what powers this nice looking
36"Info" box!
37```
38
39Building the Guide locally is quite straightforward:
40
411. Install `mdbook` and the additional preprocessors we use locally:
42
43```bash
44cargo install mdbook
45cargo install mdbook-admonish
46cargo install mdbook-mermaid
47```
48
492. Navigate into the `Guide/` directory, and run `mdbook`:
50
51```bash
52cd Guide/
53# must be run inside the `Guide/` directory!
54mdbook serve
55```
56
573. Navigate to the localhost URL in your web browser (typically
58`http://127.0.0.1:3000/`)
59
60### Troubleshooting
61
62#### Running `mdbook serve` outside the `Guide/` directory
63
64**Error:**
65
66```
672024-10-29 16:26:22 [INFO] (mdbook::book): Book building has started
68error: manifest path `./mdbook-openvmm-shim/Cargo.toml` does not exist
69```
70
71**Solution:**
72
73Ensure you have changed your working-directory to the `Guide/` folder (e.g: via
74`cd Guide/`), and then run `mdbook serve`.
75
76#### Rust is not installed
77
78**Error:**
79
80```
812024-10-29 16:35:49 [INFO] (mdbook::book): Book building has started
822024-10-29 16:35:49 [WARN] (mdbook::preprocess::cmd): The command wasn't found, is the "admonish" preprocessor installed?
832024-10-29 16:35:49 [WARN] (mdbook::preprocess::cmd): Command: cargo run --quiet --manifest-path ./mdbook-openvmm-shim/Cargo.toml mdbook-admonish
84```
85
86**Solution:**
87
88The OpenVMM Guide hooks into a custom Rust utility called `mdbook-openvmm-shim`,
89which must be compiled in order for `mdbook` to successfully build the OpenVMM
90guide.
91
92Please ensure you have [installed Rust](../getting_started/linux.md#installing-rust).
93