From 256cf9e17db9d3ad5f2d811aa88a8e06618f1b76 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 2 Oct 2019 20:42:58 +0300 Subject: [PATCH] Initial usable commit --- .gitignore | 3 + .gitlab-ci.yml | 21 ++--- docs/css/extra.css | 9 ++ docs/images/pleroma_logo_vector_bg_180.png | Bin 0 -> 1929 bytes docs/index.md | 1 + manage.sh | 91 +++++++++++++++++++++ mkdocs.yml | 30 +++++++ 7 files changed, 141 insertions(+), 14 deletions(-) create mode 100644 .gitignore create mode 100644 docs/css/extra.css create mode 100644 docs/images/pleroma_logo_vector_bg_180.png create mode 100644 docs/index.md create mode 100755 manage.sh create mode 100644 mkdocs.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c73b5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +docs/backend +docs/frontend +site diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 266116e..0142dfc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,5 @@ stages: -- fetch -- build +- fetch-and-build - deploy variables: @@ -8,21 +7,15 @@ variables: image: alpine:latest -fetch: - stage: fetch +fetch-and-build: + stage: fetch-and-build artifacts: paths: - - docs/ + - site/ script: - - apk add git - - mkdir docs/ - - git clone https://git.pleroma.social/pleroma/pleroma.git -b master --depth 1 - - cp -r pleroma/docs docs - -build: - stage: build - script: - - echo "noop" + - apk add git py-pip + - pip install mkdocs mkdocs-material + - ./manage.sh all --branch $BRANCH deploy: stage: deploy diff --git a/docs/css/extra.css b/docs/css/extra.css new file mode 100644 index 0000000..893c958 --- /dev/null +++ b/docs/css/extra.css @@ -0,0 +1,9 @@ +.md-typeset a +{ + color: #ffab40; +} + +.md-nav__link--active, .md-nav__link:active +{ + color: #ffab40; +} diff --git a/docs/images/pleroma_logo_vector_bg_180.png b/docs/images/pleroma_logo_vector_bg_180.png new file mode 100644 index 0000000000000000000000000000000000000000..ac82ca0c6661d1fbe3bb33e411ac8f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F1 zOSpw zaK~>hUet--WCVM)0)ZJvs=A>V5M?h)YNVtRQJ<K$SjS`FY;Y}Uz8NAKSM@flyUuz>aXB^p75JW4!ri#Y?r>(7ePk) zGi?Y=JRwAAH~74}v36dcYxlqCevbCn!=ZTeHrCEeT!JJJ3YT(cLP7_sZ|_kDuh4=9 zsxzMMEs3qD)0iAmv_K{yxpMbAq|`Ig$RsEXI=Rcml%tiTJgAQoGCZ@*z&jh{EDenZ z0V_5pvK@%}JVLy4*KR&~^W#wc1-xB!J=#Q=kzxk!pxW?Q-3|}8zxC_UQR|#eKks)v zER0yP`xauIuwlG3);&UdeQ5=pCTF(BKfs~2#KyuS51O$l5q74fG_k&cV;%k^_$`0IilFy_ zg)$6E;(0J6)4sz0Cy8I~{c$<$!XbBPh;p;4Y=ZeLd^)rjMh(6kLH$YObbydO38t9$+ zWyWC672Z1a5S7E0#jYCM=7Z}vIs#p((2BlY%q=j@Au~|BYneu_EMidwZ`?kQ_&}9f zwrl(=uq5)HH&FdVARk-kl!aB|>Cs+O`e!`DjhE=LDK0>bn7YM>k(8G-E86CVwF&ST zRIvB+{`Ip0E4pq&(Yv8vCKUJ1U^`4@7LNZgr8!W#4IaSJqipmXbM7-y)WSV6tgn1y U$K5Ft(KiY}I-Iw!vkkcQFPY@6&j0`b literal 0 HcmV?d00001 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..1333ed7 --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ +TODO diff --git a/manage.sh b/manage.sh new file mode 100755 index 0000000..d38ae85 --- /dev/null +++ b/manage.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +fetch() { + if [ $LOCAL = false ]; then + mkdir .tmp + git clone $FRONTEND_REPO --branch $BRANCH --depth 1 .tmp/fe + git clone $BACKEND_REPO --branch $BRANCH --depth 1 .tmp/be + FRONTEND_REPO=.tmp/fe + BACKEND_REPO=.tmp/fe + fi + rm -rf docs/frontend + rm -rf docs/backend + mkdir docs/frontend + mkdir docs/backend + cp -r $FRONTEND_REPO/docs/* docs/frontend + cp -r $BACKEND_REPO/docs/* docs/backend + rm -rf .tmp +} + +build() { + mkdocs build +} + +all() { + fetch + build +} + +FRONTEND_REMOTE_REPO_DEFAULT='https://git.pleroma.social/pleroma/pleroma-fe' +BACKEND_REMOTE_REPO_DEFAULT='https://git.pleroma.social/pleroma/pleroma' + +FRONTEND_LOCAL_REPO_DEFAULT='../pleroma-fe' +BACKEND_LOCAL_REPO_DEFAULT='../pleroma' +BRANCH='develop' + +if [ -z "$1" ] || [ "$1" = "--help" ]; then + echo "Usage: $(basename "$0") [] + + The stages are: + + fetch [] + Fetch frontend and backend documentation and dump it into \`docs\`. + The location of frontend and backend repositories defaults to + $FRONTEND_REMOTE_REPO_DEFAULT and $BACKEND_REMOTE_REPO_DEFAULT + respectively and can be overriden by \`--frontend-repo\` and \`--backend-repo\`. + The branch defaults to \`$BRANCH\` and can be overriden by \`--branch\`. + + If you want to use local copies of the repositories, add \`--local\` + to options. Then the location of frontend and backend repositiories + will default to $FRONTEND_LOCAL_REPO_DEFAULT and $BACKEND_LOCAL_REPO_DEFAULT respectively and + can be overriden by \`--frontend-repo\` and \`--backend-repo\` as well. + + build [] + Build the documentation + + all [] + Execute all stages + " +else + LOCAL=false + stage="$1" + shift + while echo "$1" | grep "^-" > /dev/null; do + case "$1" in + --local) + LOCAL=true + shift + ;; + --frontend-repo) + FRONTEND_REPO="$2" + shift 2 + ;; + --backend-repo) + BACKEND_REPO="$2" + shift 2 + ;; + -*) + echo "invalid option: $1" 1>&2 + shift 1 + ;; + esac + done + if [ $LOCAL = true ]; then + FRONTEND_REPO="${FRONTEND_REPO:-$FRONTEND_LOCAL_REPO_DEFAULT}" + BACKEND_REPO="${BACKEND_REPO:-$BACKEND_LOCAL_REPO_DEFAULT}" + else + FRONTEND_REPO="${FRONTEND_REPO:-$FRONTEND_REMOTE_REPO_DEFAULT}" + BACKEND_REPO="${BACKEND_REPO:-$BACKEND_REMOTE_REPO_DEFAULT}" + fi + $stage +fi diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..9c8dd8e --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,30 @@ +site_name: Pleroma Documentation +theme: + name: 'material' + # Disable google fonts + font: false + logo: 'images/pleroma_logo_vector_bg_180.png' + feature: + tabs: true + palette: + primary: 'black' + accent: 'orange' + +extra_css: + - css/extra.css +repo_name: 'pleroma' +repo_url: 'https://git.pleroma.social/pleroma' + +extra: + repo_icon: gitlab + +markdown_extensions: + # Note/warning blocks https://squidfunk.github.io/mkdocs-material/extensions/admonition/ + - admonition + - codehilite: + guess_lang: false + # Make it possible to link to every header https://squidfunk.github.io/mkdocs-material/extensions/permalinks/ + - toc: + permalink: true + - pymdownx.tasklist: + custom_checkbox: true