Skip to content

Commit

Permalink
move environment and makefile into docs
Browse files Browse the repository at this point in the history
Signed-off-by: Unai Martinez-Corral <[email protected]>
  • Loading branch information
umarcor committed Mar 9, 2022
1 parent d7f2ee6 commit 4983a34
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
run: |
sudo apt update -qq
sudo apt install -y make
make env
make -C docs env
- name: 📓 Build the documentation
run: |
. ./env/conda/bin/activate f4pga-docs
make html
. ./docs/env/conda/bin/activate f4pga-docs
make -C docs html
- name: '📤 Upload artifact: Sphinx HTML'
uses: actions/upload-artifact@v2
Expand Down
63 changes: 0 additions & 63 deletions Makefile

This file was deleted.

38 changes: 38 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
REQUIREMENTS_FILE := requirements.txt
ENVIRONMENT_FILE := environment.yml

include ../third_party/make-env/conda.mk

# NOTE: make env to create a conda environment with the needed packages

SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

clean::
-rm -rf $(BUILDDIR)/

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
sed -i 's/PDFLATEX = pdflatex/PDFLATEX = texfot pdflatex/' $(BUILDDIR)/latex/Makefile
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
sed -i 's/PDFLATEX = pdflatex/PDFLATEX = texfot pdflatex/' $(BUILDDIR)/latex/Makefile
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

%:
$(SPHINXBUILD) -b $@ $(ALLSPHINXOPTS) $(BUILDDIR)/$@
2 changes: 1 addition & 1 deletion environment.yml → docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
- pygobject
- pip
- pip:
- -r docs/requirements.txt
- -r requirements.txt
7 changes: 1 addition & 6 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: []

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.7"

conda:
environment: environment.yml
environment: docs/environment.yml

submodules:
include: all
Expand Down

0 comments on commit 4983a34

Please sign in to comment.