From 3208c8317d0cac095cd8486d5fb8d087688d64c1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 24 Feb 2021 21:21:17 -0500 Subject: [PATCH] Switch docs to mkdocs-material --- docs/installation/1-postgresql.md | 25 +++++++------- docs/installation/2-redis.md | 20 ++++++------ docs/installation/3-netbox.md | 54 +++++++++++++++---------------- docs/requirements.txt | 2 +- mkdocs.yml | 7 ++-- 5 files changed, 55 insertions(+), 53 deletions(-) diff --git a/docs/installation/1-postgresql.md b/docs/installation/1-postgresql.md index 4ac1104d7..88e152193 100644 --- a/docs/installation/1-postgresql.md +++ b/docs/installation/1-postgresql.md @@ -7,23 +7,24 @@ This section entails the installation and configuration of a local PostgreSQL da ## Installation -#### Ubuntu +## Installation -Install the PostgreSQL server and client development libraries using `apt`. +=== "Ubuntu" -```no-highlight -sudo apt update -sudo apt install -y postgresql libpq-dev -``` + ```no-highlight + sudo apt update + sudo apt install -y postgresql libpq-dev + ``` -#### CentOS +=== "CentOS" -PostgreSQL 9.6 and later are available natively on CentOS 8.2. If using an earlier CentOS release, you may need to [install it from an RPM](https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/). + ```no-highlight + sudo yum install -y postgresql-server libpq-devel + sudo postgresql-setup --initdb + ``` -```no-highlight -sudo yum install -y postgresql-server libpq-devel -sudo postgresql-setup --initdb -``` + !!! info + PostgreSQL 9.6 and later are available natively on CentOS 8.2. If using an earlier CentOS release, you may need to [install it from an RPM](https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/). CentOS configures ident host-based authentication for PostgreSQL by default. Because NetBox will need to authenticate using a username and password, modify `/var/lib/pgsql/data/pg_hba.conf` to support MD5 authentication by changing `ident` to `md5` for the lines below: diff --git a/docs/installation/2-redis.md b/docs/installation/2-redis.md index 19ec9073e..e31873d2b 100644 --- a/docs/installation/2-redis.md +++ b/docs/installation/2-redis.md @@ -7,19 +7,19 @@ !!! note NetBox v2.9.0 and later require Redis v4.0 or higher. If your distribution does not offer a recent enough release, you will need to build Redis from source. Please see [the Redis installation documentation](https://github.com/redis/redis) for further details. -### Ubuntu +=== "Ubuntu" -```no-highlight -sudo apt install -y redis-server -``` + ```no-highlight + sudo apt install -y redis-server + ``` -### CentOS +=== "CentOS" -```no-highlight -sudo yum install -y redis -sudo systemctl start redis -sudo systemctl enable redis -``` + ```no-highlight + sudo yum install -y redis + sudo systemctl start redis + sudo systemctl enable redis + ``` You may wish to modify the Redis configuration at `/etc/redis.conf` or `/etc/redis/redis.conf`, however in most cases the default configuration is sufficient. diff --git a/docs/installation/3-netbox.md b/docs/installation/3-netbox.md index f2461b40d..03e224e1f 100644 --- a/docs/installation/3-netbox.md +++ b/docs/installation/3-netbox.md @@ -9,17 +9,17 @@ Begin by installing all system packages required by NetBox and its dependencies. !!! note NetBox v2.8.0 and later require Python 3.6, 3.7, or 3.8. -### Ubuntu +=== Ubuntu -```no-highlight -sudo apt install -y python3 python3-pip python3-venv python3-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev -``` + ```no-highlight + sudo apt install -y python3 python3-pip python3-venv python3-dev build-essential libxml2-dev libxslt1-dev libffi-dev libpq-dev libssl-dev zlib1g-dev + ``` -### CentOS +=== CentOS -```no-highlight -sudo yum install -y gcc python36 python36-devel python3-pip libxml2-devel libxslt-devel libffi-devel openssl-devel redhat-rpm-config -``` + ```no-highlight + sudo yum install -y gcc python36 python36-devel python3-pip libxml2-devel libxslt-devel libffi-devel openssl-devel redhat-rpm-config + ``` Before continuing with either platform, update pip (Python's package management tool) to its latest release: @@ -57,17 +57,17 @@ sudo mkdir -p /opt/netbox/ && cd /opt/netbox/ If `git` is not already installed, install it: -#### Ubuntu +=== Ubuntu -```no-highlight -sudo apt install -y git -``` + ```no-highlight + sudo apt install -y git + ``` -#### CentOS +=== CentOS -```no-highlight -sudo yum install -y git -``` + ```no-highlight + sudo yum install -y git + ``` Next, clone the **master** branch of the NetBox GitHub repository into the current directory. (This branch always holds the current stable release.) @@ -89,20 +89,20 @@ Checking connectivity... done. Create a system user account named `netbox`. We'll configure the WSGI and HTTP services to run under this account. We'll also assign this user ownership of the media directory. This ensures that NetBox will be able to save uploaded files. -#### Ubuntu +=== Ubuntu -``` -sudo adduser --system --group netbox -sudo chown --recursive netbox /opt/netbox/netbox/media/ -``` + ``` + sudo adduser --system --group netbox + sudo chown --recursive netbox /opt/netbox/netbox/media/ + ``` -#### CentOS +=== CentOS -``` -sudo groupadd --system netbox -sudo adduser --system -g netbox netbox -sudo chown --recursive netbox /opt/netbox/netbox/media/ -``` + ``` + sudo groupadd --system netbox + sudo adduser --system -g netbox netbox + sudo chown --recursive netbox /opt/netbox/netbox/media/ + ``` ## Configuration diff --git a/docs/requirements.txt b/docs/requirements.txt index 9c863fec7..18b55d37b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,2 @@ -mkdocs==1.1 +mkdocs-material git+https://github.com/cmacmackin/markdown-include.git diff --git a/mkdocs.yml b/mkdocs.yml index 092cb559a..233a61fdf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,14 +5,15 @@ python: install: - requirements: docs/requirements.txt theme: - name: readthedocs - navigation_depth: 3 + name: material extra_css: - extra.css markdown_extensions: - - admonition: + - admonition - markdown_include.include: headingOffset: 1 + - pymdownx.superfences + - pymdownx.tabbed nav: - Introduction: 'index.md' - Installation: