Skip to content

Instantly share code, notes, and snippets.

@marble
Created April 3, 2020 08:20
Show Gist options
  • Save marble/b36c2988a56a28722b336b9be3f0127e to your computer and use it in GitHub Desktop.
Save marble/b36c2988a56a28722b336b9be3f0127e to your computer and use it in GitHub Desktop.
How to set up Ubuntu (18.04) for TYPO3 Sphinx
##################################################
##################################################
# Prepare Ubuntu 18.04 for TYPO3 Sphinx
#
# How to:
#
# 1. Do step (1) first.
# 2. Afterwards run (2) and (3) in the shell.
# This can be done in one go - if you like.
#
# Author: Martin Bless • License: Public domain
#
##################################################
##################################################
# Changed: mb, 2020-04-02, 2020-04-03
###################################################
# (1) Interactively test and set up your system
##################################################
# We need Python 2, pip and pipenv.
#
#
# We do 'pip install --user', that is: for the current user.
# Too bad, but we still need Python 2 at the moment
➜ ~ python --version
Python 2.7.17
# you should have pip. It is required
➜ ~ pip
Usage:
pip <command> [options]
...
# Upgrade pip. It's always good to have the latest pip.
➜ ~ pip install --upgrade --user pip
Requirement already up-to-date: pip in ./.local/lib/python3.6/site-packages (20.0.2)
# We want to use 'pipenv' to set up a Python virtual environment.
➜ ~ pip install --upgrade --user pipenv
Requirement already up-to-date: pipenv in ./.local/lib/python3.6/site-packages (2018.11.26)
##################################################
# (2) Create and fill Python virtual environment
##################################################
# go home
cd
# create a folder for our purposes
mkdir mysphinx
# go there
cd mysphinx
# Let's use our container as a template
dockrun_t3rd export-ALL
# get the requirements
cp Documentation-GENERATED-temp/ALL-exported/venv/* .
# pipenv will detect .venv and Pipfile.lock for installation
mkdir .venv
# Install the Python stuff into .venv
pipenv install
# And activate the shell
pipenv shell
##################################################
# (3) Use the environment
# # activate shell if not yet done
# cd ~/mysphinx
# pipenv shell
# with activated shell
# enter our folder
cd ~/mysphinx
# play around with Sphinx
sphinx-quickstart --help
# create a Sphinx documentation project dummy
sphinx-quickstart -q -p dummy -a dummy -r 1.0.0 --sep
# view make options
make
# build html
make html
# open in browser
firefox build/html/index.html &
##################################################
# (3) Prepare 'dummy' for TYPO3 and render
##################################################
# # activate shell if not yet done
# cd ~/mysphinx
# pipenv shell
# with activated shell
cd ~/mysphinx
cp ./Documentation-GENERATED-temp/ALL-exported/Makedir/conf.py ./source/conf.py
cp ./Documentation-GENERATED-temp/ALL-exported/Makedir/Overrides.cfg ./source/
cp ./source/index.rst ./source/Index.rst
cp ./Documentation-GENERATED-temp/ALL-exported/Makedir/buildsettings.sh ./source/
# and build with TYPO3 theme
make html
# open in TYPO3-like build in browser
firefox build/html/Index.html &
##################################################
# End.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment