Commit d618a8d6 authored by Irene "Tissy" Pirrotta's avatar Irene "Tissy" Pirrotta
Browse files

New guide for compile and use mdBook for documentation.

parent 37410738
# Parrot New Documentation
### Compile locally mdBook for Parrot Documentation
New Parrot documentation using mdbook
First step: Create the working directory and clone locally the Documentation repo
## Why this?
`mkdir doc`
Maybe mdbook can be useful for the new Parrot documentation. It is lightweight, modern and written in Rust.
`git clone https://nest.parrotsec.org/org/community-team/misc.git `
## Installation
`cd misc`
Inside this branch there is already a compiled and optimized version of mdbook (16.9 mb), but if you want you can compile yourself mdbook https://github.com/Nutomic/mdBook/tree/localization
`git switch doc-assembled`
`cd mdbook`
Second step: Clone mdBook repo
`cargo build --release`
and the generated binary file will be on `./target/release` folder.
`cd ..`
## Build
`git clone https://github.com/Nutomic/mdBook.git`
Run `./mdbook serve` to build and deploy (and eventually rebuild it at each change) the book on http://localhost:3000
`cd mdBook`
Run `./mdbook clean` to delete the build directory (which the book is generated)
`git switch localization`
To allowing space in SUMMARY.md's link destination use <.md file>, for example:
` - [What is Parrot](<./01.- What is Parrot.md>) `
Third step: Compile mdBook
## Localization
Thanks to the mdbook fork by Ruin0x11 (and updated by Nutomic https://github.com/Nutomic/mdBook/tree/localization) it is possible to make the documentation multilanguage. To do this, you need to add `[language.key_lang]` to the book.toml file.
`cargo build --release`
Also you will need to change the main structure of the src folder, like the following example:
Wait for the compiler to finish its work, then go to the third step:
```
├── book.toml
└── src
├── en
│ ├── chapter
│ │ ├── 1.md
│ │ ├── 2.md
│ │ └── README.md
│ ├── README.md
│ ├── SUMMARY.md
│ └── untranslated.md
└── es
├── chapter
│ ├── 1.md
│ ├── 2.md
│ ├── 3.md
│ └── README.md
├── README.md
└── SUMMARY.md
```
`mv ~/mdBook/target/release/mdbook ~/misc/mdbook `
Everything is still to be tested properly.
Now that mdBook has been compiled, launch it:
### Troubleshooting:
`cd ~/misc/mdbook`
`./mdbook serve`
It's possible that the `./mdbook serve` command return this error:
Then open your favorite launcher and type:
**./mdbook: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./mdbook)**
`localhost:3000`
Not all distros might have the latest glibc library, so update your system or update it through [https://www.gnu.org/software/libc/sources.html](https://www.gnu.org/software/libc/sources.html)
\ No newline at end of file
and there's our beautiful documentation running locally.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment