Fix requirement Makefile and template

This commit is contained in:
Dirk Alders 2025-08-06 22:54:23 +02:00
parent ee108fe6fc
commit 48030f24a3
2 changed files with 26 additions and 22 deletions

View File

@ -1,38 +1,42 @@
TARGET=specification
MODULE_NAME := $(shell basename `dirname \`pwd\``)
.PHONY: all venv3 tex pdf clean cleanall
.ONESHELL:
SHELL = /usr/bin/bash
.SILENT:
all: release
init: venv3
venv3:
virtualenv -p /usr/bin/python3 venv3
venv3/bin/pip install --upgrade pip
venv3/bin/pip install -r requirements.txt
init: venv
venv:
if [[ ! -e venv ]]; then
virtualenv -p /usr/bin/python3 venv
fi
venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements.txt
tex: venv3
venv3/bin/python3 rspec/__init__.py $(MODULE_NAME)/_requirements_/$(TARGET).py > $(TARGET).tex
tex: venv
venv/bin/python rspec/__init__.py $(MODULE_NAME)/_requirements_/$(TARGET).py > $(TARGET).tex
pdf: tex
latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(TARGET).tex
release: pdf clean
mkdir -p ../pylibs/$(MODULE_NAME)/_requirements_
mv specification.pdf ../pylibs/$(MODULE_NAME)/_requirements_
mkdir -p $(MODULE_NAME)/_requirements_
mv specification.pdf $(MODULE_NAME)/_requirements_
view: pdf clean
xdg-open $(TARGET).pdf
clean:
@echo "\033[1;33mCleaning up requirements...\033[00m"
@echo "\e[1m * Generated latex files...\e[0m"
@latexmk -c -f $(TARGET).tex 1> /dev/null 2> /dev/null
@echo "\e[1m * Generated TeX-File...\e[0m"
@rm -vf *.tex
@rm -rf venv
echo -e "\033[1;33mCleaning up requirements...\033[00m"
echo -e "\e[1m * Generated latex files...\e[0m"
latexmk -c -f $(TARGET).tex 1> /dev/null 2> /dev/null
echo -e "\e[1m * Generated TeX-File...\e[0m"
rm -vf *.tex
rm -rf venv
cleanall: clean
@echo "\e[1m * Generated pdf-File...\e[0m"
@rm -vf $(TARGET).pdf
echo -e "\e[1m * Generated pdf-File...\e[0m"
rm -vf $(TARGET).pdf

View File

@ -11,16 +11,16 @@
{% with item=data.entries[req_uid] %}
\subsection{\xspace{}{{ req_uid }}: {{ macros.latex_filter(item.heading) }} }
{%- if 'description' in item and item.description != '' %}
{{ item.description }}
{{ macros.latex_filter(item.description) }}
{%- if 'reason' in item and item.reason != '' or 'fitcriterion' in item and item.fitcriterion != ''%}
\begin{tabu}{lX}
\toprule
{%- if 'reason' in item and item.reason != '' %}
\emph{Reason} & {{ item.reason }}\\
\emph{Reason} & {{ macros.latex_filter(item.reason) }}\\
{%- endif %}
{%- if 'fitcriterion' in item and item.fitcriterion != '' %}
\emph{Fitcriterion} & {{ item.fitcriterion }}\\
\emph{Fitcriterion} & {{ macros.latex_filter(item.fitcriterion) }}\\
{%- endif %}
\bottomrule
\end{tabu}