From c7ba99ce424a86b947bb6123bc8a7c746eefa7f8 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 3 May 2020 12:40:27 +0000 Subject: [PATCH] Add build instructions I Changed a bit in the README and added a short explanation on how to build the docs using this project and what dependencies are needed. I also added an example of how to build and locally run the docs on a Debian based distro optionally using a Pythin virtual env. --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fa75a2..7564082 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,61 @@ # Pleroma documentation -This project contains a documentation skeleton and a script to fill it in with data, the resulting documentation can be viewed at . If you want to suggest an edit, please refer to `pleroma/pleroma` and `pleroma/pleroma-fe` repos +This project contains a documentation skeleton and a script to fill it in with data, the resulting documentation can be viewed at . + +## Contributing to the documentation + +If you want to suggest an edit, please refer to the `pleroma/pleroma` and `pleroma/pleroma-fe` repos. + +We use [mkdocs](https://www.mkdocs.org/) to build the documentation and have the [admonition](https://squidfunk.github.io/mkdocs-material/extensions/admonition/) extensions that make it possible to add block-styled side content like example summaries, notes, hints or warnings. If you are unsure of how a specific syntax should look like, feel free to look through the docs for an example. + +## Building the docs + +You don't need to build and test the docs as long as you make sure the syntax is correct. But in case you do want to build the docs, feel free to do so. + +You'll need to install mkdocs for which you can check the [mkdocs installation guide](https://www.mkdocs.org/#installation). Generally it's best to install it using `pip`. You'll also need to install the correct dependencies. + +To build the docs you can clone this project and use the `manage.sh` script. + +### Example using a Debian based distro + +#### 1. Optionally create a phython virtual environment + +```shell +python3 -m pip install --user --upgrade pip +python3 -m pip install --user virtualenv +apt install python3-venv +python3 -m venv env +source env/bin/activate +``` + +`source env/bin/activate` activates the virtual environment. When using a virtual environment, make sure to run this when you start a new terminal session. To check if you are running in the correct environment, you can do `which python3`. If you don't use a virtual environment, mkdocs will be installed in the site packages. + +#### 2. Install mkdocs and dependencies + +```shell +pip install --upgrade pip +pip install mkdocs +pip install mkdocs-material +pip install markdown-include +``` + +#### 3. Build the docs using the script + +```shell +git clone https://git.pleroma.social/pleroma/docs +cd docs +./manage.sh all +``` + +`./manage.sh all` will fetch the docs from the pleroma and pleroma-fe repos and build the documentation locally. To see what other options you have, do `./manage.sh --help`. + +#### 4. Serve the files + +A folder `site` containing the static html pages will have been created. You can serve them from a server by pointing your server software (nginx, apache...) to this location. During development, you can run locally with + +```shell +mkdocs serve +``` + +This handles setting up an http server and rebuilding when files change. You can then access the docs on +