diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ff832e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docs/build/ \ No newline at end of file diff --git a/docs/html_infra.sh b/docs/html_infra.sh new file mode 100644 index 0000000..dc6ad19 --- /dev/null +++ b/docs/html_infra.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +if [ -z "$1" ] +then + DEST_DIR='build' +else + DEST_DIR="$1" +fi + +set -euo pipefail + +function log() { + msg="$1" + echo '' + echo "### ${msg} ###" + echo '' +} + +cd "$(dirname "$0")" + +SRC_DIR="$(pwd)" + +TS="$(date +%s)" +TMP_DIR="/tmp/${TS}" +mkdir -p "${TMP_DIR}" + +VENV_BIN='/tmp/.ag-docs-venv/bin/activate' +if [ -f "$VENV_BIN" ] +then + source "$VENV_BIN" +fi + +log 'BUILDING DOCS' +export PYTHONWARNINGS='ignore' +sphinx-build -b html source/ "${TMP_DIR}/" >/dev/null + +log 'PATCHING METADATA' +cp "${SRC_DIR}/meta/"* "${TMP_DIR}/" + +HTML_META_SRC="" +HTML_META="${HTML_META_SRC}" +HTML_META="${HTML_META}" +HTML_META_EN="${HTML_META}" # +# HTML_LOGO_LINK_SRC='href=".*Go to homepage"' +# HTML_LOGO_LINK_EN='href="https://www.o-x-l.com" class="oxl-nav-logo" title="OXL IT Services Website"' +HTML_TITLE_BAD_EN='Ansible Collection - NFTables documentation' +HTML_TITLE_OK='NFTables Ansible Collection' +HTML_LANG_NONE=' + + https://nftables.ansibleguy.net/en/latest/ + + https://nftables.ansibleguy.net/en/latest/usage/1_install.html + https://nftables.ansibleguy.net/en/latest/usage/2_basic.html + + https://nftables.ansibleguy.net/en/latest/modules/1_basic.html + https://nftables.ansibleguy.net/en/latest/modules/chain.html + https://nftables.ansibleguy.net/en/latest/modules/list.html + https://nftables.ansibleguy.net/en/latest/modules/rule.html + https://nftables.ansibleguy.net/en/latest/modules/table.html + + \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 3000179..be10f95 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,9 +10,10 @@ exclude_patterns = [] html_theme = 'piccolo_theme' html_static_path = ['_static'] -html_logo = 'https://netfilter.org/images/netfilter-logo3.png' +html_logo = 'https://files.oxl.at/logos/netfilter.png' html_favicon = '_static/img/logo.png' -html_css_files = ['css/main.css'] +html_js_files = ['https://files.oxl.at/js/feedback.js'] +html_css_files = ['css/main.css', 'https://files.oxl.at/css/feedback.css'] master_doc = 'index' display_version = True sticky_navigation = True @@ -21,6 +22,7 @@ } html_theme_options = { 'banner_text': 'Repository on GitHub | ' - 'Report errors' + 'Report Errors | ' + 'Get Support' } html_short_title = 'Ansible NFTables' diff --git a/docs/venv.sh b/docs/venv.sh new file mode 100644 index 0000000..291c436 --- /dev/null +++ b/docs/venv.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cd "$(dirname "$0")" + +VENV_PATH='/tmp/.ag-docs-venv' + +python3 -m virtualenv "$VENV_PATH" +source "${VENV_PATH}/bin/activate" + +pip install -r requirements.txt >/dev/null \ No newline at end of file