From ae7d13d29959779fe9ba2c5d7cde004e06f1cf1e Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 19 Aug 2016 14:37:44 +0100 Subject: [PATCH] Ready for new docs site --- .travis.yml | 29 +++++++++++++++---- .../Dell-OpenManage.md | 0 doc/index.md | 15 +++++++++- doc/librenms.css | 9 ++++++ mkdocs.yml | 14 +++++++++ scripts/deploy-docs.sh | 28 ++++++++++++++++++ 6 files changed, 88 insertions(+), 7 deletions(-) rename doc/{Hardware => Extensions}/Dell-OpenManage.md (100%) create mode 100644 doc/librenms.css create mode 100644 mkdocs.yml create mode 100644 scripts/deploy-docs.sh diff --git a/.travis.yml b/.travis.yml index d1746dfa3d..ba6c8b6d36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,30 @@ matrix: fast_finish: true include: - php: 7.0 - env: PHP_L=1 + env: + PHP_L=1 + EXECUTE_BUILD_DOCS=false - php: 5.3 - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false - php: 5.4 - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false - php: 5.5 - env: PHP_L=1 + env: + PHP_L=1 + EXECUTE_BUILD_DOCS=false - php: 5.6 - env: PHP_L=1 PHPCS=0 + env: + PHP_L=1 + PHPCS=0 + EXECUTE_BUILD_DOCS=true - php: hhvm - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false allow_failures: - php: 7.0 @@ -27,6 +40,10 @@ cache: before_script: - composer install --prefer-dist --no-interaction +after_success: + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test $EXECUTE_BUILD_DOCS == "true" && bash scripts/deploy-docs.sh + + script: - if [[ $PHP_L == 1 ]]; then find . -path './vendor' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi - if [[ $PHP_L_OLD == 1 ]]; then find . -regextype posix-extended -regex "\./(lib/influxdb-php|vendor)" -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi diff --git a/doc/Hardware/Dell-OpenManage.md b/doc/Extensions/Dell-OpenManage.md similarity index 100% rename from doc/Hardware/Dell-OpenManage.md rename to doc/Extensions/Dell-OpenManage.md diff --git a/doc/index.md b/doc/index.md index 1fd87742d7..3e6e8809b0 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1 +1,14 @@ -# Welcome to the documentation for [LibreNMS](https://github.com/librenms/librenms) +### Welcome to the LibreNMS docs + +Some of these docs are work in progress or may be missing configuration examples for varying distros. +If you find this is the case then please feel free to edit them on [GitHub](https://github.com/librenms/librenms/tree/master/doc) +and submit a pull request. + +The docs should provide you with information on various elements to the software: + + - Installation + - Support / FAQ + - Developing for LibreNMS + - Available extensions + + diff --git a/doc/librenms.css b/doc/librenms.css new file mode 100644 index 0000000000..d5e2ab61e8 --- /dev/null +++ b/doc/librenms.css @@ -0,0 +1,9 @@ +body { + background-image:none !important; +} + +.dropdown-menu { + max-height: 400px !important; + overflow-x: hidden !important; +} + diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000000..0d58c748a0 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,14 @@ +site_name: LibreNMS Documentation +theme: mkdocs +docs_dir: doc +site_dir: out +site_url: http://docs.librenms.org +markdown_extensions: + - pymdownx.superfences +extra_css: + - librenms.css +include_next_prev: false +site_author: LibreNMS +site_description: LibreNMS user and developer documentation +repo_url: https://github.com/librenms/librenms +repo_name: GitHub diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh new file mode 100644 index 0000000000..f4c9abb3ba --- /dev/null +++ b/scripts/deploy-docs.sh @@ -0,0 +1,28 @@ +#!/bin/bash +GH_REPO="@github.com/librenms/docs.librenms.org.git" +FULL_REPO="https://${GH_TOKEN}$GH_REPO" + +pip install --user mkdocs +pip install --user pymdown-extensions + +mkdir -p out + +cd out + +git init +git remote add origin $FULL_REPO +git fetch +git config user.name "docs-build" +git config user.email "travis@librenms.org" +git checkout gh-pages + +cd ../ + +mkdocs build --clean + +cd out + +touch . +git add -A . +git commit -m "GH-Pages update by travis after $TRAVIS_COMMIT" +git push -q origin gh-pages