Docs: How to compile the documentation

Created on 26 Mar 2018  ·  6Comments  ·  Source: ovh/docs

If I want to write new tutorials from github, I can't test if the rendering is good because all configuration of your grav is missing and documentation to help the compilation are missing :(

Can you add

  • The doc of the doc
  • Your customs code to compile specific guideslines?
question

Most helpful comment

We’ll open source our full content management platform, with rendering engine this week.

All 6 comments

We’ll open source our full content management platform, with rendering engine this week.

<3

Hi Vincent, as confirmed by Gio we'll add all info in the next days, we just put the docs online and will add docs (doc of the docs and specific tech docs) in the next days / weeks.

Here you can find our Pelican package : https://github.com/ovh/docs-rendering

I need to complete the Readme & some contribution rules.
ATM it's usable.

Next week, we'll push our Docker image to speed up local staging.

Some helpers :

Dockerfile sample :

FROM python:3.5

ENV SRV_DIR=//srv
ENV WORKING_DIR=//srv/pelican
ENV PORT=8000

ADD ./files $SRV_DIR
WORKDIR $WORKING_DIR
RUN mkdir output pages cache
VOLUME ["$WORKING_DIR/pages/"]

RUN pip install -r requirements.txt

EXPOSE $PORT

RUN chmod +x $SRV_DIR/developer_server.sh
CMD ./$SRV_DIR/develop_server.sh restart $PORT

Start.sh

#!/usr/bin/env bash
##
# This section should match your Makefile
##
PY=${PY:-python}
PELICAN=${PELICAN:-pelican}
PELICANOPTS=

BASEDIR=$(pwd)
INPUTDIR=$BASEDIR/pages
OUTPUTDIR=$BASEDIR/output
CONFFILE=$BASEDIR/pelicanconf.py

###
# Don't change stuff below here unless you are sure
###

SRV_PID=$BASEDIR/srv.pid
PELICAN_PID=$BASEDIR/pelican.pid

function usage(){
  echo "usage: $0 (stop) (start) (restart) [port]"
  echo "This starts Pelican in debug and reload mode and then launches"
  echo "an HTTP server to help site development. It doesn't read"
  echo "your Pelican settings, so if you edit any paths in your Makefile"
  echo "you will need to edit your settings as well."
  exit 3
}

function alive() {
  kill -0 $1 >/dev/null 2>&1
}

function shut_down(){
  PID=$(cat $SRV_PID)
  if [[ $? -eq 0 ]]; then
    if alive $PID; then
      echo "Stopping HTTP server"
      kill $PID
    else
      echo "Stale PID, deleting"
    fi
    rm $SRV_PID
  else
    echo "HTTP server PIDFile not found"
  fi

  PID=$(cat $PELICAN_PID)
  if [[ $? -eq 0 ]]; then
    if alive $PID; then
      echo "Killing Pelican"
      kill $PID
    else
      echo "Stale PID, deleting"
    fi
    rm $PELICAN_PID
  else
    echo "Pelican PIDFile not found"
  fi
}

function start_up(){
  local port=$1
  echo "Starting up Pelican and HTTP server"
  shift
  cd $BASEDIR;
  $PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS &
  pelican_pid=$!
  echo $pelican_pid > $PELICAN_PID
  if ! alive $pelican_pid ; then
    echo "Pelican didn't start. Is the Pelican package installed?"
    return 1
  fi
  cd $OUTPUTDIR;
  $PY -m pelican.server $port
  srv_pid=$!
  echo $srv_pid > $SRV_PID
  if ! alive $srv_pid ; then
    echo "The HTTP server didn't start. Is there another service using port" $port "?"
    return 1
  fi
  sleep 1
  echo 'Exiting Pelican and HTTP server processes.'
}

###
#  MAIN
###
[[ ($# -eq 0) || ($# -gt 2) ]] && usage
port=''
[[ $# -eq 2 ]] && port=$2

if [[ $1 == "stop" ]]; then
  shut_down
elif [[ $1 == "restart" ]]; then
  shut_down
  start_up $port
elif [[ $1 == "start" ]]; then
  if ! start_up $port; then
    shut_down
  fi
else
  usage

<3 I will test it the next days.

Voila :)

Official devenv : https://github.com/ovh/docs-developer-env

Was this page helpful?
0 / 5 - 0 ratings