fix: got teh ci/cd working
This commit is contained in:
parent
240b2ab9cf
commit
7ce5eb3fe5
3 changed files with 38 additions and 24 deletions
|
@ -1,7 +1,7 @@
|
||||||
\documentclass{article}
|
\documentclass{article}
|
||||||
\usepackage{graphicx}
|
\usepackage{graphicx}
|
||||||
% use the files
|
% use the files
|
||||||
\graphicspath{{Resources}{../}{./}}
|
\graphicspath{{../Resources}{../}}
|
||||||
\usepackage{hyperref}
|
\usepackage{hyperref}
|
||||||
% from https://tex.stackexchange.com/a/73866
|
% from https://tex.stackexchange.com/a/73866
|
||||||
\hypersetup{
|
\hypersetup{
|
||||||
|
|
33
_scripts/format_constitution.sh
Executable file
33
_scripts/format_constitution.sh
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
root="$PWD"
|
||||||
|
|
||||||
|
folder_pdf="pdf_constitution"
|
||||||
|
folder_pdf_tmp="pdf_constitution_tmp"
|
||||||
|
|
||||||
|
function build_pdf() {
|
||||||
|
# used to match **
|
||||||
|
shopt -s globstar
|
||||||
|
|
||||||
|
# wipe and reset past runs
|
||||||
|
rm -rf "$folder_pdf"
|
||||||
|
mkdir "$folder_pdf"
|
||||||
|
|
||||||
|
mkdir "$folder_pdf_tmp"
|
||||||
|
cd "$folder_pdf_tmp"
|
||||||
|
# 3 times so the table of contens can work
|
||||||
|
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf ../Resources/Documents/Constitution.tex || true
|
||||||
|
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf ../Resources/Documents/Constitution.tex || true
|
||||||
|
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf ../Resources/Documents/Constitution.tex || true
|
||||||
|
cd ../
|
||||||
|
cp "$folder_pdf_tmp"/*.pdf "$folder_pdf"
|
||||||
|
rm -rf "$folder_pdf_tmp"
|
||||||
|
|
||||||
|
shopt -u globstar
|
||||||
|
cd $root
|
||||||
|
|
||||||
|
# wait for background tasks to complete
|
||||||
|
wait $(jobs -p)
|
||||||
|
}
|
||||||
|
|
||||||
|
build_pdf
|
27
flake.nix
27
flake.nix
|
@ -41,11 +41,6 @@
|
||||||
#scheme-full
|
#scheme-full
|
||||||
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
|
inherit (pkgs.texlive) scheme-full latex-bin latexmk;
|
||||||
};
|
};
|
||||||
|
|
||||||
vars = [ "sender" "receiver" ];
|
|
||||||
texvars = toString
|
|
||||||
(pkgs.lib.imap1 (i: n: ''\def\${n}{${"$" + (toString i)}}'') vars);
|
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
# `nix develop`
|
# `nix develop`
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
|
@ -58,24 +53,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
# using https://flyx.org/nix-flakes-latex/ as a basic
|
constitution = pkgs.writeShellScriptBin "format_constitution" ''
|
||||||
constitution = pkgs.stdenvNoCC.mkDerivation rec {
|
export PATH=${pkgs.lib.makeBinPath [pkgs.coreutils tex]}:$PATH
|
||||||
name = "ul_computer-society_constitution";
|
${./_scripts/format_constitution.sh}
|
||||||
src = self;
|
'';
|
||||||
buildInputs = [ pkgs.coreutils tex ];
|
|
||||||
phases = ["unpackPhase" "buildPhase" "installPhase"];
|
|
||||||
buildPhase = ''
|
|
||||||
export PATH="${pkgs.lib.makeBinPath buildInputs}";
|
|
||||||
# have to do it 3 times to get teh table of contents working properly
|
|
||||||
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf Resources/Documents/Constitution.tex || true
|
|
||||||
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf Resources/Documents/Constitution.tex || true
|
|
||||||
pdflatex -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf Resources/Documents/Constitution.tex || true
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp Constitution.pdf $out/
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
handovers = pkgs.writeShellScriptBin "format_handovers" ''
|
handovers = pkgs.writeShellScriptBin "format_handovers" ''
|
||||||
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
|
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue