From ec0dc30c87a1b770c647641bb3f3abaa1f735032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 11 Jan 2021 11:34:54 +0100 Subject: [PATCH] Generate documentation homepage from README --- .gitlab-ci.yml | 2 +- README.md | 3 ++- docs/src/index.rst.sh | 21 ++++++++------------- scripts/ci-container/Dockerfile | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9392cd9..81db798 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,5 +25,5 @@ docs: - echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: - - make docs + - make html - sftp fnux@staticwebhosting.ungleich.ch:public_html/cdist-contrib <<< "put -r docs/dist/html/*" diff --git a/README.md b/README.md index 4231de2..4d20c22 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ maintained in cdist itself or were not accepted in code cdist but could still be useful. This project does not have releases and is continously updated: see git history -for change log. +for change log. You will find HTML documentation at +[contrib.cdi.st](https://contrib.cdi.st). ## Using cdist-contrib diff --git a/docs/src/index.rst.sh b/docs/src/index.rst.sh index 28c5078..babc1d9 100755 --- a/docs/src/index.rst.sh +++ b/docs/src/index.rst.sh @@ -9,23 +9,18 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" filename="${__cdist_myname%.sh}" dest="$__cdist_abs_mydir/$filename" +if ! command -v pandoc > /dev/null; then + echo "Pandoc is required to generate HTML index from README." >&2 + exit 1 +fi + cd "$__cdist_abs_mydir" exec > "$dest" + +pandoc -f markdown -t rst ../../README.md + cat << EOF -cdist-contrib - Community maintained cdist types -================================================ - -This project extends the \`cdist \`_ configuration management -tool with community-maitained types which are either too specific to fit/be -maintained in cdist itself or were not accepted in code cdist but could still -be useful. - -Please note this project is a **rolling release**! The documentation you're -reading has been generated from the |version| state (commit |release|). -Sources are available on \`code.ungleich.ch -\`_. - .. toctree:: :hidden: diff --git a/scripts/ci-container/Dockerfile b/scripts/ci-container/Dockerfile index daa0f26..9900322 100644 --- a/scripts/ci-container/Dockerfile +++ b/scripts/ci-container/Dockerfile @@ -4,4 +4,4 @@ FROM fedora:latest MAINTAINER Timothée Floure RUN dnf install -y git findutils make python3-sphinx python3-sphinx_rtd_theme \ - ShellCheck openssh-clients + ShellCheck openssh-clients pandoc